Skip to content

[SYCL] Setup deprecation warnings for device info descriptors that have been deprecated and not part SYCL 2020 #13279

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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ enum class aspect {
host,
cpu,
...
usm_system_allocator,
usm_system_allocations,
ext_intel_mem_channel
};

Expand Down
1 change: 0 additions & 1 deletion sycl/include/sycl/info/aspects_deprecated.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__SYCL_ASPECT_DEPRECATED(int64_base_atomics, 7, "use atomic64 instead")
__SYCL_ASPECT_DEPRECATED(int64_extended_atomics, 8, "use atomic64 instead")
// Special macro for aspects that don't have own token
__SYCL_ASPECT_DEPRECATED_ALIAS(usm_system_allocator, usm_system_allocations, "use usm_system_allocations instead")
__SYCL_ASPECT_DEPRECATED(usm_restricted_shared_allocations, 16, "deprecated in SYCL 2020")
__SYCL_ASPECT_DEPRECATED(host, 0, "removed in SYCL 2020, 'host' device has been removed")
6 changes: 3 additions & 3 deletions sycl/include/sycl/info/device_traits.def
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ __SYCL_PARAM_TRAITS_SPEC(device, usm_restricted_shared_allocations, bool,
PI_USM_CROSS_SHARED_SUPPORT)
__SYCL_PARAM_TRAITS_SPEC(device, usm_system_allocations, bool,
PI_USM_SYSTEM_SHARED_SUPPORT)
__SYCL_PARAM_TRAITS_SPEC(device, image_max_array_size, size_t,
PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE)
// To be dropped (no alternatives)
__SYCL_PARAM_TRAITS_SPEC(device, opencl_c_version, std::string,
PI_DEVICE_INFO_OPENCL_C_VERSION)
// To be dropped (no alternatives)
__SYCL_PARAM_TRAITS_SPEC(device, image_max_array_size, size_t,
PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE)
// Extensions
__SYCL_PARAM_TRAITS_SPEC(device, sub_group_independent_forward_progress, bool,
PI_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS)
Expand Down
3 changes: 2 additions & 1 deletion sycl/include/sycl/info/device_traits_deprecated.def
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ __SYCL_PARAM_TRAITS_DEPRECATED(printf_buffer_size,"deprecated in SYCL 2020")
__SYCL_PARAM_TRAITS_DEPRECATED(preferred_interop_user_sync,"deprecated in SYCL 2020")

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

//TODO:Remove when possible
__SYCL_PARAM_TRAITS_DEPRECATED(ext_intel_pci_address,"use ext::intel::info::device::pci_address instead")
Expand Down
8 changes: 2 additions & 6 deletions sycl/test-e2e/Regression/host_unified_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <sycl/backend.hpp>
#include <sycl/detail/core.hpp>
#include <unistd.h>

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

int main(int argc, char *argv[]) {
queue Q;
auto BE =
(bool)(Q.get_device()
.template get_info<sycl::info::device::opencl_c_version>()
.empty())
? "L0"
: "OpenCL";
auto BE = (Q.get_device().get_backend() != backend::opencl) ? "L0" : "OpenCL";
device dev = Q.get_device();
size_t max_compute_units = dev.get_info<info::device::max_compute_units>();
printf("Device: %s max_compute_units %zu, Backend: %s\n",
Expand Down
6 changes: 4 additions & 2 deletions sycl/test/warnings/sycl_2020_deprecations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ int main() {
using PBS = sycl::info::device::printf_buffer_size;
// expected-warning@+1{{'preferred_interop_user_sync' is deprecated: deprecated in SYCL 2020}}
using PIUS = sycl::info::device::preferred_interop_user_sync;
// expected-warning@+1{{'usm_system_allocator' is deprecated: use info::device::usm_system_allocations instead}}
using USA = sycl::info::device::usm_system_allocator;
// expected-warning@+1{{'image_max_array_size' is deprecated: support for image arrays has been removed in SYCL 2020}}
using IMAS = sycl::info::device::image_max_array_size;
// expected-warning@+1{{'opencl_c_version' is deprecated: use device::get_backend_info instead}}
using OCV = sycl::info::device::opencl_c_version;

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