Skip to content

Commit

Permalink
Merge pull request #5925 from dalg24/kokkos_hip_architectures
Browse files Browse the repository at this point in the history
Export `Kokkos_HIP_ARCHITECTURES` variable with CMake
  • Loading branch information
dalg24 committed Mar 1, 2023
2 parents 310812b + b9e423e commit 8b80bd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/KokkosConfigCommon.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ IF(Kokkos_ENABLE_CUDA)
SET(Kokkos_CUDA_ARCHITECTURES @KOKKOS_CUDA_ARCHITECTURES@)
ENDIF()

IF(Kokkos_ENABLE_HIP)
SET(Kokkos_HIP_ARCHITECTURES @KOKKOS_HIP_ARCHITECTURES@)
ENDIF()

IF(NOT Kokkos_FIND_QUIETLY)
MESSAGE(STATUS "Enabled Kokkos devices: ${Kokkos_DEVICES}")
ENDIF()
Expand Down
3 changes: 3 additions & 0 deletions cmake/kokkos_arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ FUNCTION(CHECK_AMDGPU_ARCH ARCH FLAG)
MESSAGE(WARNING "Given AMD GPU architecture ${ARCH}, but Kokkos_ENABLE_HIP and Kokkos_ENABLE_OPENMPTARGET are OFF. Option will be ignored.")
UNSET(KOKKOS_ARCH_${ARCH} PARENT_SCOPE)
ELSE()
IF(KOKKOS_ENABLE_HIP)
SET(KOKKOS_HIP_ARCHITECTURES ${FLAG} PARENT_SCOPE)
ENDIF()
SET(KOKKOS_AMDGPU_ARCH_FLAG ${FLAG} PARENT_SCOPE)
GLOBAL_APPEND(KOKKOS_AMDGPU_OPTIONS "${AMDGPU_ARCH_FLAG}=${FLAG}")
IF(KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE)
Expand Down

0 comments on commit 8b80bd0

Please sign in to comment.