Skip to content

Commit 3f841ff

Browse files
authored
[SYCL] Deprecate legacy information descriptors (#13279)
As mentioned in the CTS pull request KhronosGroup/SYCL-CTS#870, two device info descriptors, namely `info::device::image_max_array_size` and `info::device::opencl_c_version`, have been deprecated and no longer exist in the SYCL 2020 specification. But they still exist in our implementation, so I'm setting up deprecation warnings for them. Also a related test case has been revised to remove the usage of `info::device::opencl_c_version`. Also `info::device::usm_system_allocator` has been replaced and marked as deprecated 2+ years ago in PR #4007 and #9217 respectively. So I'm cleaning up a few relevant code pieces in our code as well in this PR. --------- Signed-off-by: Hu, Peisen <[email protected]>
1 parent a2be420 commit 3f841ff

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

sycl/doc/extensions/supported/sycl_ext_intel_mem_channel_property.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ enum class aspect {
9696
host,
9797
cpu,
9898
...
99-
usm_system_allocator,
99+
usm_system_allocations,
100100
ext_intel_mem_channel
101101
};
102102

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
__SYCL_ASPECT_DEPRECATED(int64_base_atomics, 7, "use atomic64 instead")
22
__SYCL_ASPECT_DEPRECATED(int64_extended_atomics, 8, "use atomic64 instead")
33
// Special macro for aspects that don't have own token
4-
__SYCL_ASPECT_DEPRECATED_ALIAS(usm_system_allocator, usm_system_allocations, "use usm_system_allocations instead")
54
__SYCL_ASPECT_DEPRECATED(usm_restricted_shared_allocations, 16, "deprecated in SYCL 2020")
65
__SYCL_ASPECT_DEPRECATED(host, 0, "removed in SYCL 2020, 'host' device has been removed")

sycl/include/sycl/info/device_traits.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ __SYCL_PARAM_TRAITS_SPEC(device, usm_restricted_shared_allocations, bool,
190190
PI_USM_CROSS_SHARED_SUPPORT)
191191
__SYCL_PARAM_TRAITS_SPEC(device, usm_system_allocations, bool,
192192
PI_USM_SYSTEM_SHARED_SUPPORT)
193-
__SYCL_PARAM_TRAITS_SPEC(device, image_max_array_size, size_t,
194-
PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE)
195-
// To be dropped (no alternatives)
196193
__SYCL_PARAM_TRAITS_SPEC(device, opencl_c_version, std::string,
197194
PI_DEVICE_INFO_OPENCL_C_VERSION)
195+
// To be dropped (no alternatives)
196+
__SYCL_PARAM_TRAITS_SPEC(device, image_max_array_size, size_t,
197+
PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE)
198198
// Extensions
199199
__SYCL_PARAM_TRAITS_SPEC(device, sub_group_independent_forward_progress, bool,
200200
PI_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS)

sycl/include/sycl/info/device_traits_deprecated.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ __SYCL_PARAM_TRAITS_DEPRECATED(printf_buffer_size,"deprecated in SYCL 2020")
1717
__SYCL_PARAM_TRAITS_DEPRECATED(preferred_interop_user_sync,"deprecated in SYCL 2020")
1818

1919
// Deprecated and not part of SYCL 2020 spec
20-
__SYCL_PARAM_TRAITS_DEPRECATED(usm_system_allocator,"use info::device::usm_system_allocations instead")
20+
__SYCL_PARAM_TRAITS_DEPRECATED(image_max_array_size,"support for image arrays has been removed in SYCL 2020")
21+
__SYCL_PARAM_TRAITS_DEPRECATED(opencl_c_version,"use device::get_backend_info instead")
2122

2223
//TODO:Remove when possible
2324
__SYCL_PARAM_TRAITS_DEPRECATED(ext_intel_pci_address,"use ext::intel::info::device::pci_address instead")

sycl/test-e2e/Regression/host_unified_memory.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <stdio.h>
66
#include <stdlib.h>
7+
#include <sycl/backend.hpp>
78
#include <sycl/detail/core.hpp>
89
#include <unistd.h>
910

@@ -13,12 +14,7 @@ static buffer<char, 1> *inBufP = nullptr;
1314

1415
int main(int argc, char *argv[]) {
1516
queue Q;
16-
auto BE =
17-
(bool)(Q.get_device()
18-
.template get_info<sycl::info::device::opencl_c_version>()
19-
.empty())
20-
? "L0"
21-
: "OpenCL";
17+
auto BE = (Q.get_device().get_backend() != backend::opencl) ? "L0" : "OpenCL";
2218
device dev = Q.get_device();
2319
size_t max_compute_units = dev.get_info<info::device::max_compute_units>();
2420
printf("Device: %s max_compute_units %zu, Backend: %s\n",

sycl/test/warnings/sycl_2020_deprecations.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ int main() {
165165
using PBS = sycl::info::device::printf_buffer_size;
166166
// expected-warning@+1{{'preferred_interop_user_sync' is deprecated: deprecated in SYCL 2020}}
167167
using PIUS = sycl::info::device::preferred_interop_user_sync;
168-
// expected-warning@+1{{'usm_system_allocator' is deprecated: use info::device::usm_system_allocations instead}}
169-
using USA = sycl::info::device::usm_system_allocator;
168+
// expected-warning@+1{{'image_max_array_size' is deprecated: support for image arrays has been removed in SYCL 2020}}
169+
using IMAS = sycl::info::device::image_max_array_size;
170+
// expected-warning@+1{{'opencl_c_version' is deprecated: use device::get_backend_info instead}}
171+
using OCV = sycl::info::device::opencl_c_version;
170172

171173
// expected-warning@+1{{'extensions' is deprecated: deprecated in SYCL 2020, use device::get_info() with info::device::aspects instead}}
172174
using PE = sycl::info::platform::extensions;

0 commit comments

Comments
 (0)