Skip to content

Commit

Permalink
Adding functionality to check where a buffer is allocated for HIP mem…
Browse files Browse the repository at this point in the history
…ory space
  • Loading branch information
anagainaru committed May 4, 2023
1 parent fe36dc2 commit b9a811c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/adios2/helper/adiosKokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b9a811c

Please sign in to comment.