P4 to Git Change 1577357 by gandryey@gera-w8 on 2018/07/06 17:44:59

SWDEV-158017 - CL_DEVICE_GLOBAL_FREE_MEMORY_AMD doesn't work correctly on PAL backend
	- Adjust system memory calculation for APU systems

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#594 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#89 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#95 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#26 edit


[ROCm/clr commit: 2caff650a9]
This commit is contained in:
foreman
2018-07-06 17:53:44 -04:00
parent d41cb5f07f
commit 19eade5c6e
4 changed files with 20 additions and 10 deletions
@@ -1812,10 +1812,12 @@ bool Device::globalFreeMemory(size_t* freeMemory) const {
if (settings().apuSystem_) {
if (settings().viPlus_) {
// for viPlus_, OCL is using remote instead remoteUSWC to avoid extra copy
freeMemory[TotalFreeMemory] += memInfo.agpMemAvailableCacheableBytes / Ki;
freeMemory[TotalFreeMemory] += (memInfo.agpMemAvailableCacheableBytes -
resourceCache().lclCacheSize() + resourceCache().cacheSize()) / Ki;
freeMemory[LargestFreeBlock] += memInfo.agpCacheableLargestFreeBlockBytes / Ki;
} else {
freeMemory[TotalFreeMemory] += memInfo.agpMemAvailableBytes / Ki;
freeMemory[TotalFreeMemory] += (memInfo.agpMemAvailableBytes -
resourceCache().lclCacheSize() + resourceCache().cacheSize()) / Ki;
freeMemory[LargestFreeBlock] += memInfo.agpLargestFreeBlockBytes / Ki;
}
}