Files
compute-runtime/shared/source/program/sync_buffer_handler.inl
Filip Hazubski 388c7dc591 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>
2024-10-03 15:57:24 +02:00

18 lines
559 B
C++

/*
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/memory_manager/memory_manager.h"
template <typename KernelT>
void NEO::SyncBufferHandler::prepareForEnqueue(size_t workGroupsCount, KernelT &kernel) {
auto requiredSize = alignUp(std::max(workGroupsCount, static_cast<size_t>(CommonConstants::minimalSyncBufferSize)), CommonConstants::maximalSizeOfAtomicType);
auto patchData = obtainAllocationAndOffset(requiredSize);
kernel.patchSyncBuffer(patchData.first, patchData.second);
}