Skip to content

Commit

Permalink
Build GPU code only for arch enabled in Kokkos
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Mar 8, 2022
1 parent e81514a commit 8eba959
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Expand Up @@ -7,6 +7,20 @@ if(Kokkos_ENABLE_CUDA)
kokkos_check(OPTIONS CUDA_LAMBDA)
endif()

if(Kokkos_ENABLE_HIP AND NOT DEFINED GPU_TARGETS)
if(VEGA900 IN_LIST Kokkos_ARCH)
set(GPU_TARGETS gfx900)
elseif(VEGA906 IN_LIST Kokkos_ARCH)
set(GPU_TARGETS gfx906)
elseif(VEGA908 IN_LIST Kokkos_ARCH)
set(GPU_TARGETS gfx908)
elseif(VEGA90A IN_LIST Kokkos_ARCH)
set(GPU_TARGETS gfx90a)
else()
message(WARNING "GPU device code will be built for all supported architectures for AMD ROCm.")
endif()
endif()

add_library(ArborX INTERFACE)
target_link_libraries(ArborX INTERFACE Kokkos::kokkos)
set_target_properties(ArborX PROPERTIES INTERFACE_COMPILE_FEATURES cxx_std_14)
Expand Down

0 comments on commit 8eba959

Please sign in to comment.