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