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:
Mrozek, Michal
2019-08-30 11:46:12 +02:00
parent ae201a47d3
commit 0666da693e
4 changed files with 48 additions and 6 deletions

View File

@@ -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 {

View File

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