From 4b55f8b8237382e3a25ae1cfee362b1c25d27520 Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Mon, 20 Jan 2025 18:23:59 -0800 Subject: [PATCH 1/3] [SYCL] Deprecate current implementations of get_backend_info() Signed-off-by: Hu, Peisen --- sycl/include/sycl/context.hpp | 7 +- .../include/sycl/detail/info_desc_helpers.hpp | 2 + sycl/include/sycl/device.hpp | 7 +- sycl/include/sycl/event.hpp | 7 +- .../sycl/info/device_traits_deprecated.def | 2 +- .../include/sycl/info/sycl_backend_traits.def | 2 + sycl/include/sycl/kernel.hpp | 7 +- sycl/include/sycl/platform.hpp | 7 +- sycl/include/sycl/queue.hpp | 7 +- sycl/source/detail/context_impl.cpp | 6 + sycl/source/detail/device_impl.cpp | 6 + sycl/source/detail/event_impl.cpp | 6 + sycl/source/detail/kernel_impl.cpp | 6 + sycl/source/detail/platform_impl.cpp | 6 + sycl/source/detail/queue_impl.cpp | 6 + sycl/test-e2e/Basic/backend_info.cpp | 5 +- .../warnings/deprecated_get_backend_info.cpp | 110 ++++++++++++++++++ sycl/test/warnings/sycl_2020_deprecations.cpp | 2 +- 18 files changed, 191 insertions(+), 10 deletions(-) create mode 100644 sycl/test/warnings/deprecated_get_backend_info.cpp diff --git a/sycl/include/sycl/context.hpp b/sycl/include/sycl/context.hpp index a28dc9f37b61c..90ed8e12dd619 100644 --- a/sycl/include/sycl/context.hpp +++ b/sycl/include/sycl/context.hpp @@ -177,13 +177,18 @@ class __SYCL_EXPORT context : public detail::OwnerLessBase { /// /// The return type depends on information being queried. template () +#endif #endif > + __SYCL_DEPRECATED( + "All current implementations of get_backend_info() are to be removed. " + "Use respective variants of get_info() instead.") typename detail::is_backend_info_desc::return_type - get_backend_info() const; + get_backend_info() const; context(const context &rhs) = default; diff --git a/sycl/include/sycl/detail/info_desc_helpers.hpp b/sycl/include/sycl/detail/info_desc_helpers.hpp index d281f4df4d9c8..2644c98cbb083 100644 --- a/sycl/include/sycl/detail/info_desc_helpers.hpp +++ b/sycl/include/sycl/detail/info_desc_helpers.hpp @@ -129,6 +129,7 @@ struct IsKernelInfo #include #undef __SYCL_PARAM_TRAITS_SPEC +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template constexpr int emit_get_backend_info_error() { // Implementation of get_backend_info doesn't seem to be aligned with the @@ -140,6 +141,7 @@ constexpr int emit_get_backend_info_error() { "This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0"); return 0; } +#endif } // namespace detail } // namespace _V1 diff --git a/sycl/include/sycl/device.hpp b/sycl/include/sycl/device.hpp index 9de06804fe5bd..2497abb86d249 100644 --- a/sycl/include/sycl/device.hpp +++ b/sycl/include/sycl/device.hpp @@ -222,13 +222,18 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase { /// /// The return type depends on information being queried. template () +#endif #endif > + __SYCL_DEPRECATED( + "All current implementations of get_backend_info() are to be removed. " + "Use respective variants of get_info() instead.") typename detail::is_backend_info_desc::return_type - get_backend_info() const; + get_backend_info() const; /// Check SYCL extension support by device /// diff --git a/sycl/include/sycl/event.hpp b/sycl/include/sycl/event.hpp index 2fdbe7ee96587..df0ff2e0585bc 100644 --- a/sycl/include/sycl/event.hpp +++ b/sycl/include/sycl/event.hpp @@ -112,13 +112,18 @@ class __SYCL_EXPORT event : public detail::OwnerLessBase { /// /// \return depends on information being queried. template () +#endif #endif > + __SYCL_DEPRECATED( + "All current implementations of get_backend_info() are to be removed. " + "Use respective variants of get_info() instead.") typename detail::is_backend_info_desc::return_type - get_backend_info() const; + get_backend_info() const; /// Queries this SYCL event for profiling information. /// diff --git a/sycl/include/sycl/info/device_traits_deprecated.def b/sycl/include/sycl/info/device_traits_deprecated.def index 52be28cb9f05c..7dc67dc8c905d 100644 --- a/sycl/include/sycl/info/device_traits_deprecated.def +++ b/sycl/include/sycl/info/device_traits_deprecated.def @@ -1,6 +1,6 @@ // Deprecated and not part of SYCL 2020 spec __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") +__SYCL_PARAM_TRAITS_DEPRECATED(opencl_c_version,"use device::get_info instead") __SYCL_PARAM_TRAITS_DEPRECATED(atomic64, "use sycl::aspect::atomic64 instead") //TODO:Remove when possible diff --git a/sycl/include/sycl/info/sycl_backend_traits.def b/sycl/include/sycl/info/sycl_backend_traits.def index b919a26d19282..cd860e46495e0 100644 --- a/sycl/include/sycl/info/sycl_backend_traits.def +++ b/sycl/include/sycl/info/sycl_backend_traits.def @@ -1,3 +1,5 @@ +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_PARAM_TRAITS_SPEC(platform, version, std::string, PI_PLATFORM_INFO_VERSION) __SYCL_PARAM_TRAITS_SPEC(device, version, std::string, PI_DEVICE_INFO_VERSION) __SYCL_PARAM_TRAITS_SPEC(device, backend_version, std::string, PI_DEVICE_INFO_BACKEND_VERSION) +#endif diff --git a/sycl/include/sycl/kernel.hpp b/sycl/include/sycl/kernel.hpp index e4eb9fe1a9374..e81d24d3afe5a 100644 --- a/sycl/include/sycl/kernel.hpp +++ b/sycl/include/sycl/kernel.hpp @@ -132,13 +132,18 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase { /// /// The return type depends on information being queried. template () +#endif #endif > + __SYCL_DEPRECATED( + "All current implementations of get_backend_info() are to be removed. " + "Use respective variants of get_info() instead.") typename detail::is_backend_info_desc::return_type - get_backend_info() const; + get_backend_info() const; /// Query device-specific information from the kernel object using the /// info::kernel_device_specific descriptor. diff --git a/sycl/include/sycl/platform.hpp b/sycl/include/sycl/platform.hpp index 4f7df0c2362a7..9f8553682cbef 100644 --- a/sycl/include/sycl/platform.hpp +++ b/sycl/include/sycl/platform.hpp @@ -150,13 +150,18 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase { /// /// The return type depends on information being queried. template () +#endif #endif > + __SYCL_DEPRECATED( + "All current implementations of get_backend_info() are to be removed. " + "Use respective variants of get_info() instead.") typename detail::is_backend_info_desc::return_type - get_backend_info() const; + get_backend_info() const; /// Returns all available SYCL platforms in the system. /// diff --git a/sycl/include/sycl/queue.hpp b/sycl/include/sycl/queue.hpp index e2208d452d100..e60484368ac45 100644 --- a/sycl/include/sycl/queue.hpp +++ b/sycl/include/sycl/queue.hpp @@ -351,13 +351,18 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase { /// /// The return type depends on information being queried. template () +#endif #endif > + __SYCL_DEPRECATED( + "All current implementations of get_backend_info() are to be removed. " + "Use respective variants of get_info() instead.") typename detail::is_backend_info_desc::return_type - get_backend_info() const; + get_backend_info() const; private: // A shorthand for `get_device().has()' which is expected to be a bit quicker diff --git a/sycl/source/detail/context_impl.cpp b/sycl/source/detail/context_impl.cpp index 0dcddfa24d8e2..e527d0a0c46a8 100644 --- a/sycl/source/detail/context_impl.cpp +++ b/sycl/source/detail/context_impl.cpp @@ -224,6 +224,7 @@ context_impl::get_info() const { return CapabilityList; } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::platform::version::return_type context_impl::get_backend_info() const { @@ -234,10 +235,12 @@ context_impl::get_backend_info() const { } return MDevices[0].get_platform().get_info(); } +#endif device select_device(DSelectorInvocableType DeviceSelectorInvocable, std::vector &Devices); +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::version::return_type context_impl::get_backend_info() const { @@ -254,7 +257,9 @@ context_impl::get_backend_info() const { return select_device(default_selector_v, Devices) .get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::backend_version::return_type context_impl::get_backend_info() const { @@ -268,6 +273,7 @@ context_impl::get_backend_info() const { // information descriptor and implementations are encouraged to return the // empty string as per specification. } +#endif ur_context_handle_t &context_impl::getHandleRef() { return MContext; } const ur_context_handle_t &context_impl::getHandleRef() const { diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index 818ed193300f2..3d820f2c782cd 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -131,6 +131,7 @@ typename Param::return_type device_impl::get_info() const { #include #undef __SYCL_PARAM_TRAITS_SPEC +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::platform::version::return_type device_impl::get_backend_info() const { @@ -141,7 +142,9 @@ device_impl::get_backend_info() const { } return get_platform().get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::version::return_type device_impl::get_backend_info() const { @@ -152,7 +155,9 @@ device_impl::get_backend_info() const { } return get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::backend_version::return_type device_impl::get_backend_info() const { @@ -166,6 +171,7 @@ device_impl::get_backend_info() const { // information descriptor and implementations are encouraged to return the // empty string as per specification. } +#endif bool device_impl::has_extension(const std::string &ExtensionName) const { std::string AllExtensionNames = diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp index f6e5edfc92e74..520b4de1ae888 100644 --- a/sycl/source/detail/event_impl.cpp +++ b/sycl/source/detail/event_impl.cpp @@ -418,6 +418,7 @@ event_impl::get_info() { : info::event_command_status::complete; } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::platform::version::return_type event_impl::get_backend_info() const { @@ -438,7 +439,9 @@ event_impl::get_backend_info() const { // so return empty string. return ""; } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::version::return_type event_impl::get_backend_info() const { @@ -456,7 +459,9 @@ event_impl::get_backend_info() const { return ""; // If the queue has been released, no device will be associated so // return empty string } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::backend_version::return_type event_impl::get_backend_info() const { @@ -473,6 +478,7 @@ event_impl::get_backend_info() const { // information descriptor and implementations are encouraged to return the // empty string as per specification. } +#endif void HostProfilingInfo::start() { StartTime = getTimestamp(); } diff --git a/sycl/source/detail/kernel_impl.cpp b/sycl/source/detail/kernel_impl.cpp index f89ef979f7c9e..3bbff52ae4f2b 100644 --- a/sycl/source/detail/kernel_impl.cpp +++ b/sycl/source/detail/kernel_impl.cpp @@ -106,6 +106,7 @@ void kernel_impl::checkIfValidForNumArgsInfoQuery() const { "interoperability function or to query a device built-in kernel"); } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::platform::version::return_type kernel_impl::get_backend_info() const { @@ -117,10 +118,12 @@ kernel_impl::get_backend_info() const { auto Devices = MKernelBundleImpl->get_devices(); return Devices[0].get_platform().get_info(); } +#endif device select_device(DSelectorInvocableType DeviceSelectorInvocable, std::vector &Devices); +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::version::return_type kernel_impl::get_backend_info() const { @@ -137,7 +140,9 @@ kernel_impl::get_backend_info() const { return select_device(default_selector_v, Devices) .get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::backend_version::return_type kernel_impl::get_backend_info() const { @@ -151,6 +156,7 @@ kernel_impl::get_backend_info() const { // information descriptor and implementations are encouraged to return the // empty string as per specification. } +#endif } // namespace detail } // namespace _V1 diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index cb9a9f0f1b97f..b27b95c1f1938 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -572,6 +572,7 @@ typename Param::return_type platform_impl::get_info() const { return get_platform_info(this->getHandleRef(), getAdapter()); } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::platform::version::return_type platform_impl::get_backend_info() const { @@ -582,10 +583,12 @@ platform_impl::get_backend_info() const { } return get_info(); } +#endif device select_device(DSelectorInvocableType DeviceSelectorInvocable, std::vector &Devices); +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::version::return_type platform_impl::get_backend_info() const { @@ -602,7 +605,9 @@ platform_impl::get_backend_info() const { return select_device(default_selector_v, Devices) .get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::backend_version::return_type platform_impl::get_backend_info() const { @@ -616,6 +621,7 @@ platform_impl::get_backend_info() const { // information descriptor and implementations are encouraged to return the // empty string as per specification. } +#endif // All devices on the platform must have the given aspect. bool platform_impl::has(aspect Aspect) const { diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index 8e82cc0f3082d..495c96d6b4f48 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -73,6 +73,7 @@ template <> device queue_impl::get_info() const { return get_device(); } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::platform::version::return_type queue_impl::get_backend_info() const { @@ -83,7 +84,9 @@ queue_impl::get_backend_info() const { } return get_device().get_platform().get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::version::return_type queue_impl::get_backend_info() const { @@ -94,7 +97,9 @@ queue_impl::get_backend_info() const { } return get_device().get_info(); } +#endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> typename info::device::backend_version::return_type queue_impl::get_backend_info() const { @@ -108,6 +113,7 @@ queue_impl::get_backend_info() const { // information descriptor and implementations are encouraged to return the // empty string as per specification. } +#endif static event prepareSYCLEventAssociatedWithQueue( const std::shared_ptr &QueueImpl) { diff --git a/sycl/test-e2e/Basic/backend_info.cpp b/sycl/test-e2e/Basic/backend_info.cpp index d5fa958f45b18..3607f89f1c04e 100644 --- a/sycl/test-e2e/Basic/backend_info.cpp +++ b/sycl/test-e2e/Basic/backend_info.cpp @@ -1,7 +1,8 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -o %t.out -Wno-deprecated-declarations // RUN: %{run} %t.out // -// RUN: %{build} -DTEST_ERRORS -D_GLIBCXX_USE_CXX11_ABI=0 -fsyntax-only -Wno-error=unused-command-line-argument -Xclang -verify -Xclang -verify-ignore-unexpected=note + +// RUN: %{build} -DTEST_ERRORS -D_GLIBCXX_USE_CXX11_ABI=0 -fsyntax-only -Wno-deprecated-declarations -Wno-error=unused-command-line-argument -Xclang -verify -Xclang -verify-ignore-unexpected=note //==--- backend_info.cpp - SYCL backend info test---------------------------==// // diff --git a/sycl/test/warnings/deprecated_get_backend_info.cpp b/sycl/test/warnings/deprecated_get_backend_info.cpp new file mode 100644 index 0000000000000..e6054f21220bb --- /dev/null +++ b/sycl/test/warnings/deprecated_get_backend_info.cpp @@ -0,0 +1,110 @@ +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +#include +#include +#include + +using namespace sycl; + +int main() { + try { + // Test get_backend_info for sycl::platform + std::vector platform_list = platform::get_platforms(); + for (const auto &platform : platform_list) { + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend device version: " + << platform.get_backend_info() + << std::endl; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend platform version: " + << platform.get_backend_info() + << std::endl; + } + + // Test get_backend_info for sycl::device + std::vector device_list = + device::get_devices(info::device_type::gpu); + for (const auto &device : device_list) { + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend device version: " + << device.get_backend_info() + << std::endl; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend platform version: " + << device.get_backend_info() + << std::endl; + } + + // Test get_backend_info for sycl::queue + queue q; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend device version: " + << q.get_backend_info() << std::endl; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend platform version: " + << q.get_backend_info() << std::endl; + + // Test get_backend_info for sycl::context + context Ctx = q.get_context(); + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend device version: " + << Ctx.get_backend_info() << std::endl; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend platform version: " + << Ctx.get_backend_info() << std::endl; + + // Test get_backend_info for sycl::event + event e = q.single_task([=]() { return; }); + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend device version: " + << e.get_backend_info() << std::endl; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend platform version: " + << e.get_backend_info() << std::endl; + + // Test get_backend_info for sycl::kernel + // Trivial kernel simply for testing + buffer buf(range<1>(1)); + auto KernelID = sycl::get_kernel_id(); + auto KB = get_kernel_bundle(q.get_context(), + {KernelID}); + kernel krn = KB.get_kernel(KernelID); + q.submit([&](handler &cgh) { + auto acc = buf.get_access(cgh); + cgh.single_task(krn, [=]() { acc[0] = acc[0] + 1; }); + }); + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend device version: " + << krn.get_backend_info() << std::endl; + // expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + // expected-warning@+2 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}} + std::cout << " Backend platform version: " + << krn.get_backend_info() << std::endl; + } catch (exception e) { + // Check if the error code is the only allowed one: errc::backend_mismatch + assert(e.code() == sycl::errc::backend_mismatch && "wrong error code"); + // If so, check if there're truly non-OpenCL backend(s) or it's an + // unexpected error + std::vector platform_list = platform::get_platforms(); + bool has_non_opencl_backend = false; + for (const auto &platform : platform_list) { + if (platform.get_backend() != backend::opencl) { + has_non_opencl_backend = true; + break; + } + } + assert(has_non_opencl_backend && "unexpected error code"); + } + std::cout << " Backend info query tests passed" << std::endl; + return 0; +} diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index 4614707606830..6fd61a0a1137e 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -137,7 +137,7 @@ int main() { using PIUS = sycl::info::device::preferred_interop_user_sync; // 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}} + // expected-warning@+1{{'opencl_c_version' is deprecated: use device::get_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}} From 1b4709dd45ec6f83abb7fdc6573fbaf788556b14 Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Tue, 21 Jan 2025 07:37:45 -0800 Subject: [PATCH 2/3] [SYCL] Revise deprecated_get_backend_info.cpp Signed-off-by: Hu, Peisen --- sycl/test/warnings/deprecated_get_backend_info.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sycl/test/warnings/deprecated_get_backend_info.cpp b/sycl/test/warnings/deprecated_get_backend_info.cpp index e6054f21220bb..e78d245bd3045 100644 --- a/sycl/test/warnings/deprecated_get_backend_info.cpp +++ b/sycl/test/warnings/deprecated_get_backend_info.cpp @@ -6,6 +6,8 @@ using namespace sycl; int main() { +#if (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI != 0) || \ + !defined(_GLIBCXX_USE_CXX11_ABI) || TEST_ERRORS try { // Test get_backend_info for sycl::platform std::vector platform_list = platform::get_platforms(); @@ -105,6 +107,8 @@ int main() { } assert(has_non_opencl_backend && "unexpected error code"); } - std::cout << " Backend info query tests passed" << std::endl; + std::cout << " Deprecation warning tests for get_backend_info() passed" + << std::endl; +#endif return 0; } From 4fddf7b3d1e98fcb33babddd8077caeb7224e0d2 Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Wed, 22 Jan 2025 14:35:03 -0800 Subject: [PATCH 3/3] [SYCL] Remove deprecation warnings under __INTEL_PREVIEW_BREAKING_CHANGES flag Signed-off-by: Hu, Peisen --- sycl/include/sycl/context.hpp | 2 ++ sycl/include/sycl/device.hpp | 2 ++ sycl/include/sycl/event.hpp | 2 ++ sycl/include/sycl/kernel.hpp | 2 ++ sycl/include/sycl/platform.hpp | 2 ++ sycl/include/sycl/queue.hpp | 2 ++ 6 files changed, 12 insertions(+) diff --git a/sycl/include/sycl/context.hpp b/sycl/include/sycl/context.hpp index 90ed8e12dd619..67d50bcf7c8e2 100644 --- a/sycl/include/sycl/context.hpp +++ b/sycl/include/sycl/context.hpp @@ -184,9 +184,11 @@ class __SYCL_EXPORT context : public detail::OwnerLessBase { #endif #endif > +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED( "All current implementations of get_backend_info() are to be removed. " "Use respective variants of get_info() instead.") +#endif typename detail::is_backend_info_desc::return_type get_backend_info() const; diff --git a/sycl/include/sycl/device.hpp b/sycl/include/sycl/device.hpp index 2497abb86d249..c888d46490749 100644 --- a/sycl/include/sycl/device.hpp +++ b/sycl/include/sycl/device.hpp @@ -229,9 +229,11 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase { #endif #endif > +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED( "All current implementations of get_backend_info() are to be removed. " "Use respective variants of get_info() instead.") +#endif typename detail::is_backend_info_desc::return_type get_backend_info() const; diff --git a/sycl/include/sycl/event.hpp b/sycl/include/sycl/event.hpp index df0ff2e0585bc..5313806efc545 100644 --- a/sycl/include/sycl/event.hpp +++ b/sycl/include/sycl/event.hpp @@ -119,9 +119,11 @@ class __SYCL_EXPORT event : public detail::OwnerLessBase { #endif #endif > +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED( "All current implementations of get_backend_info() are to be removed. " "Use respective variants of get_info() instead.") +#endif typename detail::is_backend_info_desc::return_type get_backend_info() const; diff --git a/sycl/include/sycl/kernel.hpp b/sycl/include/sycl/kernel.hpp index e81d24d3afe5a..550c56d2319dc 100644 --- a/sycl/include/sycl/kernel.hpp +++ b/sycl/include/sycl/kernel.hpp @@ -139,9 +139,11 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase { #endif #endif > +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED( "All current implementations of get_backend_info() are to be removed. " "Use respective variants of get_info() instead.") +#endif typename detail::is_backend_info_desc::return_type get_backend_info() const; diff --git a/sycl/include/sycl/platform.hpp b/sycl/include/sycl/platform.hpp index 9f8553682cbef..af259afe8050e 100644 --- a/sycl/include/sycl/platform.hpp +++ b/sycl/include/sycl/platform.hpp @@ -157,9 +157,11 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase { #endif #endif > +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED( "All current implementations of get_backend_info() are to be removed. " "Use respective variants of get_info() instead.") +#endif typename detail::is_backend_info_desc::return_type get_backend_info() const; diff --git a/sycl/include/sycl/queue.hpp b/sycl/include/sycl/queue.hpp index e60484368ac45..7f486d75d38b1 100644 --- a/sycl/include/sycl/queue.hpp +++ b/sycl/include/sycl/queue.hpp @@ -358,9 +358,11 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase { #endif #endif > +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED( "All current implementations of get_backend_info() are to be removed. " "Use respective variants of get_info() instead.") +#endif typename detail::is_backend_info_desc::return_type get_backend_info() const;