performance: flag, force zero copy for host ptr

When debug flag ForceZeroCopyForUseHostPtr is set, add
CL_MEM_FORCE_HOST_MEMORY_INTEL flag to buffers created with
CL_MEM_USE_HOST_PTR.
This makes the buffers use zero copy.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2024-11-12 08:20:49 +00:00
committed by Compute-Runtime-Automation
parent f55ad93baf
commit 0a12817664
4 changed files with 35 additions and 0 deletions

View File

@@ -106,6 +106,10 @@ cl_mem Buffer::validateInputAndCreateBuffer(cl_context context,
return nullptr;
}
if ((flags & CL_MEM_USE_HOST_PTR) && !!debugManager.flags.ForceZeroCopyForUseHostPtr.get()) {
flags |= CL_MEM_FORCE_HOST_MEMORY_INTEL;
}
MemoryProperties memoryProperties{};
cl_mem_alloc_flags_intel allocflags = 0;
cl_mem_flags_intel emptyFlagsIntel = 0;