Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions sycl/source/detail/bindless_images.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,7 @@ __SYCL_EXPORT std::vector<image_memory_handle_type>
get_image_memory_support(const image_descriptor &imageDescriptor,
const sycl::device &syclDevice,
const sycl::context &syclContext) {
std::shared_ptr<sycl::detail::device_impl> DevImpl =
sycl::detail::getSyclObjImpl(syclDevice);
sycl::detail::context_impl &CtxImpl =
*sycl::detail::getSyclObjImpl(syclContext);
const sycl::detail::AdapterPtr &Adapter = CtxImpl.getAdapter();
auto [urDevice, urCtx, Adapter] = get_ur_handles(syclDevice, syclContext);

ur_image_desc_t urDesc;
ur_image_format_t urFormat;
Expand All @@ -825,15 +821,15 @@ get_image_memory_support(const image_descriptor &imageDescriptor,
Adapter->call<sycl::errc::runtime,
sycl::detail::UrApiKind::
urBindlessImagesGetImageMemoryHandleTypeSupportExp>(
CtxImpl.getHandleRef(), DevImpl->getHandleRef(), &urDesc, &urFormat,
urCtx, urDevice, &urDesc, &urFormat,
ur_exp_image_mem_type_t::UR_EXP_IMAGE_MEM_TYPE_USM_POINTER,
&supportsPointerAllocation);

ur_bool_t supportsOpaqueAllocation{0};
Adapter->call<sycl::errc::runtime,
sycl::detail::UrApiKind::
urBindlessImagesGetImageMemoryHandleTypeSupportExp>(
CtxImpl.getHandleRef(), DevImpl->getHandleRef(), &urDesc, &urFormat,
urCtx, urDevice, &urDesc, &urFormat,
ur_exp_image_mem_type_t::UR_EXP_IMAGE_MEM_TYPE_OPAQUE_HANDLE,
&supportsOpaqueAllocation);

Expand Down Expand Up @@ -862,11 +858,7 @@ __SYCL_EXPORT bool is_image_handle_supported<unsampled_image_handle>(
const image_descriptor &imageDescriptor,
image_memory_handle_type imageMemoryHandleType,
const sycl::device &syclDevice, const sycl::context &syclContext) {
std::shared_ptr<sycl::detail::device_impl> DevImpl =
sycl::detail::getSyclObjImpl(syclDevice);
sycl::detail::context_impl &CtxImpl =
*sycl::detail::getSyclObjImpl(syclContext);
const sycl::detail::AdapterPtr &Adapter = CtxImpl.getAdapter();
auto [urDevice, urCtx, Adapter] = get_ur_handles(syclDevice, syclContext);

ur_image_desc_t urDesc;
ur_image_format_t urFormat;
Expand All @@ -881,8 +873,8 @@ __SYCL_EXPORT bool is_image_handle_supported<unsampled_image_handle>(
Adapter->call<sycl::errc::runtime,
sycl::detail::UrApiKind::
urBindlessImagesGetImageUnsampledHandleSupportExp>(
CtxImpl.getHandleRef(), DevImpl->getHandleRef(), &urDesc, &urFormat,
memHandleType, &supportsUnsampledHandle);
urCtx, urDevice, &urDesc, &urFormat, memHandleType,
&supportsUnsampledHandle);

return supportsUnsampledHandle;
}
Expand All @@ -902,11 +894,7 @@ __SYCL_EXPORT bool is_image_handle_supported<sampled_image_handle>(
const image_descriptor &imageDescriptor,
image_memory_handle_type imageMemoryHandleType,
const sycl::device &syclDevice, const sycl::context &syclContext) {
std::shared_ptr<sycl::detail::device_impl> DevImpl =
sycl::detail::getSyclObjImpl(syclDevice);
sycl::detail::context_impl &CtxImpl =
*sycl::detail::getSyclObjImpl(syclContext);
const sycl::detail::AdapterPtr &Adapter = CtxImpl.getAdapter();
auto [urDevice, urCtx, Adapter] = get_ur_handles(syclDevice, syclContext);

ur_image_desc_t urDesc;
ur_image_format_t urFormat;
Expand All @@ -921,8 +909,8 @@ __SYCL_EXPORT bool is_image_handle_supported<sampled_image_handle>(
Adapter->call<
sycl::errc::runtime,
sycl::detail::UrApiKind::urBindlessImagesGetImageSampledHandleSupportExp>(
CtxImpl.getHandleRef(), DevImpl->getHandleRef(), &urDesc, &urFormat,
memHandleType, &supportsSampledHandle);
urCtx, urDevice, &urDesc, &urFormat, memHandleType,
&supportsSampledHandle);

return supportsSampledHandle;
}
Expand Down