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

@@ -352,6 +352,10 @@ ze_result_t KernelImp::suggestGroupSize(uint32_t globalSizeX, uint32_t globalSiz
uint32_t numThreadsPerSubSlice = (uint32_t)deviceInfo.maxNumEUsPerSubSlice * deviceInfo.numThreadsPerEU;
uint32_t localMemSize = (uint32_t)deviceInfo.localMemSize;
if (this->getSlmTotalSize() > 0 && localMemSize < this->getSlmTotalSize()) {
return ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY;
}
NEO::WorkSizeInfo wsInfo(maxWorkGroupSize, kernelImmData->getDescriptor().kernelAttributes.usesBarriers(), simd, this->getSlmTotalSize(),
hwInfo, numThreadsPerSubSlice, localMemSize,
usesImages, false, kernelImmData->getDescriptor().kernelAttributes.flags.requiresDisabledEUFusion);