Improve error handling in clCreateKernel

return nullptr when kernel initialization fails

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-05-20 17:04:15 +00:00
committed by Compute-Runtime-Automation
parent 84a0813dfa
commit d2ac316e47
2 changed files with 20 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ class MultiDeviceKernel : public BaseObject<_cl_kernel> {
continue;
}
kernels[rootDeviceIndex] = Kernel::create<kernel_t, program_t>(program, *kernelInfos[rootDeviceIndex], *pDevice, errcodeRet);
if (!kernels[rootDeviceIndex]) {
return nullptr;
}
}
auto pMultiDeviceKernel = new multi_device_kernel_t(std::move(kernels), kernelInfos);