Add support to rocm 6.0 (#996)

* Use hipPointerAttribute_t.type as HIP is removing hipPointerAttribute_t.memoryType
This commit is contained in:
Rakesh Roy 2023-10-31 17:48:32 +05:30 committed by GitHub
parent b6c60065d2
commit fd31ec8357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1142,11 +1142,19 @@ hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location)
{
*memory_location = hypre_MEMORY_UNIFIED;
}
#if (HIP_VERSION_MAJOR >= 6)
else if (attr.type == hipMemoryTypeDevice)
#else // (HIP_VERSION_MAJOR < 6)
else if (attr.memoryType == hipMemoryTypeDevice)
#endif // (HIP_VERSION_MAJOR >= 6)
{
*memory_location = hypre_MEMORY_DEVICE;
}
#if (HIP_VERSION_MAJOR >= 6)
else if (attr.type == hipMemoryTypeHost)
#else // (HIP_VERSION_MAJOR < 6)
else if (attr.memoryType == hipMemoryTypeHost)
#endif // (HIP_VERSION_MAJOR >= 6)
{
*memory_location = hypre_MEMORY_HOST_PINNED;
}