From c2ca879decbaec39e55ebf7e1c19b10731651c8f Mon Sep 17 00:00:00 2001
From: foreman
Date: Sat, 4 Feb 2017 00:59:54 -0500
Subject: [PATCH] P4 to Git Change 1369302 by todli@todli-win-opencl-kv1 on
2017/02/04 00:49:06
SWDEV-107271 - Fix crash that happens when Resource::create() fails and "owner" gets cleared. This is only triggered by Conformance test Basic progvar_prog_scope_misc on Raven with 16GB memory (8GB is fine), but should be a general bug.
http://ocltc.amd.com/reviews/r/12253
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#11 edit
---
rocclr/runtime/device/pal/palmemory.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rocclr/runtime/device/pal/palmemory.cpp b/rocclr/runtime/device/pal/palmemory.cpp
index eb87409aef..7b2adcbf76 100644
--- a/rocclr/runtime/device/pal/palmemory.cpp
+++ b/rocclr/runtime/device/pal/palmemory.cpp
@@ -139,7 +139,7 @@ Memory::create(
// Local to Persistent
if (memoryType() == Local) {
// For dgpu freeMemory[0] reports a sum of visible+invisible fb
- if (owner()->getSize() > (freeMemory[0] * Ki)) {
+ if (size() > (freeMemory[0] * Ki)) {
break;
}
memType = Persistent;
@@ -153,7 +153,7 @@ Memory::create(
memType = RemoteUSWC;
}
else if (dev().settings().apuSystem_ && memoryType() == RemoteUSWC) {
- if (owner()->getSize() > (freeMemory[0] * Ki)) {
+ if (size() > (freeMemory[0] * Ki)) {
break;
}
}