Update SyncBufferHandler

Resolves: NEO-4543

Change-Id: Ieb9a76c0061d429739941f1d99ef52a95506fa07
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-04-09 17:33:07 +02:00
committed by sys_ocldev
parent 87d0a78095
commit 232fd2befa
3 changed files with 16 additions and 8 deletions

View File

@@ -24,7 +24,7 @@ SyncBufferHandler::SyncBufferHandler(Device &device)
allocateNewBuffer();
}
void SyncBufferHandler::prepareForEnqueue(size_t workGroupsCount, Kernel &kernel, CommandStreamReceiver &csr) {
void SyncBufferHandler::prepareForEnqueue(size_t workGroupsCount, Kernel &kernel) {
auto requiredSize = workGroupsCount;
std::lock_guard<std::mutex> guard(this->mutex);
@@ -36,11 +36,14 @@ void SyncBufferHandler::prepareForEnqueue(size_t workGroupsCount, Kernel &kernel
}
kernel.patchSyncBuffer(device, graphicsAllocation, usedBufferSize);
csr.makeResident(*graphicsAllocation);
usedBufferSize += requiredSize;
}
void SyncBufferHandler::makeResident(CommandStreamReceiver &csr) {
csr.makeResident(*graphicsAllocation);
}
void SyncBufferHandler::allocateNewBuffer() {
AllocationProperties allocationProperties{device.getRootDeviceIndex(), true, bufferSize,
GraphicsAllocation::AllocationType::LINEAR_STREAM,

View File

@@ -26,7 +26,8 @@ class SyncBufferHandler {
SyncBufferHandler(Device &device);
void prepareForEnqueue(size_t workGroupsCount, Kernel &kernel, CommandStreamReceiver &csr);
void prepareForEnqueue(size_t workGroupsCount, Kernel &kernel);
void makeResident(CommandStreamReceiver &csr);
protected:
void allocateNewBuffer();