@@ -20,9 +20,9 @@ if (HAERO_BUILDS_EKAT)
2020 include (EkatBuildEkat)
2121 set (EKAT_ENABLE_MPI ${HAERO_ENABLE_MPI} CACHE BOOL "Enable MPI" )
2222 set (EKAT_ENABLE_FORTRAN OFF CACHE BOOL "Enable EKAT Fortran support" )
23- set (EKAT_ENABLE_TESTS OFF CACHE BOOL "Disable EKAT tests" )
24- set (Kokkos_ENABLE_LIBDL OFF CACHE BOOL "Disable broken Kokkos libdl support" )
25- set (Kokkos_ENABLE_DEPRECATED_CODE_3 OFF CACHE BOOL "Disable deprecated code to avoid warnings of using deprecated functions." )
23+ set (EKAT_ENABLE_TESTS OFF CACHE BOOL "Enable EKAT tests" )
24+ set (Kokkos_ENABLE_LIBDL OFF CACHE BOOL "Enable broken Kokkos libdl support" )
25+ set (Kokkos_ENABLE_DEPRECATED_CODE_3 OFF CACHE BOOL "Enable deprecated code to avoid warnings of using deprecated functions." )
2626 if (HAERO_SKIP_FIND_YAML_CPP)
2727 set (EKAT_SKIP_FIND_YAML_CPP ON CACHE BOOL "EKAT will build yaml-cpp " )
2828 message (STATUS "SKIP FIND YAML CPP" )
@@ -43,18 +43,27 @@ if (HAERO_BUILDS_EKAT)
4343 set (EKAT_ENABLE_FPE OFF CACHE BOOL "" )
4444 endif ()
4545 if (HAERO_ENABLE_GPU)
46+ if (HAERO_AMD_GPU)
47+ set (Kokkos_ENABLE_HIP ON CACHE BOOL "Enable HIP Kokkos backend" )
48+ else ()
49+ set (Kokkos_ENABLE_CUDA ON CACHE BOOL "Enable CUDA Kokkos backend" )
50+ set (Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Enable CUDA lambdas" )
51+ set (EKAT_NVCC_WRAPPER ${CMAKE_BINARY_DIR} /bin/nvcc_wrapper)
52+ set (EKAT_NVCC_WRAPPER ${EKAT_NVCC_WRAPPER} PARENT_SCOPE)
53+ file (COPY ${CMAKE_CURRENT_SOURCE_DIR} /ekat/extern/kokkos/bin/nvcc_wrapper
54+ DESTINATION ${CMAKE_BINARY_DIR} /bin)
55+ endif ()
4656 set (Kokkos_ENABLE_SERIAL ON CACHE BOOL "Enable serial Kokkos backend" )
47- set (Kokkos_ENABLE_CUDA ON CACHE BOOL "Enable CUDA Kokkos backend" )
48- set (Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Enable CUDA lambdas" )
4957 else ()
5058 set (Kokkos_ENABLE_SERIAL ON CACHE BOOL "Enable serial Kokkos backend" )
51- set (Kokkos_ENABLE_CUDA OFF CACHE BOOL "Disable CUDA Kokkos backend" )
59+ set (Kokkos_ENABLE_CUDA OFF CACHE BOOL "Enable CUDA Kokkos backend" )
60+ set (Kokkos_ENABLE_HIP OFF CACHE BOOL "Enable HIP Kokkos backend" )
5261 if (OPENMP_FOUND)
5362 message (STATUS "OpenMP is enabled" )
5463 set (Kokkos_ENABLE_OPENMP ON CACHE BOOL "Enable OpenMP Kokkos backend" )
5564 else ()
5665 message (STATUS "OpenMP is not supported. Using threads backend instead." )
57- set (Kokkos_ENABLE_OPENMP OFF CACHE BOOL "Disable OpenMP Kokkos backend" )
66+ set (Kokkos_ENABLE_OPENMP OFF CACHE BOOL "Enable OpenMP Kokkos backend" )
5867 set (Kokkos_ENABLE_PTHREAD ON CACHE BOOL "Enable pthreads Kokkos backend" )
5968 endif ()
6069 endif ()
@@ -68,8 +77,6 @@ if (HAERO_BUILDS_EKAT)
6877 ${PROJECT_BINARY_DIR} /externals/kokkos
6978 ${CMAKE_CURRENT_SOURCE_DIR} /ekat/extern/spdlog/include
7079 ${CMAKE_CURRENT_SOURCE_DIR} /ekat/extern/yaml-cpp/include )
71- file (COPY ${CMAKE_CURRENT_SOURCE_DIR} /ekat/extern/kokkos/bin/nvcc_wrapper
72- DESTINATION ${CMAKE_BINARY_DIR} /bin)
7380 if (NOT TARGET yaml-cpp)
7481 add_library (yaml-cpp STATIC IMPORTED GLOBAL )
7582 if (CMAKE_BUILD_TYPE MATCHES "Debug" )
@@ -91,8 +98,6 @@ if (HAERO_BUILDS_EKAT)
9198 endif ()
9299 endif ()
93100endif ()
94- set (EKAT_NVCC_WRAPPER ${CMAKE_BINARY_DIR} /bin/nvcc_wrapper)
95- set (EKAT_NVCC_WRAPPER ${EKAT_NVCC_WRAPPER} PARENT_SCOPE)
96101
97102add_library (ext_libraries INTERFACE )
98103target_link_libraries (ext_libraries INTERFACE ekat;${HAERO_EXT_LIBRARIES} )
@@ -108,4 +113,3 @@ set(HAERO_EXT_INCLUDE_DIRS ${HAERO_EXT_INCLUDE_DIRS} PARENT_SCOPE)
108113
109114install (DIRECTORY ${PROJECT_BINARY_DIR} /include / DESTINATION include )
110115install (DIRECTORY ${PROJECT_BINARY_DIR} /bin/ DESTINATION bin)
111-
0 commit comments