From 170f42c656a2c8198cb1baa4fbf584d39cb676ff Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 5 Jun 2019 12:35:41 -0400
Subject: [PATCH] P4 to Git Change 1792217 by asalmanp@asalmanp-ocl-stg on
2019/06/05 12:26:00
SWDEV-132899 - [OCL][GFX10] increase the numScratchWavesPerCu in Wave32 mode and use the actual num of CUs not the total num of WGPs when calculating the scratch buffer size
ReviewBoardURL = http://ocltc.amd.com/reviews/r/17474/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#139 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#81 edit
[ROCm/clr commit: de52451eddef9b06e34680389c674d5e5b007648]
---
projects/clr/rocclr/runtime/device/pal/paldevice.cpp | 2 +-
projects/clr/rocclr/runtime/device/pal/palsettings.cpp | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
index 59721a9923..19dc753f58 100644
--- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
@@ -2003,7 +2003,7 @@ bool Device::allocScratch(uint regNum, const VirtualGPU* vgpu) {
if (scratchBuf->regNum_ > 0) {
scratchBuf->destroyMemory();
// Calculate the size of the scratch buffer for a queue
- uint32_t numTotalCUs = info().maxComputeUnits_;
+ uint32_t numTotalCUs = properties().gfxipProperties.shaderCore.numAvailableCus;
uint32_t numMaxWaves = settings().numScratchWavesPerCu_ * numTotalCUs;
scratchBuf->size_ = static_cast(info().wavefrontWidth_) * scratchBuf->regNum_ *
numMaxWaves * sizeof(uint32_t);
diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp
index 0cbe3a17a8..0f1949aac2 100644
--- a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp
@@ -211,6 +211,9 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
enableWave32Mode_ = GPU_ENABLE_WAVE32_MODE;
}
lcWavefrontSize64_ = !enableWave32Mode_;
+ if (enableWave32Mode_) {
+ numScratchWavesPerCu_ *= 2;
+ }
// Fall through to AI (gfx9) ...
case Pal::AsicRevision::Vega20:
// Enable HW P2P path for Vega20+. Runtime still relies on KMD/PAL for support