SWDEV-521011 - Allow max stack size as per ISA. (#73)

This commit is contained in:
Patel, Jaydeepkumar
2025-04-07 21:45:38 -07:00
committad av GitHub
förälder e974f7fde1
incheckning 9e7248aa36
4 ändrade filer med 51 tillägg och 9 borttagningar
+9
Visa fil
@@ -2752,6 +2752,15 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
if ((hsaKernel.workGroupInfo()->usedStackSize_ & 0x1) == 0x1) {
privateMemSize = std::max<uint32_t>(static_cast<uint32_t>(device().StackSize()),
hsaKernel.workGroupInfo()->scratchRegs_ * sizeof(uint32_t)) ;
// Validate privateMemSize is more than max allowed.
size_t maxStackSize = device().MaxStackSize();
if (privateMemSize > maxStackSize) {
ClPrint(amd::LOG_INFO, amd::LOG_KERN,
"Scratch size (%zu) exceeds max allowed (%zu) for kernel : %s",
privateMemSize, maxStackSize, hsaKernel.name().c_str());
LogError("Scratch size exceeds max allowed.");
return false;
}
}
// Set up the dispatch information