Skip to content

Commit

Permalink
MC/ROCM: ROCm compatibility fixes (openucx#858)
Browse files Browse the repository at this point in the history
Signed-off-by: nileshnegi <[email protected]>
  • Loading branch information
nileshnegi authored and janjust committed Jan 31, 2024
1 parent defe520 commit 69eefa1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/mc/rocm/mc_rocm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "utils/ucc_malloc.h"
#include "utils/arch/cpu.h"
#include <hip/hip_runtime.h>
#include <hip/hip_version.h>
#include <hsa/hsa.h>
#include <hsa/hsa_ext_amd.h>

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 69eefa1

Please sign in to comment.