Skip to content

Commit

Permalink
Check required kokkos options (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau authored Jan 3, 2025
1 parent f66de69 commit fb9bb4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ if("${DDC_Kokkos_DEPENDENCY_POLICY}" STREQUAL "AUTO")
find_package(Kokkos 4.4...4.5 QUIET)
if(NOT Kokkos_FOUND)
ddc_configure_kokkos()
else()
ddc_check_required_kokkos_options()
endif()
endif()
elseif("${DDC_Kokkos_DEPENDENCY_POLICY}" STREQUAL "EMBEDDED")
ddc_configure_kokkos()
elseif("${DDC_Kokkos_DEPENDENCY_POLICY}" STREQUAL "INSTALLED")
find_package(Kokkos 4.4...4.5 REQUIRED)
ddc_check_required_kokkos_options()
endif()

## PDI
Expand Down
11 changes: 11 additions & 0 deletions cmake/DDCVendorConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ macro(ddc_configure_kokkos)
add_subdirectory(vendor/kokkos)
endmacro()

function(ddc_check_required_kokkos_options)
kokkos_check(DEVICES CUDA RETURN_VALUE is_cuda_enabled)
if("${is_cuda_enabled}")
kokkos_check(OPTIONS CUDA_CONSTEXPR CUDA_RELOCATABLE_DEVICE_CODE)
endif()
kokkos_check(DEVICES HIP RETURN_VALUE is_hip_enabled)
if("${is_hip_enabled}")
kokkos_check(OPTIONS HIP_RELOCATABLE_DEVICE_CODE)
endif()
endfunction()

macro(ddc_configure_kokkos_fft)
option(KokkosFFT_ENABLE_HOST_AND_DEVICE "Enable FFT on both host and device" ON)
add_subdirectory(vendor/kokkos-fft)
Expand Down

0 comments on commit fb9bb4e

Please sign in to comment.