Skip to content

Commit b753212

Browse files
[SYCL] Remove oneapi::sub_group under preview (#19781)
This commit removes the ext::oneapi::sub_group class under the preview flag to ensure its removal during the next API break. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 4a3fe1e commit b753212

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

sycl/include/sycl/detail/spirv.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ inline namespace _V1 {
3232
struct sub_group;
3333
namespace ext {
3434
namespace oneapi {
35+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
3536
struct sub_group;
37+
#endif
3638
namespace experimental {
3739
template <typename ParentGroup> class fragment;
3840

@@ -75,9 +77,12 @@ template <int Dimensions> struct group_scope<group<Dimensions>> {
7577
static constexpr __spv::Scope::Flag value = __spv::Scope::Flag::Workgroup;
7678
};
7779

80+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
7881
template <> struct group_scope<::sycl::ext::oneapi::sub_group> {
7982
static constexpr __spv::Scope::Flag value = __spv::Scope::Flag::Subgroup;
8083
};
84+
#endif
85+
8186
template <> struct group_scope<::sycl::sub_group> {
8287
static constexpr __spv::Scope::Flag value = __spv::Scope::Flag::Subgroup;
8388
};
@@ -272,9 +277,13 @@ using WidenOpenCLTypeTo32_t = std::conditional_t<
272277
template <typename Group> struct GroupId {
273278
using type = size_t;
274279
};
280+
281+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
275282
template <> struct GroupId<::sycl::ext::oneapi::sub_group> {
276283
using type = uint32_t;
277284
};
285+
#endif
286+
278287
template <> struct GroupId<::sycl::sub_group> {
279288
using type = uint32_t;
280289
};

sycl/include/sycl/detail/type_traits.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ inline namespace _V1 {
2222
template <int Dimensions> class group;
2323
struct sub_group;
2424
namespace ext::oneapi {
25+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
2526
struct sub_group;
27+
#endif
2628

2729
namespace experimental {
2830
template <typename Group, std::size_t Extent> class group_with_scratchpad;
@@ -40,9 +42,12 @@ struct is_fixed_topology_group<root_group<Dimensions>> : std::true_type {};
4042
template <int Dimensions>
4143
struct is_fixed_topology_group<sycl::group<Dimensions>> : std::true_type {};
4244

45+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
4346
template <>
4447
struct is_fixed_topology_group<sycl::ext::oneapi::sub_group> : std::true_type {
4548
};
49+
#endif
50+
4651
template <> struct is_fixed_topology_group<sycl::sub_group> : std::true_type {};
4752

4853
template <class T> struct is_user_constructed_group : std::false_type {};
@@ -74,7 +79,10 @@ struct is_group<group<Dimensions>> : std::true_type {};
7479

7580
template <typename T> struct is_sub_group : std::false_type {};
7681

82+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
7783
template <> struct is_sub_group<ext::oneapi::sub_group> : std::true_type {};
84+
#endif
85+
7886
template <> struct is_sub_group<sycl::sub_group> : std::true_type {};
7987

8088
template <typename T>

sycl/include/sycl/ext/oneapi/sub_group.hpp

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

1414
#include <tuple> // for _Swallow_assign, ignore
1515

16+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
1617
namespace sycl {
1718
inline namespace _V1 {
1819
namespace ext::oneapi {
@@ -34,3 +35,4 @@ struct __SYCL_DEPRECATED("use sycl::sub_group() instead") sub_group
3435
} // namespace ext::oneapi
3536
} // namespace _V1
3637
} // namespace sycl
38+
#endif

sycl/include/sycl/ext/oneapi/sub_group_mask.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ template <typename Group> struct group_scope;
3838

3939
namespace ext::oneapi {
4040

41+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
4142
// forward decalre sycl::ext::oneapi::sub_group
4243
struct sub_group;
44+
#endif
4345

4446
// defining `group_ballot` here to make predicate default `true`
4547
// need to forward declare sub_group_mask first
@@ -360,8 +362,11 @@ ext::oneapi::sub_group_mask commonGroupBallotImpl(Group G, bool Predicate) {
360362
Val, __spirv_BuiltInSubgroupMaxSize());
361363
// For sub-groups we do not need to apply the mask, but for others it will
362364
// split converging groups accordingly.
363-
if constexpr (!std::is_same_v<std::decay_t<Group>, ext::oneapi::sub_group> &&
364-
!std::is_same_v<std::decay_t<Group>, sycl::sub_group>)
365+
if constexpr (
366+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
367+
!std::is_same_v<std::decay_t<Group>, ext::oneapi::sub_group> &&
368+
#endif
369+
!std::is_same_v<std::decay_t<Group>, sycl::sub_group>)
365370
Mask &= sycl::detail::GetMask(G);
366371
return Mask;
367372
}

0 commit comments

Comments
 (0)