Initial support for enqueue blit operation

Change-Id: Iab37beeeb574243c00a5579568e15bcbd1307c43
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
Related-To: NEO-3020
This commit is contained in:
Dunajski, Bartosz
2019-06-05 09:35:58 +02:00
committed by sys_ocldev
parent 031d865b59
commit 576005f7bb
7 changed files with 84 additions and 12 deletions

View File

@ -583,4 +583,16 @@ bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandT
buffer->getGraphicsAllocation()->getAllocationType() != GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) ||
buffer->isReadWriteOnCpuAllowed(blocking, numEventsInWaitList, ptr, size);
}
cl_int CommandQueue::enqueueReadWriteBufferWithBlitTransfer(cl_command_type commandType, Buffer *buffer,
size_t offset, size_t size, void *ptr, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event) {
CsrDependencies csrDependencies;
auto blitCommandStreamReceiver = context->getCommandStreamReceiverForBlitOperation(*buffer);
auto copyDirection = (CL_COMMAND_WRITE_BUFFER == commandType) ? BlitterConstants::BlitWithHostPtrDirection::FromHostPtr
: BlitterConstants::BlitWithHostPtrDirection::ToHostPtr;
blitCommandStreamReceiver->blitWithHostPtr(*buffer, ptr, true, offset, size, copyDirection, csrDependencies);
return CL_SUCCESS;
}
} // namespace NEO