From fd31ec8357a082931cd20a033c6f26aa7c9abc18 Mon Sep 17 00:00:00 2001 From: Rakesh Roy <137397847+rakesroy@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:48:32 +0530 Subject: [PATCH] Add support to rocm 6.0 (#996) * Use hipPointerAttribute_t.type as HIP is removing hipPointerAttribute_t.memoryType --- src/utilities/memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utilities/memory.c b/src/utilities/memory.c index 7c0c25c03..129059b52 100644 --- a/src/utilities/memory.c +++ b/src/utilities/memory.c @@ -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; }