Limit system memory flag in builtin kernels to destination argument

Related-To: NEO-6959

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-07-15 19:47:17 +00:00
committed by Compute-Runtime-Automation
parent f89ea1685e
commit 3f8c19eec9
13 changed files with 341 additions and 30 deletions

View File

@ -881,7 +881,7 @@ cl_int Kernel::setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, G
patchedArgumentsNum++;
kernelArguments[argIndex].isPatched = true;
}
if (svmPtr != nullptr) {
if (svmPtr != nullptr && isBuiltIn == false) {
this->anyKernelArgumentUsingSystemMemory |= true;
}
addAllocationToCacheFlushVector(argIndex, svmAlloc);
@ -940,9 +940,9 @@ cl_int Kernel::setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocatio
patchedArgumentsNum++;
kernelArgInfo.isPatched = true;
}
if (!kernelArgInfo.isSetToNullptr) {
if (!kernelArgInfo.isSetToNullptr && isBuiltIn == false) {
if (svmAlloc != nullptr) {
this->anyKernelArgumentUsingSystemMemory |= graphicsAllocationTypeUseSystemMemory(svmAlloc->getAllocationType());
this->anyKernelArgumentUsingSystemMemory |= Kernel::graphicsAllocationTypeUseSystemMemory(svmAlloc->getAllocationType());
} else {
this->anyKernelArgumentUsingSystemMemory |= true;
}
@ -1406,7 +1406,9 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
}
auto gfxAllocationType = buffer->getGraphicsAllocation(rootDeviceIndex)->getAllocationType();
this->anyKernelArgumentUsingSystemMemory |= graphicsAllocationTypeUseSystemMemory(gfxAllocationType);
if (!isBuiltIn) {
this->anyKernelArgumentUsingSystemMemory |= Kernel::graphicsAllocationTypeUseSystemMemory(gfxAllocationType);
}
if (buffer->peekSharingHandler()) {
usingSharedObjArgs = true;