mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 17:29:14 +08:00
Improve uncached resources handling.
- Change kernel to properly detect true stateless resources - do not turn of stateless l3 if arg is used in pure stateful manner - refactor variable names to better reflect what they do - improve mock kernel with internal to have setKernelArg capabilties Change-Id: I2cdde04f2144d9b86dc1486126632db0fd7cad49 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
@@ -811,7 +811,7 @@ cl_int Kernel::setArg(uint32_t argIndex, size_t argSize, const void *argVal) {
|
||||
if (argIndex >= kernelArgHandlers.size()) {
|
||||
return CL_INVALID_ARG_INDEX;
|
||||
}
|
||||
argWasUncacheable = kernelArguments[argIndex].isUncacheable;
|
||||
argWasUncacheable = kernelArguments[argIndex].isStatelessUncacheable;
|
||||
auto argHandler = kernelArgHandlers[argIndex];
|
||||
retVal = (this->*argHandler)(argIndex, argSize, argVal);
|
||||
}
|
||||
@@ -820,8 +820,8 @@ cl_int Kernel::setArg(uint32_t argIndex, size_t argSize, const void *argVal) {
|
||||
patchedArgumentsNum++;
|
||||
kernelArguments[argIndex].isPatched = true;
|
||||
}
|
||||
auto argIsUncacheable = kernelArguments[argIndex].isUncacheable;
|
||||
uncacheableArgsCount += (argIsUncacheable ? 1 : 0) - (argWasUncacheable ? 1 : 0);
|
||||
auto argIsUncacheable = kernelArguments[argIndex].isStatelessUncacheable;
|
||||
statelessUncacheableArgsCount += (argIsUncacheable ? 1 : 0) - (argWasUncacheable ? 1 : 0);
|
||||
resolveArgs();
|
||||
}
|
||||
return retVal;
|
||||
@@ -1205,7 +1205,9 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
|
||||
auto surfaceState = ptrOffset(getSurfaceStateHeap(), kernelArgInfo.offsetHeap);
|
||||
buffer->setArgStateful(surfaceState, forceNonAuxMode, disableL3, isAuxTranslationKernel, kernelArgInfo.isReadOnly);
|
||||
}
|
||||
kernelArguments[argIndex].isUncacheable = buffer->isMemObjUncacheable();
|
||||
|
||||
kernelArguments[argIndex].isStatelessUncacheable = !kernelArgInfo.pureStatefulBufferAccess ? buffer->isMemObjUncacheable() : false;
|
||||
|
||||
addAllocationToCacheFlushVector(argIndex, buffer->getGraphicsAllocation());
|
||||
return CL_SUCCESS;
|
||||
} else {
|
||||
@@ -1510,9 +1512,9 @@ void Kernel::unsetArg(uint32_t argIndex) {
|
||||
if (kernelArguments[argIndex].isPatched) {
|
||||
patchedArgumentsNum--;
|
||||
kernelArguments[argIndex].isPatched = false;
|
||||
if (kernelArguments[argIndex].isUncacheable) {
|
||||
uncacheableArgsCount--;
|
||||
kernelArguments[argIndex].isUncacheable = false;
|
||||
if (kernelArguments[argIndex].isStatelessUncacheable) {
|
||||
statelessUncacheableArgsCount--;
|
||||
kernelArguments[argIndex].isStatelessUncacheable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user