Skip to content

Commit af40a52

Browse files
[SYCL][ABI-break] Cleanup ABI entries (#20846)
Remove unused ABI entries and implement couple of TODOs: * Renamed `getOrInsertHandlerKernelBundlePtr` to `getOrInsertHandlerKernelBundle` * Employed inline namespace for `SubmissionInfo` Co-authored-by: Steffen Larsen <steffen.larsen@intel.com>
1 parent d07a151 commit af40a52

19 files changed

+48
-211
lines changed

sycl/include/sycl/backend.hpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,10 @@ __SYCL_EXPORT event make_event(ur_native_handle_t NativeHandle,
272272
__SYCL_EXPORT event make_event(ur_native_handle_t NativeHandle,
273273
const context &TargetContext, bool KeepOwnership,
274274
backend Backend);
275-
// TODO: Unused. Remove when allowed.
276-
__SYCL_EXPORT kernel make_kernel(ur_native_handle_t NativeHandle,
277-
const context &TargetContext, backend Backend);
278275
__SYCL_EXPORT kernel make_kernel(
279276
const context &TargetContext,
280277
const kernel_bundle<bundle_state::executable> &KernelBundle,
281278
ur_native_handle_t NativeKernelHandle, bool KeepOwnership, backend Backend);
282-
// TODO: Unused. Remove when allowed.
283-
__SYCL_EXPORT std::shared_ptr<detail::kernel_bundle_impl>
284-
make_kernel_bundle(ur_native_handle_t NativeHandle,
285-
const context &TargetContext, bundle_state State,
286-
backend Backend);
287279
__SYCL_EXPORT std::shared_ptr<detail::kernel_bundle_impl>
288280
make_kernel_bundle(ur_native_handle_t NativeHandle,
289281
const context &TargetContext, bool KeepOwnership,
@@ -403,8 +395,10 @@ make_kernel(const typename backend_traits<Backend>::template input_type<kernel>
403395
&BackendObject,
404396
const context &TargetContext) {
405397
return detail::make_kernel(
406-
detail::ur::cast<ur_native_handle_t>(BackendObject), TargetContext,
407-
Backend);
398+
TargetContext,
399+
detail::get_empty_interop_kernel_bundle<bundle_state::executable>(
400+
TargetContext),
401+
detail::ur::cast<ur_native_handle_t>(BackendObject), false, Backend);
408402
}
409403

410404
template <backend Backend, bundle_state State>

sycl/include/sycl/detail/ur.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ __SYCL_EXPORT void contextSetExtendedDeleter(const sycl::context &constext,
102102
void *user_data);
103103
}
104104

105-
// TODO: To be removed as this was only introduced for esimd which was removed.
106-
template <sycl::backend BE>
107-
__SYCL_EXPORT void *getPluginOpaqueData(void *opaquedata_arg);
108-
109105
namespace ur {
110106
// Function to load a shared library
111107
// Implementation is OS dependent

sycl/include/sycl/ext/oneapi/bfloat16.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ namespace ext::oneapi {
2121

2222
class bfloat16 {
2323
public:
24-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
25-
using Bfloat16StorageT
26-
__SYCL_DEPRECATED("bfloat16::Bfloat16StorageT is non-standard and has "
27-
"been deprecated.") = uint16_t;
28-
#endif
29-
3024
bfloat16() = default;
3125
~bfloat16() = default;
3226
constexpr bfloat16(const bfloat16 &) = default;

sycl/include/sycl/handler.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ class __SYCL_EXPORT handler {
777777
// If the kernel lambda is callable with a kernel_handler argument, manifest
778778
// the associated kernel handler.
779779
if constexpr (IsCallableWithKernelHandler) {
780-
getOrInsertHandlerKernelBundlePtr(/*Insert=*/true);
780+
getOrInsertHandlerKernelBundle(/*Insert=*/true);
781781
}
782782
}
783783

@@ -1237,11 +1237,7 @@ class __SYCL_EXPORT handler {
12371237
void setStateSpecConstSet();
12381238
bool isStateExplicitKernelBundle() const;
12391239

1240-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1241-
// Rename to just getOrInsertHandlerKernelBundle
1242-
#endif
1243-
detail::kernel_bundle_impl *
1244-
getOrInsertHandlerKernelBundlePtr(bool Insert) const;
1240+
detail::kernel_bundle_impl *getOrInsertHandlerKernelBundle(bool Insert) const;
12451241

12461242
void setHandlerKernelBundle(kernel Kernel);
12471243

sycl/include/sycl/kernel_bundle.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,8 @@ class __SYCL_EXPORT device_image_plain {
115115

116116
bool has_kernel(const kernel_id &KernelID, const device &Dev) const noexcept;
117117

118-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
119-
ur_native_handle_t getNative() const;
120-
#endif
121118
protected:
122-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
123119
ur_native_handle_t getNative() const;
124-
#endif
125120

126121
std::shared_ptr<device_image_impl> impl;
127122

sycl/include/sycl/queue.hpp

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void __SYCL_EXPORT submit_graph_direct_without_event_impl(
9898
namespace detail {
9999
class queue_impl;
100100

101-
namespace v1 {
101+
inline namespace _V1 {
102102

103103
// This class is a part of the ABI, so it's moved to a separate namespace to
104104
// simplify changes.
@@ -110,9 +110,6 @@ namespace v1 {
110110
// overloaded with a new variant using v(N+1) namespace,
111111
// * old namespace vN should be moved under #ifndef
112112
// __INTEL_PREVIEW_BREAKING_CHANGES guard.
113-
// TODO: inline namespace can be employed here after SubmissionInfo removed from
114-
// the enclosing scope.
115-
116113
class __SYCL_EXPORT SubmissionInfo {
117114
public:
118115
SubmissionInfo() {}
@@ -123,14 +120,11 @@ class __SYCL_EXPORT SubmissionInfo {
123120
}
124121

125122
private:
126-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
127-
std::shared_ptr<detail::queue_impl> MSecondaryQueue = nullptr;
128-
#endif
129123
ext::oneapi::experimental::event_mode_enum MEventMode =
130124
ext::oneapi::experimental::event_mode_enum::none;
131125
};
132126

133-
} // namespace v1
127+
} // namespace _V1
134128

135129
template <detail::WrapAs WrapAs, typename LambdaArgType,
136130
typename KernelName = detail::auto_name, bool EventNeeded = false,
@@ -513,13 +507,6 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
513507
typename detail::is_backend_info_desc<Param>::return_type
514508
get_backend_info() const;
515509

516-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
517-
private:
518-
// A shorthand for `get_device().has()' which is expected to be a bit quicker
519-
// than the long version
520-
bool device_has(aspect Aspect) const;
521-
#endif
522-
523510
public:
524511
/// Submits a command group function object to the queue, in order to be
525512
/// scheduled for execution on the device.
@@ -3719,23 +3706,14 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
37193706
bool khr_empty() const;
37203707
#endif
37213708

3722-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
3723-
// TODO: to be made private in the next ABI-breaking window
3724-
__SYCL_DEPRECATED(
3725-
"This is a non-standard method, use sycl::get_native instead")
3726-
ur_native_handle_t getNative(int32_t &NativeHandleDesc) const;
3727-
#endif
3728-
37293709
std::optional<event> ext_oneapi_get_last_event() const {
37303710
return static_cast<std::optional<event>>(ext_oneapi_get_last_event_impl());
37313711
}
37323712

37333713
void ext_oneapi_set_external_event(const event &external_event);
37343714

37353715
private:
3736-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
37373716
ur_native_handle_t getNative(int32_t &NativeHandleDesc) const;
3738-
#endif
37393717

37403718
std::shared_ptr<detail::queue_impl> impl;
37413719
queue(std::shared_ptr<detail::queue_impl> impl) : impl(impl) {}
@@ -3760,7 +3738,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
37603738

37613739
template <typename PropertiesT>
37623740
void ProcessSubmitProperties(PropertiesT Props,
3763-
detail::v1::SubmissionInfo &SI) const {
3741+
detail::SubmissionInfo &SI) const {
37643742
if constexpr (Props.template has_property<
37653743
ext::oneapi::experimental::event_mode_key>()) {
37663744
ext::oneapi::experimental::event_mode EventModeProp =
@@ -3773,13 +3751,13 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
37733751

37743752
/// A template-free version of submit as const member function.
37753753
event submit_with_event_impl(const detail::type_erased_cgfo_ty &CGH,
3776-
const detail::v1::SubmissionInfo &SubmitInfo,
3754+
const detail::SubmissionInfo &SubmitInfo,
37773755
const detail::code_location &CodeLoc,
37783756
bool IsTopCodeLoc) const;
37793757

37803758
/// A template-free version of submit_without_event as const member function.
37813759
void submit_without_event_impl(const detail::type_erased_cgfo_ty &CGH,
3782-
const detail::v1::SubmissionInfo &SubmitInfo,
3760+
const detail::SubmissionInfo &SubmitInfo,
37833761
const detail::code_location &CodeLoc,
37843762
bool IsTopCodeLoc) const;
37853763

@@ -3797,7 +3775,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
37973775
const detail::code_location &CodeLoc =
37983776
detail::code_location::current()) const {
37993777
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3800-
detail::v1::SubmissionInfo SI{};
3778+
detail::SubmissionInfo SI{};
38013779
ProcessSubmitProperties(Props, SI);
38023780
return submit_with_event_impl(CGF, SI, TlsCodeLocCapture.query(),
38033781
TlsCodeLocCapture.isToplevel());
@@ -3815,7 +3793,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
38153793
const detail::type_erased_cgfo_ty &CGF,
38163794
const detail::code_location &CodeLoc) const {
38173795
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3818-
detail::v1::SubmissionInfo SI{};
3796+
detail::SubmissionInfo SI{};
38193797
ProcessSubmitProperties(Props, SI);
38203798
submit_without_event_impl(CGF, SI, TlsCodeLocCapture.query(),
38213799
TlsCodeLocCapture.isToplevel());

sycl/include/sycl/usm/usm_pointer_info.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
// ===--------------------------------------------------------------------=== //
88
#pragma once
99

10-
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
11-
#include <sycl/usm/usm_enums.hpp> // for alloc
10+
#include <sycl/context.hpp>
11+
#include <sycl/detail/export.hpp>
12+
#include <sycl/detail/impl_utils.hpp>
13+
#include <sycl/usm/usm_enums.hpp>
1214

1315
namespace sycl {
1416
inline namespace _V1 {
@@ -26,13 +28,9 @@ __SYCL_EXPORT usm::alloc get_pointer_type(const void *ptr, context_impl &ctxt);
2628
///
2729
/// \param ptr is the USM pointer to query
2830
/// \param ctxt is the sycl context the ptr was allocated in
29-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
3031
inline usm::alloc get_pointer_type(const void *ptr, const context &ctxt) {
31-
return get_pointer_type(ptr, *getSyclObjImpl(ctxt));
32+
return get_pointer_type(ptr, *detail::getSyclObjImpl(ctxt));
3233
}
33-
#else
34-
__SYCL_EXPORT usm::alloc get_pointer_type(const void *ptr, const context &ctxt);
35-
#endif
3634

3735
/// Queries the device against which the pointer was allocated
3836
/// Throws an exception with errc::invalid error code if ptr is a host

sycl/source/backend.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,6 @@ make_kernel_bundle(ur_native_handle_t NativeHandle,
309309
std::move(UrProgram), ImageOriginInterop)});
310310
}
311311

312-
// TODO: Unused. Remove when allowed.
313-
std::shared_ptr<detail::kernel_bundle_impl>
314-
make_kernel_bundle(ur_native_handle_t NativeHandle,
315-
const context &TargetContext, bundle_state State,
316-
backend Backend) {
317-
return make_kernel_bundle(NativeHandle, TargetContext, false, State, Backend);
318-
}
319-
320312
kernel make_kernel(const context &TargetContext,
321313
const kernel_bundle<bundle_state::executable> &KernelBundle,
322314
ur_native_handle_t NativeHandle, bool KeepOwnership,
@@ -363,14 +355,6 @@ kernel make_kernel(const context &TargetContext,
363355
std::move(UrKernel), ContextImpl, &KernelBundleImpl));
364356
}
365357

366-
kernel make_kernel(ur_native_handle_t NativeHandle,
367-
const context &TargetContext, backend Backend) {
368-
return make_kernel(
369-
TargetContext,
370-
get_empty_interop_kernel_bundle<bundle_state::executable>(TargetContext),
371-
NativeHandle, false, Backend);
372-
}
373-
374358
} // namespace detail
375359
} // namespace _V1
376360
} // namespace sycl

sycl/source/backend/opencl.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,6 @@ __SYCL_EXPORT bool has_extension(const sycl::device &SyclDevice,
5454
std::string::npos;
5555
}
5656
} // namespace detail
57-
58-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
59-
// Magic combination found by trial and error:
60-
__SYCL_EXPORT
61-
#if _WIN32
62-
inline
63-
#endif
64-
bool
65-
has_extension(const sycl::device &SyclDevice,
66-
const std::string &Extension) {
67-
return detail::has_extension(SyclDevice, detail::string_view{Extension});
68-
}
69-
// Magic combination found by trial and error:
70-
__SYCL_EXPORT
71-
#if _WIN32
72-
inline
73-
#endif
74-
bool
75-
has_extension(const sycl::platform &SyclPlatform,
76-
const std::string &Extension) {
77-
return detail::has_extension(SyclPlatform, detail::string_view{Extension});
78-
}
79-
#endif
8057
} // namespace opencl
8158
} // namespace _V1
8259
} // namespace sycl

sycl/source/detail/global_handler.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#include <sycl/detail/spinlock.hpp>
1212
#include <sycl/detail/util.hpp>
1313

14-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
15-
#include <deque>
16-
#endif
1714
#include <memory>
1815
#include <unordered_map>
1916

@@ -29,10 +26,6 @@ class adapter_impl;
2926
class ods_target_list;
3027
class XPTIRegistry;
3128
class ThreadPool;
32-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
33-
struct KernelNameBasedCacheT;
34-
class DeviceKernelInfo;
35-
#endif
3629

3730
/// Wrapper class for global data structures with non-trivial destructors.
3831
///
@@ -130,9 +123,6 @@ class GlobalHandler {
130123
InstWithLock<XPTIRegistry> MXPTIRegistry;
131124
// Thread pool for host task and event callbacks execution
132125
InstWithLock<ThreadPool> MHostTaskThreadPool;
133-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
134-
InstWithLock<std::deque<DeviceKernelInfo>> MDeviceKernelInfoStorage;
135-
#endif
136126

137127
static GlobalHandler *RTGlobalObjHandler;
138128
};

0 commit comments

Comments
 (0)