mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
refactor: Add key to force zero copy without coherency
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
253035878a
commit
c8c3f862f4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user