From fc9917e0dab6e032779d01624cc91c4a5a47cb30 Mon Sep 17 00:00:00 2001 From: saurabhAMD <160164138+saurabhAMD@users.noreply.github.com> Date: Sat, 11 Jan 2025 19:23:04 -0600 Subject: [PATCH] Updating to use hipDeviceMallocUncached (#95) Use hipDeviceMallocUncached instead of hipDeviceMallocFinegrained on newer ROCm versions. --- src/common.cu | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/common.cu b/src/common.cu index c72b1a05c9..19db735c5f 100644 --- a/src/common.cu +++ b/src/common.cu @@ -880,9 +880,16 @@ testResult_t AllocateBuffs(void **sendbuff, size_t sendBytes, void **recvbuff, s nbytes = nbytes + cache_bytes; } if (memorytype == ncclFine) { - CUDACHECK(hipExtMallocWithFlags(sendbuff, nbytes, hipDeviceMallocFinegrained)); - CUDACHECK(hipExtMallocWithFlags(recvbuff, nbytes, hipDeviceMallocFinegrained)); - if (datacheck) CUDACHECK(hipExtMallocWithFlags(expected, recvBytes, hipDeviceMallocFinegrained)); + if(HIP_VERSION >= 50700000) { + CUDACHECK(hipExtMallocWithFlags(sendbuff, nbytes, hipDeviceMallocUncached)); + CUDACHECK(hipExtMallocWithFlags(recvbuff, nbytes, hipDeviceMallocUncached)); + if (datacheck) CUDACHECK(hipExtMallocWithFlags(expected, recvBytes, hipDeviceMallocUncached)); + } + else { + CUDACHECK(hipExtMallocWithFlags(sendbuff, nbytes, hipDeviceMallocFinegrained)); + CUDACHECK(hipExtMallocWithFlags(recvbuff, nbytes, hipDeviceMallocFinegrained)); + if (datacheck) CUDACHECK(hipExtMallocWithFlags(expected, recvBytes, hipDeviceMallocFinegrained)); + } } else if (memorytype == ncclHost) { CUDACHECK(hipHostMalloc(sendbuff, nbytes));