Skip to content

[SYCL] Report false for aspect::image on all devices #9368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions sycl/include/sycl/info/device_traits.def
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ __SYCL_PARAM_TRAITS_SPEC(device, address_bits, pi_uint32,
PI_DEVICE_INFO_ADDRESS_BITS)
__SYCL_PARAM_TRAITS_SPEC(device, max_mem_alloc_size, pi_uint64,
PI_DEVICE_INFO_MAX_MEM_ALLOC_SIZE)
__SYCL_PARAM_TRAITS_SPEC(device, image_support, bool,
PI_DEVICE_INFO_IMAGE_SUPPORT)
__SYCL_PARAM_TRAITS_SPEC(device, max_read_image_args, pi_uint32,
PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS)
__SYCL_PARAM_TRAITS_SPEC(device, max_write_image_args, pi_uint32,
Expand Down Expand Up @@ -174,6 +172,7 @@ __SYCL_PARAM_TRAITS_SPEC(device, partition_type_affinity_domain,
__SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(device, parent_device, sycl::device,
PI_DEVICE_INFO_PARENT_DEVICE)
__SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(device, aspects, std::vector<sycl::aspect>, 0)
__SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(device, image_support, bool, 0)

// Extensions/deprecated
__SYCL_PARAM_TRAITS_SPEC(device, atomic64, bool, PI_DEVICE_INFO_ATOMIC_64)
Expand Down
8 changes: 8 additions & 0 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,14 @@ template <> struct get_device_info_impl<device, info::device::parent_device> {
}
};

// Specialization for image_support
template <> struct get_device_info_impl<bool, info::device::image_support> {
static bool get(const DeviceImplPtr &) {
// No devices currently support SYCL 2020 images.
return false;
}
};

// USM

// Specialization for device usm query.
Expand Down
7 changes: 7 additions & 0 deletions sycl/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ device::get_info<info::device::aspects>() const {
return DeviceAspects;
}

template <>
__SYCL_EXPORT bool device::get_info<info::device::image_support>() const {
// Explicit specialization is needed due to the class of info handle. The
// implementation is done in get_device_info_impl.
return impl->template get_info<info::device::image_support>();
}

#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
template __SYCL_EXPORT ReturnT device::get_info<info::device::Desc>() const;

Expand Down