SWDEV-340649 - Removes calls to commitMemory in hmm path

Change-Id: I8d381b4c3f5cf95628487e0d10ae643443c9709d
Šī revīzija ir iekļauta:
Sourabh Betigeri
2023-01-26 16:22:03 -08:00
revīziju iesūtīja Sourabh Betigeri
vecāks e3aa7a5b3d
revīzija 2388f61705
+3 -3
Parādīt failu
@@ -643,8 +643,9 @@ void Buffer::destroy() {
if (memFlags & CL_MEM_ALLOC_HOST_PTR) { if (memFlags & CL_MEM_ALLOC_HOST_PTR) {
if (dev().info().hmmSupported_) { if (dev().info().hmmSupported_) {
// AMD HMM path. Destroy system memory // AMD HMM path. Destroy system memory
amd::Os::uncommitMemory(deviceMemory_, size()); if (!(amd::Os::releaseMemory(deviceMemory_, size()))) {
amd::Os::releaseMemory(deviceMemory_, size()); ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "[ROCClr] munmap failed \n");
}
} else { } else {
dev().hostFree(deviceMemory_, size()); dev().hostFree(deviceMemory_, size());
} }
@@ -746,7 +747,6 @@ bool Buffer::create(bool alloc_local) {
if (deviceMemory_ == NULL) { if (deviceMemory_ == NULL) {
return false; return false;
} }
amd::Os::commitMemory(deviceMemory_, size(), amd::Os::MEM_PROT_RW);
// Currently HMM requires cirtain initial calls to mark sysmem allocation as // Currently HMM requires cirtain initial calls to mark sysmem allocation as
// GPU accessible or prefetch memory into GPU // GPU accessible or prefetch memory into GPU
if (!dev().SvmAllocInit(deviceMemory_, size())) { if (!dev().SvmAllocInit(deviceMemory_, size())) {