From 5bb213cc2bf60b20f2c8d4df17cb41785c1efb20 Mon Sep 17 00:00:00 2001 From: Alex Xie Date: Mon, 7 Dec 2020 12:18:51 -0500 Subject: [PATCH] SWDEV-256126 - Linux pro Nuke app crash with "Out of memory" Out of memory while running RIP plugin test Change-Id: I8d6859a45b871f96ac027f8c7274f716e8524a3c [ROCm/clr commit: 2505d68eba8272c89c49c46ee6e28d10a36acea4] --- projects/clr/rocclr/device/rocm/rocmemory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/device/rocm/rocmemory.cpp b/projects/clr/rocclr/device/rocm/rocmemory.cpp index 523b9386f1..2f20890cee 100644 --- a/projects/clr/rocclr/device/rocm/rocmemory.cpp +++ b/projects/clr/rocclr/device/rocm/rocmemory.cpp @@ -675,11 +675,13 @@ void Buffer::destroy() { const_cast(dev()).updateFreeMemory(size(), true); } } - else if (dev().settings().apuSystem_) { + else { if (!(memFlags & (CL_MEM_USE_HOST_PTR | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR))) { dev().memFree(deviceMemory_, size()); + if (dev().settings().apuSystem_) { + const_cast(dev()).updateFreeMemory(size(), true); + } } - const_cast(dev()).updateFreeMemory(size(), true); } }