[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:
Michal Mrozek
2020-02-21 11:11:36 +01:00
committed by sys_ocldev
parent 553f88ecd8
commit 3b2bffc239
5 changed files with 48 additions and 24 deletions

View File

@@ -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;
}