Add support for stateless write buffer

Change-Id: Ie5d5abc9fac268c3467cafed5741828d84b13795
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-3314
This commit is contained in:
Kamil Kopryk
2019-11-04 14:58:49 +01:00
committed by sys_ocldev
parent 2599a712fe
commit 1bfe9f548e
2 changed files with 63 additions and 3 deletions

View File

@@ -50,11 +50,15 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
numEventsInWaitList, eventWaitList, event);
}
auto &builder = getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(EBuiltInOps::CopyBufferToBuffer,
this->getContext(), this->getDevice());
auto eBuiltInOps = EBuiltInOps::CopyBufferToBuffer;
if (forceStateless(size)) {
eBuiltInOps = EBuiltInOps::CopyBufferToBufferStateless;
}
auto &builder = getDevice().getExecutionEnvironment()->getBuiltIns()->getBuiltinDispatchInfoBuilder(eBuiltInOps,
this->getContext(),
this->getDevice());
BuiltInOwnershipWrapper builtInLock(builder, this->context);
MultiDispatchInfo dispatchInfo;
void *srcPtr = const_cast<void *>(ptr);
@@ -89,6 +93,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
dc.dstOffset = {offset, 0, 0};
dc.size = {size, 0, 0};
dc.transferAllocation = mapAllocation ? mapAllocation : hostPtrSurf.getAllocation();
MultiDispatchInfo dispatchInfo;
builder.buildDispatchInfos(dispatchInfo, dc);
enqueueHandler<CL_COMMAND_WRITE_BUFFER>(