mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
fix(OCL): Propagate error on kernel creation to API call
On clCreateKernelsInProgram API call, we do not propagate potential error from MultiDeviceKernel::create function. User would not know that i.e. out of 4 kernels, only 3 were created succesfully. - Propagate error returned from MultiDeviceKernel::create function to API call - In case of a failure on kernel creation, release all resources for the already created ones and return empty array (nullptrs). Related-To: NEO-7879 Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6357ab73ea
commit
3459f3a7f6
@@ -1835,7 +1835,17 @@ cl_int CL_API_CALL clCreateKernelsInProgram(cl_program clProgram,
|
||||
kernels[i] = MultiDeviceKernel::create(
|
||||
pProgram,
|
||||
kernelInfos,
|
||||
nullptr);
|
||||
&retVal);
|
||||
if (nullptr == kernels[i]) {
|
||||
UNRECOVERABLE_IF(CL_SUCCESS == retVal);
|
||||
for (unsigned int createdIdx = 0; createdIdx < i; ++createdIdx) {
|
||||
auto mDKernel = castToObject<MultiDeviceKernel>(kernels[createdIdx]);
|
||||
mDKernel->release();
|
||||
kernels[createdIdx] = nullptr;
|
||||
}
|
||||
TRACING_EXIT(ClCreateKernelsInProgram, &retVal);
|
||||
return retVal;
|
||||
}
|
||||
gtpinNotifyKernelCreate(kernels[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user