File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -124,9 +124,12 @@ class KernelProgramCache {
124124 try {
125125 if (Val) {
126126 AdapterPtr AdapterSharedPtr = AdapterWeakPtr.lock ();
127- ur_result_t Err =
128- AdapterSharedPtr->call_nocheck <UrApiKind::urProgramRelease>(Val);
129- __SYCL_CHECK_UR_CODE_NO_EXC (Err);
127+ if (AdapterSharedPtr) {
128+ ur_result_t Err =
129+ AdapterSharedPtr->call_nocheck <UrApiKind::urProgramRelease>(
130+ Val);
131+ __SYCL_CHECK_UR_CODE_NO_EXC (Err);
132+ }
130133 }
131134 } catch (std::exception &e) {
132135 __SYCL_REPORT_EXCEPTION_TO_STREAM (" exception in ~ProgramBuildResult" ,
@@ -206,10 +209,12 @@ class KernelProgramCache {
206209 try {
207210 if (Val.first ) {
208211 AdapterPtr AdapterSharedPtr = AdapterWeakPtr.lock ();
209- ur_result_t Err =
210- AdapterSharedPtr->call_nocheck <UrApiKind::urKernelRelease>(
211- Val.first );
212- __SYCL_CHECK_UR_CODE_NO_EXC (Err);
212+ if (AdapterSharedPtr) {
213+ ur_result_t Err =
214+ AdapterSharedPtr->call_nocheck <UrApiKind::urKernelRelease>(
215+ Val.first );
216+ __SYCL_CHECK_UR_CODE_NO_EXC (Err);
217+ }
213218 }
214219 } catch (std::exception &e) {
215220 __SYCL_REPORT_EXCEPTION_TO_STREAM (" exception in ~KernelBuildResult" , e);
You can’t perform that action at this time.
0 commit comments