Create single point for selecting engine for builtin ops

- selectCsrForBuiltinOperation selects proper CSR
- selected CSR is passed to dispatchBcsOrGpgpuEnqueue
- Notifications such as notifyEnqueueReadBuffer are now made on correct engine
- Temporary allocs for hostptrs are now created on gpgpuCsr

Related-To: NEO-6057
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2021-08-26 11:53:25 +00:00
committed by Compute-Runtime-Automation
parent e96f1afa6f
commit a03b5f8a95
28 changed files with 272 additions and 185 deletions

View File

@@ -58,13 +58,11 @@ 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 = getCommandStreamReceiver(blitAllowed);
bool status = csr.createAllocationForHostSurface(hostPtrSurf, false);
bool status = getGpgpuCommandStreamReceiver().createAllocationForHostSurface(hostPtrSurf, false);
if (!status) {
return CL_OUT_OF_RESOURCES;
}
@@ -88,7 +86,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBufferRect(
dc.dstSlicePitch = bufferSlicePitch;
MultiDispatchInfo dispatchInfo(dc);
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite, blitAllowed);
CommandStreamReceiver &csr = selectCsrForBuiltinOperation(CL_COMMAND_WRITE_BUFFER_RECT, dispatchInfo);
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_WRITE_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingWrite, csr);
if (context->isProvidingPerformanceHints()) {
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, CL_ENQUEUE_WRITE_BUFFER_RECT_REQUIRES_COPY_DATA, static_cast<cl_mem>(buffer));