From 0617de6d84eda1482d2aeab7db17f898437ece86 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 24 Feb 2017 16:47:02 -0500
Subject: [PATCH] P4 to Git Change 1377864 by todli@todli-win-opencl-kv1 on
2017/02/24 16:10:12
SWDEV-107271 - For APU system, when allocating USWC with enough USWC reported and the allocation fails, we should return false instead of looping forever.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#12 edit
[ROCm/clr commit: dff4d3c84ad068b4c787c3dfc5b43e281d7fd5a6]
---
projects/clr/rocclr/runtime/device/pal/palmemory.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/palmemory.cpp b/projects/clr/rocclr/runtime/device/pal/palmemory.cpp
index 7b2adcbf76..039017b1fc 100644
--- a/projects/clr/rocclr/runtime/device/pal/palmemory.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palmemory.cpp
@@ -153,7 +153,7 @@ Memory::create(
memType = RemoteUSWC;
}
else if (dev().settings().apuSystem_ && memoryType() == RemoteUSWC) {
- if (size() > (freeMemory[0] * Ki)) {
+ if (size() > (freeMemory[0] * Ki) || allocAttempt >= 2) {
break;
}
}