mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
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>
18 lines
559 B
C++
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);
|
|
}
|