SWDEV-408283 - Sync scratchRegs_, privateMemSize_ and workitemPrivateSegmentSize.

Change-Id: I623a7140810ff9867f8816bf4c8621a1fe921744
Dieser Commit ist enthalten in:
Jaydeep Patel
2023-07-25 18:45:03 +00:00
committet von Jaydeepkumar Patel
Ursprung c7d8557eee
Commit ff1a999f66
2 geänderte Dateien mit 6 neuen und 7 gelöschten Zeilen
+6
Datei anzeigen
@@ -552,6 +552,12 @@ bool LightningKernel::postLoad() {
if (workGroupInfo_.size_ == 0) {
return false;
}
if ((workGroupInfo_.usedStackSize_ & 0x1) == 0x1) {
workGroupInfo_.scratchRegs_ =
std::max<uint32_t>(device().StackSize(), workGroupInfo_.scratchRegs_ * sizeof(uint32_t)) ;
workGroupInfo_.scratchRegs_ = amd::alignUp(workGroupInfo_.scratchRegs_, 16) / sizeof(uint32_t);
workGroupInfo_.privateMemSize_ = workGroupInfo_.scratchRegs_ * sizeof(uint32_t);
}
// handle the printf metadata if any
std::vector<std::string> printfStr;
-7
Datei anzeigen
@@ -2678,13 +2678,6 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
dispatchParam.scratchSize = scratch->size_;
dispatchParam.scratchOffset = scratch->offset_;
dispatchParam.workitemPrivateSegmentSize = hsaKernel.spillSegSize();
if ((hsaKernel.workGroupInfo()->usedStackSize_ & 0x1) == 0x1) {
dispatchParam.workitemPrivateSegmentSize =
std::max<uint64_t>(dev().StackSize(), dispatchParam.workitemPrivateSegmentSize);
if (dispatchParam.workitemPrivateSegmentSize > 16 * Ki) {
dispatchParam.workitemPrivateSegmentSize = 16 * Ki;
}
}
}
dispatchParam.pCpuAqlCode = hsaKernel.cpuAqlCode();
dispatchParam.hsaQueueVa = hsaQueueMem_->vmAddress();