refactor: Add key to force zero copy without coherency

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-12-01 14:35:38 +00:00
committed by Compute-Runtime-Automation
parent 253035878a
commit c8c3f862f4
11 changed files with 112 additions and 6 deletions

View File

@@ -436,7 +436,7 @@ bool MemObj::mappingOnCpuAllowed() const {
auto graphicsAllocation = multiGraphicsAllocation.getDefaultGraphicsAllocation();
return !isTiledAllocation() && !peekSharingHandler() && !isMipMapped(this) && !debugManager.flags.DisableZeroCopyForBuffers.get() &&
!graphicsAllocation->isCompressionEnabled() && MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool()) &&
allowCpuAccess();
allowCpuForMapUnmap();
}
bool MemObj::allowCpuAccess() const {
@@ -448,6 +448,14 @@ bool MemObj::allowCpuAccess() const {
return !graphicsAllocation->getDefaultGmm()->getPreferNoCpuAccess();
}
bool MemObj::allowCpuForMapUnmap() const {
auto ret = allowCpuAccess();
if (debugManager.flags.AllowZeroCopyWithoutCoherency.get() != -1) {
ret = debugManager.flags.AllowZeroCopyWithoutCoherency.get();
}
return ret;
}
void MemObj::storeProperties(const cl_mem_properties *properties) {
if (properties) {
for (size_t i = 0; properties[i] != 0; i += 2) {