mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
performance: Use lock pointer copy for dc flush mitigation
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3fcb9b18ee
commit
b050a83242
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user