mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
[3/n] Refactor CPU transfers.
- split functions to allowed and preferred versions - isReadWriteOnCpuAllowed tells if it is possible to do transfer on CPU - isReadWriteOnCpuPreffered tells about performance preference of doing it Change-Id: Ibe48d495fc7906dee6382de591baf8447eb6fe95 Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
553f88ecd8
commit
3b2bffc239
@@ -562,8 +562,8 @@ bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandT
|
||||
return false;
|
||||
}
|
||||
|
||||
//if buffer is compressed we cannot do CPU copy
|
||||
if (buffer->isCompressed()) {
|
||||
//check if buffer is compatible
|
||||
if (!buffer->isReadWriteOnCpuAllowed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -577,8 +577,8 @@ bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandT
|
||||
return false;
|
||||
}
|
||||
|
||||
//check if buffer is compatible
|
||||
if (!buffer->isReadWriteOnCpuAllowed(ptr, size)) {
|
||||
//check if it is beneficial to do transfer on CPU
|
||||
if (!buffer->isReadWriteOnCpuPreffered(ptr, size)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user