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
@@ -3585,9 +3585,18 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
|
||||
dispatchPacket.private_segment_size = devKernel->workGroupInfo()->privateMemSize_;
|
||||
|
||||
if ((devKernel->workGroupInfo()->usedStackSize_ & 0x1) == 0x1) {
|
||||
dispatchPacket.private_segment_size = std::min<uint64_t>(
|
||||
std::max<uint64_t>(dev().StackSize(), dispatchPacket.private_segment_size),
|
||||
Device::kMaxStackSize);
|
||||
dispatchPacket.private_segment_size = std::max<uint64_t>(dev().StackSize(),
|
||||
dispatchPacket.private_segment_size);
|
||||
// Validate privateMemSize is more than max allowed.
|
||||
size_t maxStackSize = dev().MaxStackSize();
|
||||
if (dispatchPacket.private_segment_size > maxStackSize) {
|
||||
ClPrint(amd::LOG_INFO, amd::LOG_KERN,
|
||||
"Scratch size (%u) exceeds max allowed (%zu) for kernel : %s",
|
||||
dispatchPacket.private_segment_size, maxStackSize,
|
||||
gpuKernel.getDemangledName().c_str());
|
||||
LogError("Scratch size exceeds max allowed.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Pass the header accordingly
|
||||
|
||||
Reference in New Issue
Block a user