From 7b419f42eb55e1c92e10557b09b918016b0a9a45 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Wed, 8 Mar 2023 04:34:50 +0000 Subject: [PATCH] SWDEV-389676 - Update stack size limit Change-Id: Id0cf66820e76e1bbd7f6c17ceb110782cdb5f978 --- rocclr/device/device.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rocclr/device/device.cpp b/rocclr/device/device.cpp index f87452dbd5..8cd1de3109 100644 --- a/rocclr/device/device.cpp +++ b/rocclr/device/device.cpp @@ -745,7 +745,12 @@ bool Device::disableP2P(amd::Device* ptrDev) { } bool Device::UpdateStackSize(uint64_t stackSize) { - if (stackSize > 16 * Ki) { + // Amount of space used by each wave is in units of 256 dwords. + // As per COMPUTE_TMPRING_SIZE.WAVE_SIZE 24:12 + // The field size supports a range of 0->(2M-256) dwords per wave64. + // Per lane this works out to 131056 bytes or 128K - 16 + uint64_t kStackSize = ((128 * Ki) - 16); + if (stackSize > kStackSize) { return false; } stack_size_ = stackSize;