mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Add selectCsrForBuiltinOperation method to OpenCL CommandQueue
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com> Related-To: NEO-6057
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
03ee6bc2dd
commit
858727010f
@@ -35,8 +35,11 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferRect(
|
||||
const cl_event *eventWaitList,
|
||||
cl_event *event) {
|
||||
const cl_command_type cmdType = CL_COMMAND_READ_BUFFER_RECT;
|
||||
auto isMemTransferNeeded = true;
|
||||
|
||||
CsrSelectionArgs csrSelectionArgs{cmdType, buffer, {}, device->getRootDeviceIndex(), region};
|
||||
CommandStreamReceiver &csr = selectCsrForBuiltinOperation(csrSelectionArgs);
|
||||
|
||||
auto isMemTransferNeeded = true;
|
||||
if (buffer->isMemObjZeroCopy()) {
|
||||
size_t bufferOffset;
|
||||
size_t hostOffset;
|
||||
@@ -59,12 +62,10 @@ 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);
|
||||
if (!status) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
@@ -89,7 +90,7 @@ 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);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user