From 6f0457c510de521131d77011db13e2a79c162e6c Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 9 Nov 2015 10:40:09 -0500
Subject: [PATCH] P4 to Git Change 1208925 by wchau@wchau_WINDOWS7_OCL on
2015/11/09 10:34:19
SWDEV-79957 - use system memory to calculate the largest available memory size on Linux APU system.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#533 edit
---
rocclr/runtime/device/gpu/gpudevice.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/rocclr/runtime/device/gpu/gpudevice.cpp b/rocclr/runtime/device/gpu/gpudevice.cpp
index 29eeb46b99..08bb237445 100644
--- a/rocclr/runtime/device/gpu/gpudevice.cpp
+++ b/rocclr/runtime/device/gpu/gpudevice.cpp
@@ -285,7 +285,7 @@ void NullDevice::fillDeviceInfo(
(static_cast(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
static_cast(calAttr.localRAM) / 100u) * Mi;
#endif
- int uswcPercentAvailable = (calAttr.uncachedRemoteRAM > 1536) ? 75 : 50;
+ int uswcPercentAvailable = (calAttr.uncachedRemoteRAM > 1536 && IS_WINDOWS) ? 75 : 50;
if (settings().apuSystem_) {
info_.globalMemSize_ +=
(static_cast(calAttr.uncachedRemoteRAM) * Mi * uswcPercentAvailable)/100;
@@ -300,13 +300,11 @@ void NullDevice::fillDeviceInfo(
cl_ulong(memInfo.cardLargestFreeBlockBytes),
cl_ulong(memInfo.cardExtLargestFreeBlockBytes));
-#if defined(ATI_OS_WIN)
if (settings().apuSystem_) {
info_.maxMemAllocSize_ = std::max(
(static_cast(calAttr.uncachedRemoteRAM) * Mi * uswcPercentAvailable)/100,
info_.maxMemAllocSize_);
}
-#endif
info_.maxMemAllocSize_ = cl_ulong(info_.maxMemAllocSize_ *
std::min(GPU_SINGLE_ALLOC_PERCENT, 100u) / 100u);