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

@@ -59,13 +59,11 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
MemObjSurface bufferSurf(buffer);
HostPtrSurface hostPtrSurf(dstPtr, hostPtrSize);
Surface *surfaces[] = {&bufferSurf, &hostPtrSurf};
auto blitAllowed = blitEnqueueAllowed(cmdType);
if (region[0] != 0 &&
region[1] != 0 &&
region[2] != 0) {
auto &csr = getCommandStreamReceiver(blitAllowed);
bool status = csr.createAllocationForHostSurface(hostPtrSurf, true);
bool status = getGpgpuCommandStreamReceiver().createAllocationForHostSurface(hostPtrSurf, true);
if (!status) {
return CL_OUT_OF_RESOURCES;
}
@@ -89,7 +87,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
dc.dstSlicePitch = hostSlicePitch;
MultiDispatchInfo dispatchInfo(dc);
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead, blitAllowed);
CommandStreamReceiver &csr = selectCsrForBuiltinOperation(CL_COMMAND_READ_BUFFER_RECT, dispatchInfo);
dispatchBcsOrGpgpuEnqueue<CL_COMMAND_READ_BUFFER_RECT>(dispatchInfo, surfaces, eBuiltInOps, numEventsInWaitList, eventWaitList, event, blockingRead, csr);
if (context->isProvidingPerformanceHints()) {
context->providePerformanceHintForMemoryTransfer(CL_COMMAND_READ_BUFFER_RECT, true, static_cast<cl_mem>(buffer), ptr);