diff --git a/rocclr/device/rocm/rocmemory.cpp b/rocclr/device/rocm/rocmemory.cpp index 0eebbb5552..8aacd09dad 100644 --- a/rocclr/device/rocm/rocmemory.cpp +++ b/rocclr/device/rocm/rocmemory.cpp @@ -643,8 +643,9 @@ void Buffer::destroy() { if (memFlags & CL_MEM_ALLOC_HOST_PTR) { if (dev().info().hmmSupported_) { // AMD HMM path. Destroy system memory - amd::Os::uncommitMemory(deviceMemory_, size()); - amd::Os::releaseMemory(deviceMemory_, size()); + if (!(amd::Os::releaseMemory(deviceMemory_, size()))) { + ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "[ROCClr] munmap failed \n"); + } } else { dev().hostFree(deviceMemory_, size()); } @@ -746,7 +747,6 @@ bool Buffer::create(bool alloc_local) { if (deviceMemory_ == NULL) { return false; } - amd::Os::commitMemory(deviceMemory_, size(), amd::Os::MEM_PROT_RW); // Currently HMM requires cirtain initial calls to mark sysmem allocation as // GPU accessible or prefetch memory into GPU if (!dev().SvmAllocInit(deviceMemory_, size())) {