fix: Update SyncBuffer size calculation

Add a constant to describe minimal size of SyncBuffer object.

Related-To: HSD-18039952263, HSD-18039940553, HSD-18039937640

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2024-10-03 14:00:56 +00:00
committed by Compute-Runtime-Automation
parent 6123078215
commit 388c7dc591
3 changed files with 6 additions and 4 deletions

View File

@@ -9,9 +9,9 @@
template <typename KernelT>
void NEO::SyncBufferHandler::prepareForEnqueue(size_t workGroupsCount, KernelT &kernel) {
auto requiredSize = alignUp(workGroupsCount, CommonConstants::maximalSizeOfAtomicType);
auto requiredSize = alignUp(std::max(workGroupsCount, static_cast<size_t>(CommonConstants::minimalSyncBufferSize)), CommonConstants::maximalSizeOfAtomicType);
auto patchData = obtainAllocationAndOffset(requiredSize);
kernel.patchSyncBuffer(patchData.first, patchData.second);
}
}