Skip to content

Commit 85a6833

Browse files
authored
[SYCL][ABI-BREAK] Remove sycl::program class (#6666)
According to the SYCL 2020 spec, section D.1. What has changed from SYCL 1.2.1 to SYCL 2020: > The program class has been removed and replaced with a new > class `kernel_bundle`, which provides similar functionality in a > type-safe and thread-safe way. Removing of `program_impl` class will be done with a separate commit since it's not an ABI-breaking change and some performance analysis should be done in scope of that removal. Tests depending on `sycl::program` were removed in intel/llvm-test-suite#1187
1 parent 22e3fc5 commit 85a6833

37 files changed

+118
-1358
lines changed

sycl/include/sycl/backend/opencl.hpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ namespace opencl {
2222
__SYCL_EXPORT platform make_platform(pi_native_handle NativeHandle);
2323
__SYCL_EXPORT device make_device(pi_native_handle NativeHandle);
2424
__SYCL_EXPORT context make_context(pi_native_handle NativeHandle);
25-
#ifdef __SYCL_INTERNAL_API
26-
__SYCL_EXPORT program make_program(const context &Context,
27-
pi_native_handle NativeHandle);
28-
#endif
2925
__SYCL_EXPORT queue make_queue(const context &Context,
3026
pi_native_handle InteropHandle);
3127

@@ -53,17 +49,6 @@ T make(typename detail::interop<backend::opencl, T>::type Interop) {
5349
return make_context(detail::pi::cast<pi_native_handle>(Interop));
5450
}
5551

56-
// Construction of SYCL program.
57-
#ifdef __SYCL_INTERNAL_API
58-
template <typename T, typename detail::enable_if_t<
59-
std::is_same<T, program>::value> * = nullptr>
60-
__SYCL_DEPRECATED("Use SYCL 2020 sycl::make_program free function")
61-
T make(const context &Context,
62-
typename detail::interop<backend::opencl, T>::type Interop) {
63-
return make_program(Context, detail::pi::cast<pi_native_handle>(Interop));
64-
}
65-
#endif
66-
6752
// Construction of SYCL queue.
6853
template <typename T, typename detail::enable_if_t<
6954
std::is_same<T, queue>::value> * = nullptr>

sycl/include/sycl/detail/backend_traits_cuda.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ template <> struct interop<backend::ext_oneapi_cuda, queue> {
6060
using type = CUstream;
6161
};
6262

63-
#ifdef __SYCL_INTERNAL_API
64-
template <> struct interop<backend::ext_oneapi_cuda, program> {
65-
using type = CUmodule;
66-
};
67-
#endif
68-
6963
// TODO the interops for accessor is used in the already deprecated class
7064
// interop_handler and can be removed after API cleanup.
7165
template <typename DataT, int Dimensions, access::mode AccessMode>
@@ -127,16 +121,6 @@ template <> struct BackendReturn<backend::ext_oneapi_cuda, queue> {
127121
using type = CUstream;
128122
};
129123

130-
#ifdef __SYCL_INTERNAL_API
131-
template <> struct BackendInput<backend::ext_oneapi_cuda, program> {
132-
using type = CUmodule;
133-
};
134-
135-
template <> struct BackendReturn<backend::ext_oneapi_cuda, program> {
136-
using type = CUmodule;
137-
};
138-
#endif
139-
140124
} // namespace detail
141125
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
142126
} // namespace sycl

sycl/include/sycl/detail/backend_traits_hip.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ template <> struct interop<backend::ext_oneapi_hip, queue> {
5454
using type = HIPstream;
5555
};
5656

57-
#ifdef __SYCL_INTERNAL_API
58-
template <> struct interop<backend::ext_oneapi_hip, program> {
59-
using type = HIPmodule;
60-
};
61-
#endif
62-
6357
// TODO the interops for accessor is used in the already deprecated class
6458
// interop_handler and can be removed after API cleanup.
6559
template <typename DataT, int Dimensions, access::mode AccessMode>
@@ -121,16 +115,6 @@ template <> struct BackendReturn<backend::ext_oneapi_hip, queue> {
121115
using type = HIPstream;
122116
};
123117

124-
#ifdef __SYCL_INTERNAL_API
125-
template <> struct BackendInput<backend::ext_oneapi_hip, program> {
126-
using type = HIPmodule;
127-
};
128-
129-
template <> struct BackendReturn<backend::ext_oneapi_hip, program> {
130-
using type = HIPmodule;
131-
};
132-
#endif
133-
134118
} // namespace detail
135119
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
136120
} // namespace sycl

