@@ -811,11 +811,7 @@ __SYCL_EXPORT std::vector<image_memory_handle_type>
811811get_image_memory_support (const image_descriptor &imageDescriptor,
812812 const sycl::device &syclDevice,
813813 const sycl::context &syclContext) {
814- std::shared_ptr<sycl::detail::device_impl> DevImpl =
815- sycl::detail::getSyclObjImpl (syclDevice);
816- sycl::detail::context_impl &CtxImpl =
817- *sycl::detail::getSyclObjImpl (syclContext);
818- const sycl::detail::AdapterPtr &Adapter = CtxImpl.getAdapter ();
814+ auto [urDevice, urCtx, Adapter] = get_ur_handles (syclDevice, syclContext);
819815
820816 ur_image_desc_t urDesc;
821817 ur_image_format_t urFormat;
@@ -825,15 +821,15 @@ get_image_memory_support(const image_descriptor &imageDescriptor,
825821 Adapter->call <sycl::errc::runtime,
826822 sycl::detail::UrApiKind::
827823 urBindlessImagesGetImageMemoryHandleTypeSupportExp>(
828- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
824+ urCtx, urDevice , &urDesc, &urFormat,
829825 ur_exp_image_mem_type_t ::UR_EXP_IMAGE_MEM_TYPE_USM_POINTER,
830826 &supportsPointerAllocation);
831827
832828 ur_bool_t supportsOpaqueAllocation{0 };
833829 Adapter->call <sycl::errc::runtime,
834830 sycl::detail::UrApiKind::
835831 urBindlessImagesGetImageMemoryHandleTypeSupportExp>(
836- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
832+ urCtx, urDevice , &urDesc, &urFormat,
837833 ur_exp_image_mem_type_t ::UR_EXP_IMAGE_MEM_TYPE_OPAQUE_HANDLE,
838834 &supportsOpaqueAllocation);
839835
@@ -862,11 +858,7 @@ __SYCL_EXPORT bool is_image_handle_supported<unsampled_image_handle>(
862858 const image_descriptor &imageDescriptor,
863859 image_memory_handle_type imageMemoryHandleType,
864860 const sycl::device &syclDevice, const sycl::context &syclContext) {
865- std::shared_ptr<sycl::detail::device_impl> DevImpl =
866- sycl::detail::getSyclObjImpl (syclDevice);
867- sycl::detail::context_impl &CtxImpl =
868- *sycl::detail::getSyclObjImpl (syclContext);
869- const sycl::detail::AdapterPtr &Adapter = CtxImpl.getAdapter ();
861+ auto [urDevice, urCtx, Adapter] = get_ur_handles (syclDevice, syclContext);
870862
871863 ur_image_desc_t urDesc;
872864 ur_image_format_t urFormat;
@@ -881,8 +873,8 @@ __SYCL_EXPORT bool is_image_handle_supported<unsampled_image_handle>(
881873 Adapter->call <sycl::errc::runtime,
882874 sycl::detail::UrApiKind::
883875 urBindlessImagesGetImageUnsampledHandleSupportExp>(
884- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
885- memHandleType, &supportsUnsampledHandle);
876+ urCtx, urDevice , &urDesc, &urFormat, memHandleType ,
877+ &supportsUnsampledHandle);
886878
887879 return supportsUnsampledHandle;
888880}
@@ -902,11 +894,7 @@ __SYCL_EXPORT bool is_image_handle_supported<sampled_image_handle>(
902894 const image_descriptor &imageDescriptor,
903895 image_memory_handle_type imageMemoryHandleType,
904896 const sycl::device &syclDevice, const sycl::context &syclContext) {
905- std::shared_ptr<sycl::detail::device_impl> DevImpl =
906- sycl::detail::getSyclObjImpl (syclDevice);
907- sycl::detail::context_impl &CtxImpl =
908- *sycl::detail::getSyclObjImpl (syclContext);
909- const sycl::detail::AdapterPtr &Adapter = CtxImpl.getAdapter ();
897+ auto [urDevice, urCtx, Adapter] = get_ur_handles (syclDevice, syclContext);
910898
911899 ur_image_desc_t urDesc;
912900 ur_image_format_t urFormat;
@@ -921,8 +909,8 @@ __SYCL_EXPORT bool is_image_handle_supported<sampled_image_handle>(
921909 Adapter->call <
922910 sycl::errc::runtime,
923911 sycl::detail::UrApiKind::urBindlessImagesGetImageSampledHandleSupportExp>(
924- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
925- memHandleType, &supportsSampledHandle);
912+ urCtx, urDevice , &urDesc, &urFormat, memHandleType ,
913+ &supportsSampledHandle);
926914
927915 return supportsSampledHandle;
928916}
0 commit comments