mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Improve uncached flag.
- When resource is uncached for surface state and not used in stateless manner then it doesn't need to flush cache - Minor cleanup Change-Id: I4cfe5a6fe3e666200407d9acdd89e6f64b2b3eed Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
@@ -1206,9 +1206,16 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
|
||||
buffer->setArgStateful(surfaceState, forceNonAuxMode, disableL3, isAuxTranslationKernel, kernelArgInfo.isReadOnly);
|
||||
}
|
||||
|
||||
kernelArguments[argIndex].isStatelessUncacheable = !kernelArgInfo.pureStatefulBufferAccess ? buffer->isMemObjUncacheable() : false;
|
||||
kernelArguments[argIndex].isStatelessUncacheable = kernelArgInfo.pureStatefulBufferAccess ? false : buffer->isMemObjUncacheable();
|
||||
|
||||
addAllocationToCacheFlushVector(argIndex, buffer->getGraphicsAllocation());
|
||||
auto allocationForCacheFlush = buffer->getGraphicsAllocation();
|
||||
|
||||
//if we make object uncacheable for surface state and there are not stateless accessess , then ther is no need to flush caches
|
||||
if (buffer->isMemObjUncacheableForSurfaceState() && kernelArgInfo.pureStatefulBufferAccess) {
|
||||
allocationForCacheFlush = nullptr;
|
||||
}
|
||||
|
||||
addAllocationToCacheFlushVector(argIndex, allocationForCacheFlush);
|
||||
return CL_SUCCESS;
|
||||
} else {
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
|
||||
if (ptrAlloc != nullptr) {
|
||||
memoryAllocation = new MemoryAllocation(allocationData.type, ptrAlloc, ptrAlloc, GmmHelper::canonize(gpuAddress),
|
||||
allocationData.size, counter, MemoryPool::System4KBPagesWith32BitGpuAddressing, false,
|
||||
false, false);
|
||||
false, allocationData.flags.flushL3);
|
||||
|
||||
memoryAllocation->set32BitAllocation(true);
|
||||
memoryAllocation->setGpuBaseAddress(GmmHelper::canonize(gfxPartition->getHeapBase(heap)));
|
||||
|
||||
Reference in New Issue
Block a user