Skip to content

Commit e4d1c8c

Browse files
againullluszczewskakasia1
authored andcommitted
[SYCL] Remove deprecated get_backend_info entry points (intel#20676)
This was implemented in intel#12906 and deprecated in intel#16700. See the latter for reasoning.
1 parent 052de1c commit e4d1c8c

39 files changed

+12
-752
lines changed

sycl/include/sycl/context.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,9 @@ class __SYCL_EXPORT context : public detail::OwnerLessBase<context> {
180180
/// Queries this SYCL context for SYCL backend-specific information.
181181
///
182182
/// The return type depends on information being queried.
183-
template <typename Param
184-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
185-
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
186-
,
187-
int = detail::emit_get_backend_info_error<context, Param>()
188-
#endif
189-
#endif
190-
>
191-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
192-
__SYCL_DEPRECATED(
193-
"All current implementations of get_backend_info() are to be removed. "
194-
"Use respective variants of get_info() instead.")
195-
#endif
183+
template <typename Param>
196184
typename detail::is_backend_info_desc<Param>::return_type
197-
get_backend_info() const;
185+
get_backend_info() const;
198186

199187
context(const context &rhs) = default;
200188

sycl/include/sycl/detail/info_desc_helpers.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,28 +123,6 @@ template <typename T> struct is_backend_info_desc : std::false_type {};
123123
#undef __SYCL_PARAM_TRAITS_SPEC
124124
#undef __SYCL_PARAM_TRAITS_TEMPLATE_PARTIAL_SPEC
125125

126-
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
127-
template <> \
128-
struct is_backend_info_desc<info::DescType::Desc> : std::true_type { \
129-
using return_type = info::DescType::Desc::return_type; \
130-
};
131-
#include <sycl/info/sycl_backend_traits.def>
132-
#undef __SYCL_PARAM_TRAITS_SPEC
133-
134-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
135-
template <typename SyclObject, typename Param>
136-
constexpr int emit_get_backend_info_error() {
137-
// Implementation of get_backend_info doesn't seem to be aligned with the
138-
// spec and is likely going to be deprecated/removed. However, in pre-C++11
139-
// ABI mode if result in ABI mismatch and causes crashes, so emit
140-
// compile-time error under those conditions.
141-
constexpr bool False = !std::is_same_v<Param, Param>;
142-
static_assert(False,
143-
"This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0");
144-
return 0;
145-
}
146-
#endif
147-
148126
} // namespace detail
149127
} // namespace _V1
150128
} // namespace sycl

sycl/include/sycl/device.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -218,21 +218,9 @@ class __SYCL_STANDALONE_DEBUG __SYCL_EXPORT device
218218
/// Queries this SYCL device for SYCL backend-specific information.
219219
///
220220
/// The return type depends on information being queried.
221-
template <typename Param
222-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
223-
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
224-
,
225-
int = detail::emit_get_backend_info_error<device, Param>()
226-
#endif
227-
#endif
228-
>
229-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
230-
__SYCL_DEPRECATED(
231-
"All current implementations of get_backend_info() are to be removed. "
232-
"Use respective variants of get_info() instead.")
233-
#endif
221+
template <typename Param>
234222
typename detail::is_backend_info_desc<Param>::return_type
235-
get_backend_info() const;
223+
get_backend_info() const;
236224

237225
/// Check SYCL extension support by device
238226
///

