Update Kokkos library to v2.03.13
This commit is contained in:
@ -33,6 +33,7 @@ include $(KOKKOS_PATH)/Makefile.kokkos
|
||||
|
||||
build: $(EXE)
|
||||
|
||||
#for unit testing only, for best preformance with OpenMP 4.0 or better
|
||||
test: $(EXE)
|
||||
./$(EXE)
|
||||
|
||||
|
||||
@ -22,100 +22,102 @@ endif
|
||||
build:
|
||||
mkdir -p 01_data_layouts
|
||||
cd ./01_data_layouts; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/01_data_layouts/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/01_data_layouts/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 02_memory_traits
|
||||
cd ./02_memory_traits; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/02_memory_traits/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/02_memory_traits/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 03_subviews
|
||||
cd ./03_subviews; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/03_subviews/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/03_subviews/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 04_dualviews
|
||||
cd ./04_dualviews; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/04_dualviews/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/04_dualviews/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 05_NVIDIA_UVM
|
||||
cd ./05_NVIDIA_UVM; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/05_NVIDIA_UVM/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/05_NVIDIA_UVM/Makefile ${KOKKOS_SETTINGS}
|
||||
#mkdir -p 06_AtomicViews
|
||||
#cd ./06_AtomicViews; \
|
||||
#make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/06_AtomicViews/Makefile ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/06_AtomicViews/Makefile ${KOKKOS_SETTINGS}
|
||||
#mkdir -p 07_Overlapping_DeepCopy
|
||||
#cd ./07_Overlapping_DeepCopy; \
|
||||
#make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/Makefile ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
build-insource:
|
||||
cd ./01_data_layouts; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./02_memory_traits; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./03_subviews; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./04_dualviews; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./05_NVIDIA_UVM; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
#cd ./06_AtomicViews; \
|
||||
#make build -j 4 ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
#cd ./07_Overlapping_DeepCopy; \
|
||||
#make build -j 4 ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
|
||||
test:
|
||||
cd ./01_data_layouts; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/01_data_layouts/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/01_data_layouts/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_memory_traits; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/02_memory_traits/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/02_memory_traits/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_subviews; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/03_subviews/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/03_subviews/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./04_dualviews; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/04_dualviews/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/04_dualviews/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./05_NVIDIA_UVM; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/05_NVIDIA_UVM/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/05_NVIDIA_UVM/Makefile ${KOKKOS_SETTINGS}
|
||||
#cd ./06_AtomicViews; \
|
||||
#make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/06_AtomicViews/Makefile ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/06_AtomicViews/Makefile ${KOKKOS_SETTINGS}
|
||||
#cd ./07_Overlapping_DeepCopy; \
|
||||
#make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/Makefile ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
test-insource:
|
||||
cd ./01_data_layouts; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./02_memory_traits; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./03_subviews; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./04_dualviews; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./05_NVIDIA_UVM; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
#cd ./06_AtomicViews; \
|
||||
#make test -j 4 ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
#cd ./07_Overlapping_DeepCopy; \
|
||||
#make test -j 4 ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
|
||||
clean:
|
||||
cd ./01_data_layouts; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/01_data_layouts/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/01_data_layouts/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_memory_traits; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/02_memory_traits/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/02_memory_traits/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_subviews; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/03_subviews/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/03_subviews/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./04_dualviews; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/04_dualviews/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/04_dualviews/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./05_NVIDIA_UVM; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/05_NVIDIA_UVM/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/05_NVIDIA_UVM/Makefile ${KOKKOS_SETTINGS}
|
||||
#cd ./06_AtomicViews; \
|
||||
#make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/06_AtomicViews/Makefile ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/06_AtomicViews/Makefile ${KOKKOS_SETTINGS}
|
||||
#cd ./07_Overlapping_DeepCopy; \
|
||||
#make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/Makefile ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
clean-insource:
|
||||
cd ./01_data_layouts; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./02_memory_traits; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./03_subviews; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./04_dualviews; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./05_NVIDIA_UVM; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
#cd ./06_AtomicViews; \
|
||||
#make clean ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
#cd ./07_Overlapping_DeepCopy; \
|
||||
#make clean ${KOKKOS_SETTINGS}
|
||||
#$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
|
||||
@ -22,22 +22,22 @@ endif
|
||||
build:
|
||||
mkdir -p 01_random_numbers
|
||||
cd ./01_random_numbers; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Algorithms/01_random_numbers/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Algorithms/01_random_numbers/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
build-insource:
|
||||
cd ./01_random_numbers; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
test:
|
||||
cd ./01_random_numbers; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Algorithms/01_random_numbers/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Algorithms/01_random_numbers/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
test-insource:
|
||||
cd ./01_random_numbers; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
clean:
|
||||
cd ./01_random_numbers; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Algorithms/01_random_numbers/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Algorithms/01_random_numbers/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
clean-insource:
|
||||
cd ./01_random_numbers; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
|
||||
@ -22,74 +22,74 @@ endif
|
||||
build:
|
||||
mkdir -p 01_thread_teams
|
||||
cd ./01_thread_teams; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 01_thread_teams_lambda
|
||||
cd ./01_thread_teams_lambda; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 02_nested_parallel_for
|
||||
cd ./02_nested_parallel_for; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 03_vectorization
|
||||
cd ./03_vectorization; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/03_vectorization/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/03_vectorization/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 04_team_scan
|
||||
cd ./04_team_scan; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/04_team_scan/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/04_team_scan/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
build-insource:
|
||||
cd ./01_thread_teams; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./01_thread_teams_lambda; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./02_nested_parallel_for; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./03_vectorization; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./04_team_scan; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
test:
|
||||
cd ./01_thread_teams; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./01_thread_teams_lambda; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_nested_parallel_for; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_vectorization; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/03_vectorization/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/03_vectorization/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./04_team_scan; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/04_team_scan/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/04_team_scan/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
test-insource:
|
||||
cd ./01_thread_teams; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./01_thread_teams_lambda; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./02_nested_parallel_for; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./03_vectorization; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./04_team_scan; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
clean:
|
||||
cd ./01_thread_teams; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./01_thread_teams_lambda; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_nested_parallel_for; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_vectorization; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/03_vectorization/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/03_vectorization/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./04_team_scan; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/04_team_scan/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/04_team_scan/Makefile ${KOKKOS_SETTINGS}
|
||||
|
||||
clean-insource:
|
||||
cd ./01_thread_teams; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./01_thread_teams_lambda; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./02_nested_parallel_for; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./03_vectorization; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./04_team_scan; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
|
||||
@ -23,152 +23,152 @@ endif
|
||||
build:
|
||||
mkdir -p 01_hello_world
|
||||
cd ./01_hello_world; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/01_hello_world/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/01_hello_world/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 01_hello_world_lambda
|
||||
cd ./01_hello_world_lambda; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/01_hello_world_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/01_hello_world_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 02_simple_reduce
|
||||
cd ./02_simple_reduce; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 02_simple_reduce_lambda
|
||||
cd ./02_simple_reduce_lambda; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 03_simple_view
|
||||
cd ./03_simple_view; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/03_simple_view/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/03_simple_view/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 03_simple_view_lambda
|
||||
cd ./03_simple_view_lambda; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/03_simple_view_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/03_simple_view_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 04_simple_memoryspaces
|
||||
cd ./04_simple_memoryspaces; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/04_simple_memoryspaces/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/04_simple_memoryspaces/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p 05_simple_atomics
|
||||
cd ./05_simple_atomics; \
|
||||
make build -j 4 -f ${KOKKOS_PATH}/example/tutorial/05_simple_atomics/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/05_simple_atomics/Makefile ${KOKKOS_SETTINGS}
|
||||
mkdir -p Advanced_Views
|
||||
cd ./Advanced_Views; \
|
||||
make build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
mkdir -p Algorithms
|
||||
cd ./Algorithms; \
|
||||
make build -f ${KOKKOS_PATH}/example/tutorial/Algorithms/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Algorithms/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
mkdir -p Hierarchical_Parallelism
|
||||
cd ./Hierarchical_Parallelism; \
|
||||
make build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) build -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
|
||||
build-insource:
|
||||
cd ./01_hello_world; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./01_hello_world_lambda; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce_lambda; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view_lambda; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./04_simple_memoryspaces; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./05_simple_atomics; \
|
||||
make build -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) build ${KOKKOS_SETTINGS}
|
||||
cd ./Advanced_Views; \
|
||||
make build KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) build KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Algorithms; \
|
||||
make build KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) build KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Hierarchical_Parallelism; \
|
||||
make build KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) build KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
test:
|
||||
cd ./01_hello_world; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/01_hello_world/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/01_hello_world/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./01_hello_world_lambda; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/01_hello_world_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/01_hello_world_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce_lambda; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/03_simple_view/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/03_simple_view/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view_lambda; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/03_simple_view_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/03_simple_view_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./04_simple_memoryspaces; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/04_simple_memoryspaces/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/04_simple_memoryspaces/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./05_simple_atomics; \
|
||||
make test -j 4 -f ${KOKKOS_PATH}/example/tutorial/05_simple_atomics/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/05_simple_atomics/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./Advanced_Views; \
|
||||
make test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Algorithms; \
|
||||
make test -f ${KOKKOS_PATH}/example/tutorial/Algorithms/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Algorithms/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Hierarchical_Parallelism; \
|
||||
make test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) test -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
|
||||
test-insource:
|
||||
cd ./01_hello_world; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./01_hello_world_lambda; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce_lambda; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view_lambda; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./04_simple_memoryspaces; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./05_simple_atomics; \
|
||||
make test -j 4 ${KOKKOS_SETTINGS}
|
||||
$(MAKE) test ${KOKKOS_SETTINGS}
|
||||
cd ./Advanced_Views; \
|
||||
make test KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) test KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Algorithms; \
|
||||
make test KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) test KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Hierarchical_Parallelism; \
|
||||
make test KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) test KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
clean:
|
||||
cd ./01_hello_world; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/01_hello_world/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/01_hello_world/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./01_hello_world_lambda; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/01_hello_world_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/01_hello_world_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce_lambda; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/02_simple_reduce_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/03_simple_view/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/03_simple_view/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view_lambda; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/03_simple_view_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/03_simple_view_lambda/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./04_simple_memoryspaces; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/04_simple_memoryspaces/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/04_simple_memoryspaces/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./05_simple_atomics; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/05_simple_atomics/Makefile ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/05_simple_atomics/Makefile ${KOKKOS_SETTINGS}
|
||||
cd ./Advanced_Views; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Advanced_Views/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Algorithms; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Algorithms/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Algorithms/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Hierarchical_Parallelism; \
|
||||
make clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) clean -f ${KOKKOS_PATH}/example/tutorial/Hierarchical_Parallelism/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
|
||||
clean-insource:
|
||||
cd ./01_hello_world; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./01_hello_world_lambda; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./02_simple_reduce_lambda; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./03_simple_view_lambda; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./04_simple_memoryspaces; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./05_simple_atomics; \
|
||||
make clean ${KOKKOS_SETTINGS}
|
||||
$(MAKE) clean ${KOKKOS_SETTINGS}
|
||||
cd ./Advanced_Views; \
|
||||
make clean KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) clean KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Algorithms; \
|
||||
make clean KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) clean KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
cd ./Hierarchical_Parallelism; \
|
||||
make clean KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
$(MAKE) clean KOKKOS_SETTINGS='${KOKKOS_SETTINGS}'
|
||||
|
||||
10
lib/kokkos/example/tutorial/launch_bounds/CMakeLists.txt
Normal file
10
lib/kokkos/example/tutorial/launch_bounds/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# This is a tutorial, not a test, so we don't ask CTest to run it.
|
||||
TRIBITS_ADD_EXECUTABLE(
|
||||
tutorial_02_simple_reduce
|
||||
SOURCES simple_reduce.cpp
|
||||
COMM serial mpi
|
||||
)
|
||||
56
lib/kokkos/example/tutorial/launch_bounds/Makefile
Normal file
56
lib/kokkos/example/tutorial/launch_bounds/Makefile
Normal file
@ -0,0 +1,56 @@
|
||||
KOKKOS_PATH = ../../..
|
||||
KOKKOS_SRC_PATH = ${KOKKOS_PATH}
|
||||
SRC = $(wildcard ${KOKKOS_SRC_PATH}/example/tutorial/launch_bounds/*.cpp)
|
||||
vpath %.cpp $(sort $(dir $(SRC)))
|
||||
|
||||
default: build
|
||||
echo "Start Build"
|
||||
|
||||
ifneq (,$(findstring Cuda,$(KOKKOS_DEVICES)))
|
||||
CXX = ${KOKKOS_PATH}/bin/nvcc_wrapper
|
||||
CXXFLAGS = -O3
|
||||
LINK = ${CXX}
|
||||
LINKFLAGS =
|
||||
EXE = launch_bounds.cuda
|
||||
KOKKOS_DEVICES = "Cuda,OpenMP"
|
||||
KOKKOS_ARCH = "SNB,Kepler35"
|
||||
else
|
||||
CXX = g++
|
||||
CXXFLAGS = -O3
|
||||
LINK = ${CXX}
|
||||
LINKFLAGS =
|
||||
EXE = launch_bounds.host
|
||||
KOKKOS_DEVICES = "OpenMP"
|
||||
KOKKOS_ARCH = "SNB"
|
||||
endif
|
||||
|
||||
# WAR for "undefined memcpy" w/ Ubuntu + CUDA 7.5
|
||||
CXXFLAGS += -D_FORCE_INLINES
|
||||
# Additional compile-time information
|
||||
CXXFLAGS += -Xptxas=-v
|
||||
|
||||
DEPFLAGS = -M
|
||||
|
||||
OBJ = $(notdir $(SRC:.cpp=.o))
|
||||
LIB =
|
||||
|
||||
include $(KOKKOS_PATH)/Makefile.kokkos
|
||||
|
||||
temp:
|
||||
echo $(KOKKOS_INTERNAL_USE_CUDA) $(CUDA_PATH)
|
||||
|
||||
build: $(EXE)
|
||||
|
||||
test: $(EXE)
|
||||
./$(EXE)
|
||||
|
||||
$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS)
|
||||
$(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE)
|
||||
|
||||
clean: kokkos-clean
|
||||
rm -f *.o *.cuda *.host
|
||||
|
||||
# Compilation rules
|
||||
|
||||
%.o:%.cpp $(KOKKOS_CPP_DEPENDS)
|
||||
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< -o $(notdir $@)
|
||||
@ -0,0 +1,173 @@
|
||||
/*
|
||||
//@HEADER
|
||||
// ************************************************************************
|
||||
//
|
||||
// Kokkos v. 2.0
|
||||
// Copyright (2014) Sandia Corporation
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the Corporation nor the names of the
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov)
|
||||
//
|
||||
// ************************************************************************
|
||||
//@HEADER
|
||||
*/
|
||||
|
||||
#include <Kokkos_Core.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
//
|
||||
// First reduction (parallel_reduce) example:
|
||||
// 1. Start up Kokkos
|
||||
// 2. Execute a parallel_reduce loop in the default execution space,
|
||||
// using a functor to define the loop body
|
||||
// 3. Shut down Kokkos
|
||||
//
|
||||
struct collision {
|
||||
// Reduction functor
|
||||
// For each i, we generate 10 hashes, look for and count collisions
|
||||
// We use parallel_reduce to count the total collisions
|
||||
// Note that we're just counting collisions within the 10 generated
|
||||
// one i.
|
||||
// This function was chosen as one that very simply can increase the
|
||||
// register count.
|
||||
typedef int value_type;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
int hash(int q) const {
|
||||
// A simple hash by Justin Sobel
|
||||
// Thanks to Arash Partow (partow.net)
|
||||
char* fourchars = (char*)&q;
|
||||
int hash = 1315423911;
|
||||
for (int i=0; i<4; fourchars++, i++) {
|
||||
hash ^= ((hash<<5) + *fourchars + (hash >> 2));
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator () (const int i, int& lsum) const {
|
||||
//This is a silly function which generates 10 hashes
|
||||
// then checks for collisions
|
||||
int a = hash(i)%64;
|
||||
int b = hash(i*3)%64;
|
||||
int c = hash(i*5)%64;
|
||||
int d = hash(i*7)%64;
|
||||
int e = hash(i*11)%64;
|
||||
int f = hash(i*17)%64;
|
||||
int g = hash(i*23)%64;
|
||||
int h = hash(i*29)%64;
|
||||
int j = hash(i*31)%64;
|
||||
int k = hash(i*37)%64;
|
||||
|
||||
|
||||
if (a==b) lsum++;
|
||||
if (a==c) lsum++;
|
||||
if (a==d) lsum++;
|
||||
if (a==e) lsum++;
|
||||
if (a==f) lsum++;
|
||||
if (a==g) lsum++;
|
||||
if (a==h) lsum++;
|
||||
if (a==j) lsum++;
|
||||
if (a==k) lsum++;
|
||||
if (b==c) lsum++;
|
||||
if (b==d) lsum++;
|
||||
if (b==e) lsum++;
|
||||
if (b==f) lsum++;
|
||||
if (b==g) lsum++;
|
||||
if (b==h) lsum++;
|
||||
if (b==j) lsum++;
|
||||
if (b==k) lsum++;
|
||||
if (c==d) lsum++;
|
||||
if (c==e) lsum++;
|
||||
if (c==f) lsum++;
|
||||
if (c==g) lsum++;
|
||||
if (c==h) lsum++;
|
||||
if (c==j) lsum++;
|
||||
if (c==k) lsum++;
|
||||
if (d==e) lsum++;
|
||||
if (d==f) lsum++;
|
||||
if (d==g) lsum++;
|
||||
if (d==h) lsum++;
|
||||
if (d==j) lsum++;
|
||||
if (d==k) lsum++;
|
||||
if (e==f) lsum++;
|
||||
if (e==g) lsum++;
|
||||
if (e==h) lsum++;
|
||||
if (e==j) lsum++;
|
||||
if (e==k) lsum++;
|
||||
if (f==g) lsum++;
|
||||
if (f==h) lsum++;
|
||||
if (f==j) lsum++;
|
||||
if (f==k) lsum++;
|
||||
if (g==h) lsum++;
|
||||
if (g==j) lsum++;
|
||||
if (g==k) lsum++;
|
||||
if (h==j) lsum++;
|
||||
if (h==k) lsum++;
|
||||
if (j==k) lsum++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main (int argc, char* argv[]) {
|
||||
Kokkos::initialize (argc, argv);
|
||||
const int n = 10000;
|
||||
|
||||
// Compute and count hash collisions in
|
||||
// parallel, using Kokkos.
|
||||
// This is not really a useful algorithm, but it demonstrates the
|
||||
// LaunchBounds functionality
|
||||
int sum1 = 0;
|
||||
int sum2 = 0;
|
||||
|
||||
//Without LaunchBounds, the kernel uses 56 registers
|
||||
Kokkos::parallel_reduce (n, collision (), sum1);
|
||||
|
||||
//With LaunchBounds, we can reduce the register usage to 32
|
||||
Kokkos::parallel_reduce (Kokkos::RangePolicy<Kokkos::LaunchBounds<512,4>>(0,n), collision (), sum2);
|
||||
|
||||
printf ("Number of collisions, "
|
||||
"computed in parallel, is %i\n", sum1);
|
||||
|
||||
if (sum1 != sum2) {
|
||||
printf( "Uh-oh! Results do not match\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Kokkos::finalize();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user