performance: Use lock pointer copy for dc flush mitigation

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-10-31 08:57:43 +00:00
committed by Compute-Runtime-Automation
parent 3fcb9b18ee
commit b050a83242
5 changed files with 37 additions and 15 deletions

View File

@@ -24,6 +24,7 @@
#include "shared/source/memory_manager/memory_operations_handler.h"
#include "shared/source/memory_manager/migration_sync_data.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/utilities/cpuintrinsics.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/command_queue.h"
@@ -212,8 +213,7 @@ bool inline copyHostPointer(Buffer *buffer,
size <= Buffer::maxBufferSizeForCopyOnCpu &&
isCompressionEnabled == false &&
productHelper.getLocalMemoryAccessMode(hwInfo) != LocalMemoryAccessMode::cpuAccessDisallowed &&
isLockable &&
!isGpuCopyRequiredForDcFlushMitigation;
isLockable;
if (debugManager.flags.CopyHostPtrOnCpu.get() != -1) {
copyOnCpuAllowed = debugManager.flags.CopyHostPtrOnCpu.get() == 1;
@@ -222,6 +222,9 @@ bool inline copyHostPointer(Buffer *buffer,
memory->setAubWritable(true, GraphicsAllocation::defaultBank);
memory->setTbxWritable(true, GraphicsAllocation::defaultBank);
memcpy_s(ptrOffset(lockedPointer, buffer->getOffset()), size, hostPtr, size);
if (isGpuCopyRequiredForDcFlushMitigation) {
CpuIntrinsics::sfence();
}
return true;
} else {
auto blitMemoryToAllocationResult = BlitOperationResult::unsupported;