Skip to content

Commit ecfbe71

Browse files
committed
Fixes for Cuda.
1 parent ee0d01e commit ecfbe71

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ekat/ekat_session.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ void initialize_kokkos () {
2626
// OK. The rank gets a GPU assigned and simply will ignore it.
2727
#ifdef EKAT_ENABLE_GPU
2828
int nd;
29-
# if KOKKOS_ENABLE_CUDA
29+
# if defined KOKKOS_ENABLE_CUDA
3030
const auto ret = cudaGetDeviceCount(&nd);
3131
const bool ok = ret == cudaSuccess;
32-
# else
32+
# elif defined KOKKOS_ENABLE_HIP
3333
const auto ret = hipGetDeviceCount(&nd);
3434
const bool ok = ret == hipSuccess;
35+
# else
36+
error "No valid GPU space, yet EKAT_ENABLE_GPU is defined."
3537
# endif
3638
if (not ok) {
3739
// It isn't a big deal if we can't get the device count.

0 commit comments

Comments
 (0)