From cee266b2d8fe47a0c0b3d3b459cdae38d7d4526a Mon Sep 17 00:00:00 2001 From: foreman Date: Fri, 8 Jan 2016 15:16:55 -0500 Subject: [PATCH] P4 to Git Change 1226078 by rili@rili_opencl_stg on 2016/01/08 15:03:58 SWDEV-84309 - Using agpMemAvailableCacheableBytes instead of agpMemAvailableBytes when calculating free memory for viPlus_ apu. When memory allocation is in system memory, only agpMemAvailableCacheableBytes is changed Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#539 edit [ROCm/clr commit: bc822d60d1fae05b1c1658d3df7d5aae5399acc5] --- projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp index 18267c54a4..185866a765 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp @@ -1890,8 +1890,15 @@ Device::globalFreeMemory(size_t* freeMemory) const freeMemory[LargestFreeBlock] = std::max(memInfo.cardLargestFreeBlockBytes, memInfo.cardExtLargestFreeBlockBytes) / Ki; if (settings().apuSystem_) { - freeMemory[TotalFreeMemory] += memInfo.agpMemAvailableBytes / Ki; - freeMemory[LargestFreeBlock] += memInfo.agpLargestFreeBlockBytes / Ki; + if (settings().viPlus_) { + // for viPlus_, OCL is using remote instead remoteUSWC to avoid extra copy + freeMemory[TotalFreeMemory] += memInfo.agpMemAvailableCacheableBytes / Ki; + freeMemory[LargestFreeBlock] += memInfo.agpCacheableLargestFreeBlockBytes / Ki; + } + else { + freeMemory[TotalFreeMemory] += memInfo.agpMemAvailableBytes / Ki; + freeMemory[LargestFreeBlock] += memInfo.agpLargestFreeBlockBytes / Ki; + } } return true;