Unverified Commit 80a8b4d5 authored by Ana Gainaru's avatar Ana Gainaru Committed by GitHub
Browse files

Merge pull request #3605 from anagainaru/hip-specific-func

Adding missing HIP specific functionality
parents fe36dc29 a17eda29
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -89,6 +89,15 @@ bool IsGPUbuffer(const void *ptr)
    {
        return true;
    }
#endif
#ifdef ADIOS2_HAVE_KOKKOS_HIP
    hipError_t ret;
    hipPointerAttribute_t attr;
    ret = hipPointerGetAttributes(&attr, ptr);
    if (ret == hipSuccess && attr.memoryType == hipMemoryTypeDevice)
    {
        return true;
    }
#endif
    return false;
}
@@ -102,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);
}