Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
cmake_minimum_required(VERSION 3.12)

# Ensure custom cmake modules can be found
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# Options should be defined before they're used
option(GMGPOLAR_BUILD_TESTS "Build GMGPolar unit tests." ON)
option(GMGPOLAR_USE_LIKWID "Use LIKWID to measure code (regions)." OFF)
Expand All @@ -18,7 +15,9 @@ endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# Ensure custom cmake modules can be found
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GMGPolarCheckRequiredKokkosOptions)

# Set build type - must come before compiler flags
if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -49,6 +48,7 @@ if(GMGPOLAR_ENABLE_COVERAGE)
endif()

find_package(Kokkos 4.4.1...<6 QUIET REQUIRED)
gmgpolar_check_required_kokkos_options()

if(GMGPOLAR_USE_MUMPS)
find_package(MUMPS REQUIRED COMPONENTS OpenMP METIS)
Expand Down
14 changes: 14 additions & 0 deletions cmake/GMGPolarCheckRequiredKokkosOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function(gmgpolar_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()
kokkos_check(DEVICES SYCL RETURN_VALUE is_sycl_enabled)
if("${is_sycl_enabled}")
kokkos_check(OPTIONS SYCL_RELOCATABLE_DEVICE_CODE)
endif()
endfunction()
Loading