From 0774d9ddbbbb658657759bba0be0726053b4e9dd Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 15 Sep 2014 13:28:54 -0400 Subject: [PATCH] P4 to Git Change 1076975 by jgolds@jgolds_MSDNfractal5_opencl_stg on 2014/09/15 13:22:38 ECR #304775 - Update resource cache behavior Currently, the resource cache is fixed at 64MB regardless of available video memory size. Changed the logic to use max(1/8th video memory, 64MB). This is still overrideable with the env. var. GPU_RESOURCE_CACHE_SIZE. Improvements with changes: 18% decrease in video chat face detect time on 95w Kaveri (no change in PCMark8 score as we already achieved 30fps), 14% improvement on 19w Kaveri (this does result in an improvement in PCMark8 since the APU is slower). Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#279 edit [ROCm/clr commit: fc2687df3aa7d0aacc5cce6e6d18c987a54427c4] --- projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp index 201523c659..ab74023527 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp @@ -77,9 +77,6 @@ Settings::Settings() // GPU device by default apuSystem_ = false; - // Save resource cache size - resourceCacheSize_ = GPU_RESOURCE_CACHE_SIZE * Mi; - // Disable 64 bit pointers support by default use64BitPtr_ = false; @@ -157,6 +154,9 @@ Settings::create( // Disable thread trace by default for all devices threadTraceEnable_ = false; + // Save resource cache size + resourceCacheSize_ = std::max((calAttr.localRAM / 8) * Mi, GPU_RESOURCE_CACHE_SIZE * Mi); + if (calAttr.doublePrecision) { // Report FP_FAST_FMA define if double precision HW reportFMA_ = true; @@ -485,6 +485,9 @@ Settings::override() if (!flagIsDefault(GPU_ASSUME_ALIASES)) { assumeAliases_ = GPU_ASSUME_ALIASES; } + if (!flagIsDefault(GPU_RESOURCE_CACHE_SIZE)) { + resourceCacheSize_ = GPU_RESOURCE_CACHE_SIZE * Mi; + } } } // namespace gpu