@@ -811,11 +811,7 @@ __SYCL_EXPORT std::vector<image_memory_handle_type>
811
811
get_image_memory_support (const image_descriptor &imageDescriptor,
812
812
const sycl::device &syclDevice,
813
813
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);
819
815
820
816
ur_image_desc_t urDesc;
821
817
ur_image_format_t urFormat;
@@ -825,15 +821,15 @@ get_image_memory_support(const image_descriptor &imageDescriptor,
825
821
Adapter->call <sycl::errc::runtime,
826
822
sycl::detail::UrApiKind::
827
823
urBindlessImagesGetImageMemoryHandleTypeSupportExp>(
828
- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
824
+ urCtx, urDevice , &urDesc, &urFormat,
829
825
ur_exp_image_mem_type_t ::UR_EXP_IMAGE_MEM_TYPE_USM_POINTER,
830
826
&supportsPointerAllocation);
831
827
832
828
ur_bool_t supportsOpaqueAllocation{0 };
833
829
Adapter->call <sycl::errc::runtime,
834
830
sycl::detail::UrApiKind::
835
831
urBindlessImagesGetImageMemoryHandleTypeSupportExp>(
836
- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
832
+ urCtx, urDevice , &urDesc, &urFormat,
837
833
ur_exp_image_mem_type_t ::UR_EXP_IMAGE_MEM_TYPE_OPAQUE_HANDLE,
838
834
&supportsOpaqueAllocation);
839
835
@@ -862,11 +858,7 @@ __SYCL_EXPORT bool is_image_handle_supported<unsampled_image_handle>(
862
858
const image_descriptor &imageDescriptor,
863
859
image_memory_handle_type imageMemoryHandleType,
864
860
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);
870
862
871
863
ur_image_desc_t urDesc;
872
864
ur_image_format_t urFormat;
@@ -881,8 +873,8 @@ __SYCL_EXPORT bool is_image_handle_supported<unsampled_image_handle>(
881
873
Adapter->call <sycl::errc::runtime,
882
874
sycl::detail::UrApiKind::
883
875
urBindlessImagesGetImageUnsampledHandleSupportExp>(
884
- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
885
- memHandleType, &supportsUnsampledHandle);
876
+ urCtx, urDevice , &urDesc, &urFormat, memHandleType ,
877
+ &supportsUnsampledHandle);
886
878
887
879
return supportsUnsampledHandle;
888
880
}
@@ -902,11 +894,7 @@ __SYCL_EXPORT bool is_image_handle_supported<sampled_image_handle>(
902
894
const image_descriptor &imageDescriptor,
903
895
image_memory_handle_type imageMemoryHandleType,
904
896
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);
910
898
911
899
ur_image_desc_t urDesc;
912
900
ur_image_format_t urFormat;
@@ -921,8 +909,8 @@ __SYCL_EXPORT bool is_image_handle_supported<sampled_image_handle>(
921
909
Adapter->call <
922
910
sycl::errc::runtime,
923
911
sycl::detail::UrApiKind::urBindlessImagesGetImageSampledHandleSupportExp>(
924
- CtxImpl. getHandleRef (), DevImpl-> getHandleRef () , &urDesc, &urFormat,
925
- memHandleType, &supportsSampledHandle);
912
+ urCtx, urDevice , &urDesc, &urFormat, memHandleType ,
913
+ &supportsSampledHandle);
926
914
927
915
return supportsSampledHandle;
928
916
}
0 commit comments