fix: add L3 flush after post sync for zero copy mem objects

Related-To: NEO-13163
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk 2025-05-21 15:47:11 +00:00 committed by Compute-Runtime-Automation
parent 90da066972
commit caf1781e73
3 changed files with 8 additions and 1 deletions

View File

@ -104,7 +104,7 @@ inline void HardwareInterface<GfxFamily>::programWalker(
if constexpr (heaplessModeEnabled) {
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
bool flushL3AfterPostSyncForHostUsm = kernelSystemAllocation;
bool flushL3AfterPostSyncForHostUsm = kernelSystemAllocation || kernel.isAnyKernelArgumentUsingZeroCopyMemory();
bool flushL3AfterPostSyncForExternalAllocation = kernel.isUsingSharedObjArgs();
if (debugManager.flags.DisableFlushL3ForHostUsm.get() && flushL3AfterPostSyncForHostUsm) {

View File

@ -1469,6 +1469,8 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
this->anyKernelArgumentUsingSystemMemory |= Kernel::graphicsAllocationTypeUseSystemMemory(gfxAllocationType);
}
this->anyKernelArgumentUsingZeroCopyMemory |= buffer->isMemObjZeroCopy();
if (buffer->peekSharingHandler()) {
usingSharedObjArgs = true;
}

View File

@ -375,6 +375,10 @@ class Kernel : public ReferenceTrackedObject<Kernel>, NEO::NonCopyableAndNonMova
return anyKernelArgumentUsingSystemMemory;
}
bool isAnyKernelArgumentUsingZeroCopyMemory() const {
return anyKernelArgumentUsingZeroCopyMemory;
}
static bool graphicsAllocationTypeUseSystemMemory(AllocationType type);
void setDestinationAllocationInSystemMemory(bool value) {
isDestinationAllocationInSystemMemory = value;
@ -471,6 +475,7 @@ class Kernel : public ReferenceTrackedObject<Kernel>, NEO::NonCopyableAndNonMova
bool isUnifiedMemorySyncRequired = true;
bool kernelHasIndirectAccess = true;
bool anyKernelArgumentUsingSystemMemory = false;
bool anyKernelArgumentUsingZeroCopyMemory = false;
bool isDestinationAllocationInSystemMemory = false;
};