diff --git a/sycl/include/sycl/ext/oneapi/bindless_images.hpp b/sycl/include/sycl/ext/oneapi/bindless_images.hpp index c0249d04903dc..cd86e32bc66e8 100644 --- a/sycl/include/sycl/ext/oneapi/bindless_images.hpp +++ b/sycl/include/sycl/ext/oneapi/bindless_images.hpp @@ -1036,19 +1036,15 @@ DataT fetch_image(const sampled_image_handle &imageHandle [[maybe_unused]], "HintT must always be a recognized standard type"); #ifdef __SYCL_DEVICE_ONLY__ - // Convert the raw handle to an image and use FETCH_UNSAMPLED_IMAGE since - // fetch_image should not use the sampler if constexpr (detail::is_recognized_standard_type()) { - return FETCH_UNSAMPLED_IMAGE( + return FETCH_SAMPLED_IMAGE( DataT, - CONVERT_HANDLE_TO_IMAGE(imageHandle.raw_handle, - detail::OCLImageTyRead), + CONVERT_HANDLE_TO_SAMPLED_IMAGE(imageHandle.raw_handle, coordSize), coords); } else { - return sycl::bit_cast(FETCH_UNSAMPLED_IMAGE( + return sycl::bit_cast(FETCH_SAMPLED_IMAGE( HintT, - CONVERT_HANDLE_TO_IMAGE(imageHandle.raw_handle, - detail::OCLImageTyRead), + CONVERT_HANDLE_TO_SAMPLED_IMAGE(imageHandle.raw_handle, coordSize), coords)); } #else