Skip to content

Commit 5cf0f7c

Browse files
[SYCL] Report false for aspect::image on all devices (#9368)
With the new ext_intel_legacy_image aspect for checking SYCL 1.2.1 image support, the implementation should now refer to the support for SYCL 2020 images when queried for either info::device::image_support or aspect::image. Since there is no current support for device-side SYCL 2020 images, this forces all devices to report false for both of these queries. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent ad8b7d4 commit 5cf0f7c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

sycl/include/sycl/info/device_traits.def

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ __SYCL_PARAM_TRAITS_SPEC(device, address_bits, pi_uint32,
5858
PI_DEVICE_INFO_ADDRESS_BITS)
5959
__SYCL_PARAM_TRAITS_SPEC(device, max_mem_alloc_size, pi_uint64,
6060
PI_DEVICE_INFO_MAX_MEM_ALLOC_SIZE)
61-
__SYCL_PARAM_TRAITS_SPEC(device, image_support, bool,
62-
PI_DEVICE_INFO_IMAGE_SUPPORT)
6361
__SYCL_PARAM_TRAITS_SPEC(device, max_read_image_args, pi_uint32,
6462
PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS)
6563
__SYCL_PARAM_TRAITS_SPEC(device, max_write_image_args, pi_uint32,
@@ -174,6 +172,7 @@ __SYCL_PARAM_TRAITS_SPEC(device, partition_type_affinity_domain,
174172
__SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(device, parent_device, sycl::device,
175173
PI_DEVICE_INFO_PARENT_DEVICE)
176174
__SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(device, aspects, std::vector<sycl::aspect>, 0)
175+
__SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(device, image_support, bool, 0)
177176

178177
// Extensions/deprecated
179178
__SYCL_PARAM_TRAITS_SPEC(device, atomic64, bool, PI_DEVICE_INFO_ATOMIC_64)

sycl/source/detail/device_info.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,14 @@ template <> struct get_device_info_impl<device, info::device::parent_device> {
689689
}
690690
};
691691

692+
// Specialization for image_support
693+
template <> struct get_device_info_impl<bool, info::device::image_support> {
694+
static bool get(const DeviceImplPtr &) {
695+
// No devices currently support SYCL 2020 images.
696+
return false;
697+
}
698+
};
699+
692700
// USM
693701

694702
// Specialization for device usm query.

sycl/source/device.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ device::get_info<info::device::aspects>() const {
177177
return DeviceAspects;
178178
}
179179

180+
template <>
181+
__SYCL_EXPORT bool device::get_info<info::device::image_support>() const {
182+
// Explicit specialization is needed due to the class of info handle. The
183+
// implementation is done in get_device_info_impl.
184+
return impl->template get_info<info::device::image_support>();
185+
}
186+
180187
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
181188
template __SYCL_EXPORT ReturnT device::get_info<info::device::Desc>() const;
182189

0 commit comments

Comments
 (0)