Make CPU copy for read buffer when host ptr is write combined on DG2

With this commit on DG2 32bit driver will check if passed host ptr for
clEnqueueReadBuffer is write combined memory. If check will be true copy
will be make on CPU.

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2022-06-13 14:13:34 +00:00
committed by Compute-Runtime-Automation
parent cdfe2ce8ad
commit 213dc2fe24
13 changed files with 92 additions and 2 deletions

View File

@@ -836,6 +836,12 @@ size_t CommandQueue::estimateTimestampPacketNodesCount(const MultiDispatchInfo &
bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandType, cl_bool blocking, size_t size, void *ptr,
cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
const auto &hwInfo = device->getHardwareInfo();
const auto &hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (CL_COMMAND_READ_BUFFER == commandType && hwInfoConfig->isCpuCopyNecessary(ptr, buffer->getMemoryManager())) {
return true;
}
auto debugVariableSet = false;
// Requested by debug variable or allowed by Buffer
if (CL_COMMAND_READ_BUFFER == commandType && DebugManager.flags.DoCpuCopyOnReadBuffer.get() != -1) {