performance: Mitigate dc flush on LNL Windows

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-08-28 10:11:54 +00:00
committed by Compute-Runtime-Automation
parent c9dd2b630a
commit 5aa5d40937
19 changed files with 84 additions and 16 deletions

View File

@@ -17,4 +17,8 @@ bool CommandQueue::isTimestampWaitEnabled() {
return true;
}
bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type) {
return type != AllocationType::bufferHostMemory;
}
} // namespace NEO

View File

@@ -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});
}