Simplify read/write enqueue operations on CPU

Change-Id: I7f59b04d484be2699e325d10e16298016231faf2
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-05-30 14:36:12 +02:00
parent 9ecaaa731a
commit f6bf2c5d0b
15 changed files with 215 additions and 179 deletions

View File

@ -572,4 +572,15 @@ size_t CommandQueue::estimateTimestampPacketNodesCount(const MultiDispatchInfo &
}
return nodesCount;
}
bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandType, cl_bool blocking, size_t size, void *ptr,
cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
// Requested by debug variable or allowed by Buffer
bool debugVariableSet = (CL_COMMAND_READ_BUFFER == commandType && DebugManager.flags.DoCpuCopyOnReadBuffer.get()) ||
(CL_COMMAND_WRITE_BUFFER == commandType && DebugManager.flags.DoCpuCopyOnWriteBuffer.get());
return (debugVariableSet && !Event::checkUserEventDependencies(numEventsInWaitList, eventWaitList) &&
buffer->getGraphicsAllocation()->getAllocationType() != GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) ||
buffer->isReadWriteOnCpuAllowed(blocking, numEventsInWaitList, ptr, size);
}
} // namespace NEO