We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee0d01e commit ecfbe71Copy full SHA for ecfbe71
1 file changed
src/ekat/ekat_session.cpp
@@ -26,12 +26,14 @@ void initialize_kokkos () {
26
// OK. The rank gets a GPU assigned and simply will ignore it.
27
#ifdef EKAT_ENABLE_GPU
28
int nd;
29
-# if KOKKOS_ENABLE_CUDA
+# if defined KOKKOS_ENABLE_CUDA
30
const auto ret = cudaGetDeviceCount(&nd);
31
const bool ok = ret == cudaSuccess;
32
-# else
+# elif defined KOKKOS_ENABLE_HIP
33
const auto ret = hipGetDeviceCount(&nd);
34
const bool ok = ret == hipSuccess;
35
+# else
36
+ error "No valid GPU space, yet EKAT_ENABLE_GPU is defined."
37
# endif
38
if (not ok) {
39
// It isn't a big deal if we can't get the device count.
0 commit comments