2021-03-20 07:14:09 +08:00
|
|
|
/*
|
2024-06-03 22:19:36 +08:00
|
|
|
* Copyright (C) 2021-2024 Intel Corporation
|
2021-03-20 07:14:09 +08: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 22:52:40 +08:00
|
|
|
auto requiredSize = alignUp(workGroupsCount, CommonConstants::maximalSizeOfAtomicType);
|
2021-03-20 07:14:09 +08:00
|
|
|
|
2024-06-03 22:19:36 +08:00
|
|
|
auto patchData = obtainAllocationAndOffset(requiredSize);
|
2021-03-20 07:14:09 +08:00
|
|
|
|
2024-06-03 22:19:36 +08:00
|
|
|
kernel.patchSyncBuffer(patchData.first, patchData.second);
|
|
|
|
}
|