Skip to content

Commit 2cebd0e

Browse files
authored
[SYCL] Add deprecation warnings to info::device/platform::extensions (#4497)
info::device/platform::extensions are deprecated in SYCL 2020, added warnings to them Signed-off-by: mdimakov [email protected]
1 parent 7cc89fa commit 2cebd0e

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

sycl/include/CL/sycl/info/info_desc.hpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ namespace info {
2525
// Information descriptors
2626
// A.1 Platform information descriptors
2727
enum class platform {
28-
profile = PI_PLATFORM_INFO_PROFILE,
29-
version = PI_PLATFORM_INFO_VERSION,
30-
name = PI_PLATFORM_INFO_NAME,
31-
vendor = PI_PLATFORM_INFO_VENDOR,
32-
extensions = PI_PLATFORM_INFO_EXTENSIONS,
28+
profile = PI_PLATFORM_INFO_PROFILE,
29+
version = PI_PLATFORM_INFO_VERSION,
30+
name = PI_PLATFORM_INFO_NAME,
31+
vendor = PI_PLATFORM_INFO_VENDOR,
32+
extensions __SYCL2020_DEPRECATED(
33+
"platform::extensions is deprecated, use device::get_info() with"
34+
" info::device::aspects instead.") = PI_PLATFORM_INFO_EXTENSIONS,
3335
};
3436

3537
// A.2 Context information desctiptors
@@ -113,7 +115,9 @@ enum class device : cl_device_info {
113115
profile = CL_DEVICE_PROFILE,
114116
version = CL_DEVICE_VERSION,
115117
opencl_c_version = CL_DEVICE_OPENCL_C_VERSION,
116-
extensions = CL_DEVICE_EXTENSIONS,
118+
extensions __SYCL2020_DEPRECATED(
119+
"device::extensions is deprecated, use info::device::aspects"
120+
" instead.") = CL_DEVICE_EXTENSIONS,
117121
printf_buffer_size = CL_DEVICE_PRINTF_BUFFER_SIZE,
118122
preferred_interop_user_sync = CL_DEVICE_PREFERRED_INTEROP_USER_SYNC,
119123
parent_device = CL_DEVICE_PARENT_DEVICE,

sycl/test/warnings/sycl_2020_deprecations.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ int main() {
137137
auto MCA = sycl::info::device::max_constant_args;
138138
(void)MCA;
139139

140+
// expected-warning@+1{{'extensions' is deprecated: platform::extensions is deprecated, use device::get_info() with info::device::aspects instead.}}
141+
auto PE = sycl::info::platform::extensions;
142+
143+
// expected-warning@+1{{'extensions' is deprecated: device::extensions is deprecated, use info::device::aspects instead.}}
144+
auto DE = sycl::info::device::extensions;
145+
140146
// expected-warning@+4{{'ONEAPI' is deprecated: use 'ext::oneapi' instead}}
141147
// expected-warning@+3{{'atomic_fence' is deprecated: use sycl::atomic_fence instead}}
142148
// expected-warning@+2{{'ONEAPI' is deprecated: use 'ext::oneapi' instead}}

0 commit comments

Comments
 (0)