SWDEV-521011 - Allow max stack size as per ISA. (#73)
[ROCm/clr commit: 9e7248aa36]
This commit is contained in:
committed by
GitHub
parent
4c9cc6ba30
commit
2f3bc7f01c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user