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) {
|
2021-11-19 14:52:40 +00:00
|
|
|
auto requiredSize = alignUp(workGroupsCount, 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);
|
|
|
|
|
}
|