@@ -95,10 +95,14 @@ class device_image_impl {
9595
9696 // Otherwise, if the device candidate is a sub-device it is also valid if
9797 // its parent is valid.
98- if (!getSyclObjImpl (DeviceCand)->isRootDevice ())
99- return has_kernel (KernelIDCand,
100- DeviceCand.get_info <info::device::parent_device>());
101-
98+ if (!getSyclObjImpl (DeviceCand)->isRootDevice ()) {
99+ try {
100+ return has_kernel (KernelIDCand,
101+ DeviceCand.get_info <info::device::parent_device>());
102+ } catch (std::exception &e) {
103+ __SYCL_REPORT_EXCEPTION_TO_STREAM (" exception in has_kernel" , e);
104+ }
105+ }
102106 return false ;
103107 }
104108
@@ -270,10 +274,15 @@ class device_image_impl {
270274 // TODO consider changing the lifetime of device_image_impl instead
271275 ur_buffer_properties_t Properties = {UR_STRUCTURE_TYPE_BUFFER_PROPERTIES,
272276 nullptr , MSpecConstsBlob.data ()};
273- memBufferCreateHelper (
274- Plugin, detail::getSyclObjImpl (MContext)->getHandleRef (),
275- UR_MEM_FLAG_READ_WRITE | UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER,
276- MSpecConstsBlob.size (), &MSpecConstsBuffer, &Properties);
277+ try {
278+ memBufferCreateHelper (
279+ Plugin, detail::getSyclObjImpl (MContext)->getHandleRef (),
280+ UR_MEM_FLAG_READ_WRITE | UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER,
281+ MSpecConstsBlob.size (), &MSpecConstsBuffer, &Properties);
282+ } catch (std::exception &e) {
283+ __SYCL_REPORT_EXCEPTION_TO_STREAM (
284+ " exception in get_spec_const_buffer_ref" , e);
285+ }
277286 }
278287 return MSpecConstsBuffer;
279288 }
0 commit comments