performance: enable staging read for cl buffers

Related-To: NEO-14026

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-03-21 10:59:11 +00:00
committed by Compute-Runtime-Automation
parent d04ac3d60f
commit 2b340528cf
3 changed files with 51 additions and 10 deletions

View File

@@ -2390,16 +2390,27 @@ cl_int CL_API_CALL clEnqueueReadBuffer(cl_command_queue commandQueue,
return retVal;
}
retVal = pCommandQueue->enqueueReadBuffer(
pBuffer,
blockingRead,
offset,
cb,
ptr,
nullptr,
numEventsInWaitList,
eventWaitList,
event);
if (pCommandQueue->isValidForStagingTransfer(pBuffer, ptr, cb, CL_COMMAND_READ_BUFFER, blockingRead, numEventsInWaitList > 0)) {
retVal = pCommandQueue->enqueueStagingBufferTransfer(
CL_COMMAND_READ_BUFFER,
pBuffer,
blockingRead,
offset,
cb,
ptr,
event);
} else {
retVal = pCommandQueue->enqueueReadBuffer(
pBuffer,
blockingRead,
offset,
cb,
ptr,
nullptr,
numEventsInWaitList,
eventWaitList,
event);
}
}
DBG_LOG_INPUTS("event", getClFileLogger().getEvents(reinterpret_cast<const uintptr_t *>(event), 1u));