mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-27 07:44:16 +08:00
[1/n] Refactor CPU copies.
- remove waitlist check from buffer - refactor the flow in CommandQueue::bufferCpuCopyAllowed Change-Id: I52bb7f886211b05f80118665bb28dfdb5f113fe7
This commit is contained in:
committed by
sys_ocldev
parent
656a6cfe8c
commit
bd1ac55e2c
@@ -553,9 +553,26 @@ bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandT
|
||||
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);
|
||||
//if we are blocked by user events, we can't service the call on CPU
|
||||
if (Event::checkUserEventDependencies(numEventsInWaitList, eventWaitList)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (debugVariableSet && buffer->getGraphicsAllocation()->getAllocationType() != GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//check if buffer is compatible
|
||||
if (!buffer->isReadWriteOnCpuAllowed(blocking, ptr, size)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//make sure that event wait list is empty
|
||||
if (numEventsInWaitList == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CommandQueue::queueDependenciesClearRequired() const {
|
||||
|
||||
Reference in New Issue
Block a user