mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
refactor: Add dc flush mitigation infrastructure
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1ce29d1a31
commit
d6076941a8
@@ -184,6 +184,8 @@ Buffer *Buffer::create(Context *context,
|
||||
flags, 0, size, hostPtr, bufferCreateArgs, errcodeRet);
|
||||
}
|
||||
|
||||
extern bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type);
|
||||
|
||||
bool inline copyHostPointer(Buffer *buffer,
|
||||
Device &device,
|
||||
size_t size,
|
||||
@@ -195,7 +197,8 @@ bool inline copyHostPointer(Buffer *buffer,
|
||||
auto memory = buffer->getGraphicsAllocation(rootDeviceIndex);
|
||||
auto isCompressionEnabled = memory->isCompressionEnabled();
|
||||
const bool isLocalMemory = !MemoryPoolHelper::isSystemMemoryPool(memory->getMemoryPool());
|
||||
const bool gpuCopyRequired = isCompressionEnabled || isLocalMemory || productHelper.isDcFlushMitigated();
|
||||
const bool isGpuCopyRequiredForDcFlushMitigation = productHelper.isDcFlushMitigated() && checkIsGpuCopyRequiredForDcFlushMitigation(memory->getAllocationType());
|
||||
const bool gpuCopyRequired = isCompressionEnabled || isLocalMemory || isGpuCopyRequiredForDcFlushMitigation;
|
||||
if (gpuCopyRequired) {
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
|
||||
@@ -210,7 +213,7 @@ bool inline copyHostPointer(Buffer *buffer,
|
||||
isCompressionEnabled == false &&
|
||||
productHelper.getLocalMemoryAccessMode(hwInfo) != LocalMemoryAccessMode::cpuAccessDisallowed &&
|
||||
isLockable &&
|
||||
!productHelper.isDcFlushMitigated();
|
||||
!isGpuCopyRequiredForDcFlushMitigation;
|
||||
|
||||
if (debugManager.flags.CopyHostPtrOnCpu.get() != -1) {
|
||||
copyOnCpuAllowed = debugManager.flags.CopyHostPtrOnCpu.get() == 1;
|
||||
@@ -223,7 +226,7 @@ bool inline copyHostPointer(Buffer *buffer,
|
||||
} else {
|
||||
auto blitMemoryToAllocationResult = BlitOperationResult::unsupported;
|
||||
|
||||
if (productHelper.isBlitterFullySupported(hwInfo) && (isLocalMemory || productHelper.isDcFlushMitigated())) {
|
||||
if (productHelper.isBlitterFullySupported(hwInfo) && (isLocalMemory || isGpuCopyRequiredForDcFlushMitigation)) {
|
||||
blitMemoryToAllocationResult = BlitHelperFunctions::blitMemoryToAllocation(device, memory, buffer->getOffset(), hostPtr, {size, 1, 1});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user