P4 to Git Change 1576247 by gandryey@gera-w8 on 2018/07/04 16:55:54

SWDEV-158017 - CL_DEVICE_GLOBAL_FREE_MEMORY_AMD doesn't work correctly on PAL backend
	- Change the free memory detection to account possible memory allocation with oversubscription.
	- Make sure resource cache isn't counted as allocated memory

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#593 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#244 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#88 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#94 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#68 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#25 edit
Cette révision appartient à :
foreman
2018-07-04 17:04:53 -04:00
Parent 6e589b7de6
révision 7e185b873e
7 fichiers modifiés avec 84 ajouts et 56 suppressions
+2 -1
Voir le fichier
@@ -1805,7 +1805,8 @@ bool Device::globalFreeMemory(size_t* freeMemory) const {
// Fill free memory info
freeMemory[TotalFreeMemory] =
(memInfo.cardMemAvailableBytes + memInfo.cardExtMemAvailableBytes) / Ki;
(memInfo.cardMemAvailableBytes + memInfo.cardExtMemAvailableBytes +
resourceCache().lclCacheSize()) / Ki;
freeMemory[LargestFreeBlock] =
std::max(memInfo.cardLargestFreeBlockBytes, memInfo.cardExtLargestFreeBlockBytes) / Ki;
if (settings().apuSystem_) {