Commit b9a811c6 authored by Ana Gainaru's avatar Ana Gainaru
Browse files

Adding functionality to check where a buffer is allocated for HIP memory space

parent fe36dc29
Loading
Loading
Loading
Loading
+9 −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;
}