Add error handling when kernel uses too much SLM

API Functions reporting error:
- clCreateKernel
- clEnqueueNDRangeKernel
- zeKernelCreate
- zeCommandListAppendLaunchKernel
- zeKernelSuggestGroupSize

Related-To: NEO-7280
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwolinski
2022-09-08 12:01:51 +00:00
committed by Compute-Runtime-Automation
parent 5a0dd8048b
commit 1142404c0c
11 changed files with 199 additions and 6 deletions

View File

@@ -101,6 +101,13 @@ class Kernel : public ReferenceTrackedObject<Kernel> {
pKernel = nullptr;
}
auto localMemSize = static_cast<uint32_t>(clDevice.getDevice().getDeviceInfo().localMemSize);
auto slmInlineSize = kernelInfo.kernelDescriptor.kernelAttributes.slmInlineSize;
if (slmInlineSize > 0 && localMemSize < slmInlineSize) {
retVal = CL_OUT_OF_RESOURCES;
}
if (errcodeRet) {
*errcodeRet = retVal;
}