From 69eefa1d415c2b0e8a990109b79771daff2a2ee7 Mon Sep 17 00:00:00 2001 From: Nilesh M Negi Date: Thu, 19 Oct 2023 11:57:45 -0500 Subject: [PATCH] MC/ROCM: ROCm compatibility fixes (#858) Signed-off-by: nileshnegi --- src/components/mc/rocm/mc_rocm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/mc/rocm/mc_rocm.c b/src/components/mc/rocm/mc_rocm.c index cc6fa5332e..fbe7643ab7 100644 --- a/src/components/mc/rocm/mc_rocm.c +++ b/src/components/mc/rocm/mc_rocm.c @@ -9,6 +9,7 @@ #include "utils/ucc_malloc.h" #include "utils/arch/cpu.h" #include +#include #include #include @@ -301,13 +302,23 @@ static ucc_status_t ucc_mc_rocm_mem_query(const void *ptr, hipGetLastError(); return UCC_ERR_NOT_SUPPORTED; } + +#if HIP_VERSION >= 50500000 + switch (attr.type) { +#else switch (attr.memoryType) { +#endif case hipMemoryTypeHost: mem_type = (attr.isManaged ? UCC_MEMORY_TYPE_ROCM_MANAGED : UCC_MEMORY_TYPE_HOST); break; case hipMemoryTypeDevice: mem_type = UCC_MEMORY_TYPE_ROCM; break; +#if HIP_VERSION >= 50300000 + case hipMemoryTypeManaged: + mem_type = UCC_MEMORY_TYPE_ROCM_MANAGED; + break; +#endif default: return UCC_ERR_NOT_SUPPORTED; }