Small refactor getCommandStreamReceiver

Related-To: NEO-4692
Change-Id: Ie8c36982d5bd626735d1f8e6d04084bce67738e5
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2020-10-27 13:27:13 +01:00
committed by sys_ocldev
parent 31118b0bd7
commit f84cd9f424
16 changed files with 55 additions and 47 deletions

View File

@@ -58,11 +58,12 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBufferRect(
MemObjSurface dstBufferSurf(buffer);
HostPtrSurface hostPtrSurf(srcPtr, hostPtrSize, true);
Surface *surfaces[] = {&dstBufferSurf, &hostPtrSurf};
auto blitAllowed = blitEnqueueAllowed(cmdType);
if (region[0] != 0 &&
region[1] != 0 &&
region[2] != 0) {
auto &csr = getCommandStreamReceiverByCommandType(cmdType);
auto &csr = getCommandStreamReceiver(blitAllowed);
bool status = csr.createAllocationForHostSurface(hostPtrSurf, false);
if (!status) {
return CL_OUT_OF_RESOURCES;
@@ -87,8 +88,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBufferRect(
dc.dstSlicePitch = bufferSlicePitch;
MultiDispatchInfo dispatchInfo(dc);
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite);
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite, blitAllowed);
if (context->isProvidingPerformanceHints()) {
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, CL_ENQUEUE_WRITE_BUFFER_RECT_REQUIRES_COPY_DATA, static_cast<cl_mem>(buffer));