From 2388f61705ebc64537bb2fcd4a367a26ba70efeb Mon Sep 17 00:00:00 2001 From: Sourabh Betigeri Date: Thu, 26 Jan 2023 16:22:03 -0800 Subject: [PATCH] SWDEV-340649 - Removes calls to commitMemory in hmm path Change-Id: I8d381b4c3f5cf95628487e0d10ae643443c9709d --- rocclr/device/rocm/rocmemory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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())) {