diff --git a/source/adios2/helper/adiosKokkos.cpp b/source/adios2/helper/adiosKokkos.cpp index 763903a582..7a9f53c66b 100644 --- a/source/adios2/helper/adiosKokkos.cpp +++ b/source/adios2/helper/adiosKokkos.cpp @@ -111,6 +111,15 @@ void KokkosInit() int device_id; cudaGetDevice(&device_id); settings.set_device_id(device_id); +#endif +#ifdef ADIOS2_HAVE_KOKKOS_HIP + int device_id; + hipError_t ret; + ret = hipGetDevice(&device_id); + if (ret == hipSuccess) + { + settings.set_device_id(device_id); + } #endif Kokkos::initialize(settings); }