Skip to content

Commit 38f2906

Browse files
committed
[SYCL] Adopt __SYCL_DEPRECATED__ in sub_group.hpp
Signed-off-by: John Pennycook <[email protected]>
1 parent 4723889 commit 38f2906

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

sycl/include/CL/sycl/intel/sub_group.hpp

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,16 @@ struct sub_group {
160160
/* --- vote / ballot functions --- */
161161

162162
#if __cplusplus >= 201402L
163-
[[deprecated("Use sycl::intel::any_of instead.")]]
163+
__SYCL_DEPRECATED__("Use sycl::intel::any_of instead.")
164164
#endif
165-
bool
166-
any(bool predicate) const {
165+
bool any(bool predicate) const {
167166
return __spirv_GroupAny(__spv::Scope::Subgroup, predicate);
168167
}
169168

170169
#if __cplusplus >= 201402L
171-
[[deprecated("Use sycl::intel::all_of instead.")]]
170+
__SYCL_DEPRECATED__("Use sycl::intel::all_of instead.")
172171
#endif
173-
bool
174-
all(bool predicate) const {
172+
bool all(bool predicate) const {
175173
return __spirv_GroupAll(__spv::Scope::Subgroup, predicate);
176174
}
177175

@@ -183,50 +181,46 @@ struct sub_group {
183181

184182
template <typename T>
185183
#if __cplusplus >= 201402L
186-
[[deprecated("Use sycl::intel::broadcast instead.")]]
184+
__SYCL_DEPRECATED__("Use sycl::intel::broadcast instead.")
187185
#endif
188-
EnableIfIsScalarArithmetic<T>
189-
broadcast(T x, id<1> local_id) const {
186+
EnableIfIsScalarArithmetic<T> broadcast(T x, id<1> local_id) const {
190187
return detail::spirv::GroupBroadcast<__spv::Scope::Subgroup>(x, local_id);
191188
}
192189

193190
template <typename T, class BinaryOperation>
194191
#if __cplusplus >= 201402L
195-
[[deprecated("Use sycl::intel::reduce instead.")]]
192+
__SYCL_DEPRECATED__("Use sycl::intel::reduce instead.")
196193
#endif
197-
EnableIfIsScalarArithmetic<T>
198-
reduce(T x, BinaryOperation op) const {
194+
EnableIfIsScalarArithmetic<T> reduce(T x, BinaryOperation op) const {
199195
return detail::calc<T, __spv::GroupOperation::Reduce,
200196
__spv::Scope::Subgroup>(
201197
typename detail::GroupOpTag<T>::type(), x, op);
202198
}
203199

204200
template <typename T, class BinaryOperation>
205201
#if __cplusplus >= 201402L
206-
[[deprecated("Use sycl::intel::reduce instead.")]]
202+
__SYCL_DEPRECATED__("Use sycl::intel::reduce instead.")
207203
#endif
208-
EnableIfIsScalarArithmetic<T>
209-
reduce(T x, T init, BinaryOperation op) const {
204+
EnableIfIsScalarArithmetic<T> reduce(T x, T init, BinaryOperation op) const {
210205
return op(init, reduce(x, op));
211206
}
212207

213208
template <typename T, class BinaryOperation>
214209
#if __cplusplus >= 201402L
215-
[[deprecated("Use sycl::intel::exclusive_scan instead.")]]
210+
__SYCL_DEPRECATED__("Use sycl::intel::exclusive_scan instead.")
216211
#endif
217-
EnableIfIsScalarArithmetic<T>
218-
exclusive_scan(T x, BinaryOperation op) const {
212+
EnableIfIsScalarArithmetic<T> exclusive_scan(T x, BinaryOperation op) const {
219213
return detail::calc<T, __spv::GroupOperation::ExclusiveScan,
220214
__spv::Scope::Subgroup>(
221215
typename detail::GroupOpTag<T>::type(), x, op);
222216
}
223217

224218
template <typename T, class BinaryOperation>
225219
#if __cplusplus >= 201402L
226-
[[deprecated("Use sycl::intel::exclusive_scan instead.")]]
220+
__SYCL_DEPRECATED__("Use sycl::intel::exclusive_scan instead.")
227221
#endif
228-
EnableIfIsScalarArithmetic<T>
229-
exclusive_scan(T x, T init, BinaryOperation op) const {
222+
EnableIfIsScalarArithmetic<T> exclusive_scan(T x, T init,
223+
BinaryOperation op) const {
230224
if (get_local_id().get(0) == 0) {
231225
x = op(init, x);
232226
}
@@ -239,21 +233,20 @@ struct sub_group {
239233

240234
template <typename T, class BinaryOperation>
241235
#if __cplusplus >= 201402L
242-
[[deprecated("Use sycl::intel::inclusive_scan instead.")]]
236+
__SYCL_DEPRECATED__("Use sycl::intel::inclusive_scan instead.")
243237
#endif
244-
EnableIfIsScalarArithmetic<T>
245-
inclusive_scan(T x, BinaryOperation op) const {
238+
EnableIfIsScalarArithmetic<T> inclusive_scan(T x, BinaryOperation op) const {
246239
return detail::calc<T, __spv::GroupOperation::InclusiveScan,
247240
__spv::Scope::Subgroup>(
248241
typename detail::GroupOpTag<T>::type(), x, op);
249242
}
250243

251244
template <typename T, class BinaryOperation>
252245
#if __cplusplus >= 201402L
253-
[[deprecated("Use sycl::intel::inclusive_scan instead.")]]
246+
__SYCL_DEPRECATED__("Use sycl::intel::inclusive_scan instead.")
254247
#endif
255-
EnableIfIsScalarArithmetic<T>
256-
inclusive_scan(T x, BinaryOperation op, T init) const {
248+
EnableIfIsScalarArithmetic<T> inclusive_scan(T x, BinaryOperation op,
249+
T init) const {
257250
if (get_local_id().get(0) == 0) {
258251
x = op(init, x);
259252
}

0 commit comments

Comments
 (0)