sycl/include/sycl/detail/backend_traits_level_zero.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ template <> struct interop<backend::ext_oneapi_level_zero, platform> {
6767
using type = ze_driver_handle_t;
6868
};
6969

70-
#ifdef __SYCL_INTERNAL_API
71-
template <> struct interop<backend::ext_oneapi_level_zero, program> {
72-
using type = ze_module_handle_t;
73-
};
74-
#endif
75-
7670
// TODO the interops for accessor is used in the already deprecated class
7771
// interop_handler and can be removed after API cleanup.
7872
template <typename DataT, int Dimensions, access::mode AccessMode>
@@ -220,16 +214,6 @@ template <> struct BackendReturn<backend::ext_oneapi_level_zero, platform> {
220214
using type = ze_driver_handle_t;
221215
};
222216

223-
#ifdef __SYCL_INTERNAL_API
224-
template <> struct BackendInput<backend::ext_oneapi_level_zero, program> {
225-
using type = ze_module_handle_t;
226-
};
227-
228-
template <> struct BackendReturn<backend::ext_oneapi_level_zero, program> {
229-
using type = ze_module_handle_t;
230-
};
231-
#endif
232-
233217
template <bundle_state State>
234218
struct BackendInput<backend::ext_oneapi_level_zero, kernel_bundle<State>> {
235219
struct type {

sycl/include/sycl/detail/backend_traits_opencl.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ template <> struct interop<backend::opencl, platform> {
5050
using type = cl_platform_id;
5151
};
5252

53-
#ifdef __SYCL_INTERNAL_API
54-
template <> struct interop<backend::opencl, program> {
55-
using type = cl_program;
56-
};
57-
#endif
58-
5953
// TODO the interops for accessor is used in the already deprecated class
6054
// interop_handler and can be removed after API cleanup.
6155
template <typename DataT, int Dimensions, access::mode AccessMode>
@@ -134,16 +128,6 @@ template <> struct BackendReturn<backend::opencl, platform> {
134128
using type = cl_platform_id;
135129
};
136130

137-
#ifdef __SYCL_INTERNAL_API
138-
template <> struct BackendInput<backend::opencl, program> {
139-
using type = cl_program;
140-
};
141-
142-
template <> struct BackendReturn<backend::opencl, program> {
143-
using type = cl_program;
144-
};
145-
#endif
146-
147131
template <bundle_state State>
148132
struct BackendInput<backend::opencl, kernel_bundle<State>> {
149133
using type = cl_program;

sycl/include/sycl/ext/oneapi/__function_pointer.hpp

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

sycl/include/sycl/ext/oneapi/backend/level_zero.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#pragma once
1010

1111
#include <sycl/backend.hpp>
12-
#include <sycl/program.hpp>
1312

1413
#include <vector>
1514

@@ -27,10 +26,6 @@ __SYCL_EXPORT device make_device(const platform &Platform,
2726
__SYCL_EXPORT context make_context(const std::vector<device> &DeviceList,
2827
pi_native_handle NativeHandle,
2928
bool keep_ownership = false);
30-
#ifdef __SYCL_INTERNAL_API
31-
__SYCL_EXPORT program make_program(const context &Context,
32-
pi_native_handle NativeHandle);
33-
#endif
3429
__SYCL_DEPRECATED("Use make_queue with device parameter")
3530
__SYCL_EXPORT queue make_queue(const context &Context,
3631
pi_native_handle InteropHandle,
@@ -82,18 +77,6 @@ T make(const std::vector<device> &DeviceList,
8277
Ownership == ownership::keep);
8378
}
8479

85-
// Construction of SYCL program.
86-
#ifdef __SYCL_INTERNAL_API
87-
template <typename T, typename sycl::detail::enable_if_t<
88-
std::is_same<T, program>::value> * = nullptr>
89-
__SYCL_DEPRECATED("Use SYCL 2020 sycl::make_kernel_bundle free function")
90-
T make(const context &Context,
91-
typename sycl::detail::interop<backend::ext_oneapi_level_zero, T>::type
92-
Interop) {
93-
return make_program(Context, reinterpret_cast<pi_native_handle>(Interop));
94-
}
95-
#endif
96-
9780
// Construction of SYCL queue.
9881
template <typename T, typename sycl::detail::enable_if_t<
9982
std::is_same<T, queue>::value> * = nullptr>

sycl/include/sycl/ext/oneapi/experimental/backend/backend_traits_cuda.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ template <> struct interop<backend::ext_oneapi_cuda, platform> {
5959
using type = std::vector<CUdevice>;
6060
};
6161

62-
#ifdef __SYCL_INTERNAL_API
63-
template <> struct interop<backend::ext_oneapi_cuda, program> {
64-
using type = CUmodule;
65-
};
66-
#endif
67-
6862
template <typename DataT, int Dimensions, typename AllocatorT>
6963
struct BackendInput<backend::ext_oneapi_cuda,
7064
buffer<DataT, Dimensions, AllocatorT>> {
@@ -117,16 +111,6 @@ template <> struct BackendReturn<backend::ext_oneapi_cuda, platform> {
117111
using type = std::vector<CUdevice>;
118112
};
119113

120-
#ifdef __SYCL_INTERNAL_API
121-
template <> struct BackendInput<backend::ext_oneapi_cuda, program> {
122-
using type = CUmodule;
123-
};
124-
125-
template <> struct BackendReturn<backend::ext_oneapi_cuda, program> {
126-
using type = CUmodule;
127-
};
128-
#endif
129-
130114
template <> struct InteropFeatureSupportMap<backend::ext_oneapi_cuda> {
131115
static constexpr bool MakePlatform = false;
132116
static constexpr bool MakeDevice = true;

sycl/include/sycl/ext/oneapi/experimental/spec_constant.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
namespace sycl {
2323
__SYCL_INLINE_VER_NAMESPACE(_V1) {
24-
class program;
2524

2625
namespace ext {
2726
namespace oneapi {
@@ -47,7 +46,6 @@ class __SYCL2020_DEPRECATED(
4746
#else
4847
char padding[sizeof(T)];
4948
#endif // __SYCL_DEVICE_ONLY__
50-
friend class sycl::program;
5149

5250
public:
5351
template <typename V = T>

sycl/include/sycl/info/info_desc.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
namespace sycl {
1616
__SYCL_INLINE_VER_NAMESPACE(_V1) {
1717

18-
#ifdef __SYCL_INTERNAL_API
19-
class program;
20-
#endif
2118
class device;
2219
class platform;
2320
class kernel_id;
@@ -179,15 +176,6 @@ namespace event_profiling {
179176
} // namespace event_profiling
180177
#undef __SYCL_PARAM_TRAITS_SPEC
181178

182-
// Deprecated program class information desctiptors
183-
#ifdef __SYCL_INTERNAL_API
184-
enum class program : pi_uint32 {
185-
context = PI_PROGRAM_INFO_CONTEXT,
186-
devices = PI_PROGRAM_INFO_DEVICES,
187-
reference_count = PI_PROGRAM_INFO_REFERENCE_COUNT
188-
};
189-
#endif
190-
191179
// Provide an alias to the return type for each of the info parameters
192180
template <typename T, T param> class param_traits {};
193181

@@ -198,11 +186,6 @@ template <typename T, T param> struct compatibility_param_traits {};
198186
public: \
199187
using return_type = ret_type; \
200188
};
201-
202-
#ifdef __SYCL_INTERNAL_API
203-
#include <sycl/info/program_traits.def>
204-
#endif
205-
206189
#undef __SYCL_PARAM_TRAITS_SPEC
207190

208191
} // namespace info

sycl/include/sycl/info/kernel_traits.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ __SYCL_PARAM_TRAITS_SPEC(kernel, attributes, std::string, PI_KERNEL_INFO_ATTRIBU
33
__SYCL_PARAM_TRAITS_SPEC(kernel, function_name, std::string, PI_KERNEL_INFO_FUNCTION_NAME)
44
__SYCL_PARAM_TRAITS_SPEC(kernel, reference_count, uint32_t, PI_KERNEL_INFO_REFERENCE_COUNT)
55
__SYCL_PARAM_TRAITS_SPEC(kernel, context, sycl::context, PI_KERNEL_INFO_CONTEXT)
6-
#ifdef __SYCL_INTERNAL_API
7-
__SYCL_PARAM_TRAITS_SPEC(kernel, program, sycl::program, PI_KERNEL_INFO_ATTRIBUTES)
8-
#endif

sycl/include/sycl/info/program_traits.def

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

0 commit comments

Comments
 (0)