sycl/include/sycl/event.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,9 @@ class __SYCL_EXPORT event : public detail::OwnerLessBase<event> {
111111
/// Queries this SYCL event for SYCL backend-specific information.
112112
///
113113
/// \return depends on information being queried.
114-
template <typename Param
115-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
116-
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
117-
,
118-
int = detail::emit_get_backend_info_error<event, Param>()
119-
#endif
120-
#endif
121-
>
122-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
123-
__SYCL_DEPRECATED(
124-
"All current implementations of get_backend_info() are to be removed. "
125-
"Use respective variants of get_info() instead.")
126-
#endif
114+
template <typename Param>
127115
typename detail::is_backend_info_desc<Param>::return_type
128-
get_backend_info() const;
116+
get_backend_info() const;
129117

130118
/// Queries this SYCL event for profiling information.
131119
///

sycl/include/sycl/info/sycl_backend_traits.def

Lines changed: 0 additions & 5 deletions
This file was deleted.

sycl/include/sycl/kernel.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,9 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase<kernel> {
131131
/// Queries the kernel object for SYCL backend-specific information.
132132
///
133133
/// The return type depends on information being queried.
134-
template <typename Param
135-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
136-
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
137-
,
138-
int = detail::emit_get_backend_info_error<kernel, Param>()
139-
#endif
140-
#endif
141-
>
142-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
143-
__SYCL_DEPRECATED(
144-
"All current implementations of get_backend_info() are to be removed. "
145-
"Use respective variants of get_info() instead.")
146-
#endif
134+
template <typename Param>
147135
typename detail::is_backend_info_desc<Param>::return_type
148-
get_backend_info() const;
136+
get_backend_info() const;
149137

150138
/// Query device-specific information from the kernel object using the
151139
/// info::kernel_device_specific descriptor.

sycl/include/sycl/platform.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,9 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase<platform> {
149149
/// Queries this SYCL platform for SYCL backend-specific info.
150150
///
151151
/// The return type depends on information being queried.
152-
template <typename Param
153-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
154-
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
155-
,
156-
int = detail::emit_get_backend_info_error<platform, Param>()
157-
#endif
158-
#endif
159-
>
160-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
161-
__SYCL_DEPRECATED(
162-
"All current implementations of get_backend_info() are to be removed. "
163-
"Use respective variants of get_info() instead.")
164-
#endif
152+
template <typename Param>
165153
typename detail::is_backend_info_desc<Param>::return_type
166-
get_backend_info() const;
154+
get_backend_info() const;
167155

168156
/// Returns all available SYCL platforms in the system.
169157
///

sycl/include/sycl/queue.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -536,21 +536,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
536536
/// Queries SYCL queue for SYCL backend-specific information.
537537
///
538538
/// The return type depends on information being queried.
539-
template <typename Param
540-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
541-
#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0
542-
,
543-
int = detail::emit_get_backend_info_error<queue, Param>()
544-
#endif
545-
#endif
546-
>
547-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
548-
__SYCL_DEPRECATED(
549-
"All current implementations of get_backend_info() are to be removed. "
550-
"Use respective variants of get_info() instead.")
551-
#endif
539+
template <typename Param>
552540
typename detail::is_backend_info_desc<Param>::return_type
553-
get_backend_info() const;
541+
get_backend_info() const;
554542

555543
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
556544
private:

sycl/source/context.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ context::get_backend_info() const {
104104
return impl->get_backend_info<Param>();
105105
}
106106

107-
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, Picode) \
108-
template __SYCL_EXPORT ReturnT \
109-
context::get_backend_info<info::DescType::Desc>() const;
110-
111-
#include <sycl/info/sycl_backend_traits.def>
112-
113-
#undef __SYCL_PARAM_TRAITS_SPEC
114-
115107
cl_context context::get() const { return impl->get(); }
116108

117109
backend context::get_backend() const noexcept { return impl->getBackend(); }

sycl/source/detail/context_impl.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -212,57 +212,9 @@ context_impl::get_info<info::context::atomic_fence_scope_capabilities>() const {
212212
return CapabilityList;
213213
}
214214

215-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
216-
template <>
217-
typename info::platform::version::return_type
218-
context_impl::get_backend_info<info::platform::version>() const {
219-
if (getBackend() != backend::opencl) {
220-
throw sycl::exception(errc::backend_mismatch,
221-
"the info::platform::version info descriptor can "
222-
"only be queried with an OpenCL backend");
223-
}
224-
return MDevices[0]->get_platform().get_info<info::platform::version>();
225-
}
226-
#endif
227-
228215
device select_device(DSelectorInvocableType DeviceSelectorInvocable,
229216
std::vector<device> &Devices);
230217

231-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
232-
template <>
233-
typename info::device::version::return_type
234-
context_impl::get_backend_info<info::device::version>() const {
235-
if (getBackend() != backend::opencl) {
236-
throw sycl::exception(errc::backend_mismatch,
237-
"the info::device::version info descriptor can only "
238-
"be queried with an OpenCL backend");
239-
}
240-
auto Devices = get_info<info::context::devices>();
241-
if (Devices.empty()) {
242-
return "No available device";
243-
}
244-
// Use default selector to pick a device.
245-
return select_device(default_selector_v, Devices)
246-
.get_info<info::device::version>();
247-
}
248-
#endif
249-
250-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
251-
template <>
252-
typename info::device::backend_version::return_type
253-
context_impl::get_backend_info<info::device::backend_version>() const {
254-
if (getBackend() != backend::ext_oneapi_level_zero) {
255-
throw sycl::exception(errc::backend_mismatch,
256-
"the info::device::backend_version info descriptor "
257-
"can only be queried with a Level Zero backend");
258-
}
259-
return "";
260-
// Currently The Level Zero backend does not define the value of this
261-
// information descriptor and implementations are encouraged to return the
262-
// empty string as per specification.
263-
}
264-
#endif
265-
266218
device_impl *
267219
context_impl::findMatchingDeviceImpl(ur_device_handle_t &DeviceUR) const {
268220
for (device_impl *D : MDevices)

0 commit comments

Comments
 (0)