From 1f7bf42d03b68c3efa2dcb9df232bdc5aa86b22b Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 12 Jan 2016 14:11:46 -0500
Subject: [PATCH] P4 to Git Change 1226881 by wchau@wchau_WIN_OCL_HSA on
2016/01/12 14:03:39
SWDEV-79308 - Reduce the total scratch buffer size by a factor of 4, which in effect reducing the max. scratch waves from 32 to 8, to avoid the required total scratch buffer
size exceeds the available local memory.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#152 edit
[ROCm/clr commit: a319c0e35cbd8a0f1ede2fe4261a4b7472c21878]
---
.../rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
index 19de5ed4f9..9d89882a6d 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp
@@ -1231,6 +1231,13 @@ CALGSLDevice::calcScratchBufferSize(uint32 regNum) const
m_cs->CalcAllScratchBufferSizes(enabledShadersFlag, scratchSpacePerShaderStage,
scratchBufferSizes);
+
+ // SWDEV-79308:
+ // Reduce the total scratch buffer size by a factor of 4, which in effect reducing the
+ // max. scratch waves from 32 to 8. This will avoid the required total scratch buffer
+ // size exceeds the available local memory.
+ scratchBufferSizes[target] >>= 2;
+
return scratchBufferSizes[target];
}