Skip to content

Commit 0662e2a

Browse files
authored
[SYCL] Deprecate ext::oneapi::sub_group (#10263)
sub_group extension is deprecated in favor of standard SYCL2020 sub_group.
1 parent af902aa commit 0662e2a

File tree

57 files changed

+922
-900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+922
-900
lines changed

llvm/lib/SYCLLowerIR/ESIMD/ESIMDVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static const char *LegalSYCLFunctions[] = {
5050
"^sycl::_V1::multi_ptr<.+>::.+",
5151
"^sycl::_V1::nd_item<.+>::.+",
5252
"^sycl::_V1::group<.+>::.+",
53-
"^sycl::_V1::sub_group<.+>::.+",
53+
"^sycl::_V1::sub_group::.+",
5454
"^sycl::_V1::range<.+>::.+",
5555
"^sycl::_V1::kernel_handler::.+",
5656
"^sycl::_V1::cos",

sycl/include/sycl/detail/spirv.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifdef __SYCL_DEVICE_ONLY__
2323
namespace sycl {
2424
__SYCL_INLINE_VER_NAMESPACE(_V1) {
25+
struct sub_group;
2526
namespace ext {
2627
namespace oneapi {
2728
struct sub_group;
@@ -63,6 +64,9 @@ template <int Dimensions> struct group_scope<group<Dimensions>> {
6364
template <> struct group_scope<::sycl::ext::oneapi::sub_group> {
6465
static constexpr __spv::Scope::Flag value = __spv::Scope::Flag::Subgroup;
6566
};
67+
template <> struct group_scope<::sycl::sub_group> {
68+
static constexpr __spv::Scope::Flag value = __spv::Scope::Flag::Subgroup;
69+
};
6670

6771
template <typename ParentGroup>
6872
struct group_scope<sycl::ext::oneapi::experimental::ballot_group<ParentGroup>> {
@@ -253,6 +257,9 @@ template <typename Group> struct GroupId {
253257
template <> struct GroupId<::sycl::ext::oneapi::sub_group> {
254258
using type = uint32_t;
255259
};
260+
template <> struct GroupId<::sycl::sub_group> {
261+
using type = uint32_t;
262+
};
256263
template <typename Group, typename T, typename IdT>
257264
EnableIfNativeBroadcast<T, IdT> GroupBroadcast(Group, T x, IdT local_id) {
258265
using GroupIdT = typename GroupId<Group>::type;
@@ -341,7 +348,7 @@ GroupBroadcast(const ext::oneapi::experimental::opportunistic_group &g, T x,
341348
auto LocalId = detail::IdToMaskPosition(g, local_id);
342349

343350
// TODO: Refactor to avoid duplication after design settles.
344-
using GroupIdT = typename GroupId<sycl::ext::oneapi::sub_group>::type;
351+
using GroupIdT = typename GroupId<::sycl::sub_group>::type;
345352
GroupIdT GroupLocalId = static_cast<GroupIdT>(LocalId);
346353
using OCLT = detail::ConvertToOpenCLType_t<T>;
347354
using WidenedT = WidenOpenCLTypeTo32_t<OCLT>;

sycl/include/sycl/detail/type_traits.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ inline constexpr bool is_fixed_size_group_v = is_fixed_size_group<T>::value;
2828
} // namespace detail
2929

3030
template <int Dimensions> class group;
31+
struct sub_group;
3132
namespace ext::oneapi {
3233
struct sub_group;
3334

@@ -50,6 +51,7 @@ struct is_fixed_topology_group<sycl::group<Dimensions>> : std::true_type {};
5051
template <>
5152
struct is_fixed_topology_group<sycl::ext::oneapi::sub_group> : std::true_type {
5253
};
54+
template <> struct is_fixed_topology_group<sycl::sub_group> : std::true_type {};
5355

5456
template <class T> struct is_user_constructed_group : std::false_type {};
5557

@@ -77,6 +79,7 @@ struct is_group<group<Dimensions>> : std::true_type {};
7779
template <typename T> struct is_sub_group : std::false_type {};
7880

7981
template <> struct is_sub_group<ext::oneapi::sub_group> : std::true_type {};
82+
template <> struct is_sub_group<sycl::sub_group> : std::true_type {};
8083

8184
template <typename T>
8285
struct is_generic_group

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ inline opportunistic_group get_opportunistic_group() {
128128
#ifdef __SYCL_DEVICE_ONLY__
129129
#if defined(__SPIR__)
130130
// TODO: It may be wiser to call the intrinsic than rely on this_group()
131-
sycl::sub_group sg = sycl::ext::oneapi::this_sub_group();
131+
sycl::sub_group sg = sycl::ext::oneapi::experimental::this_sub_group();
132132
sub_group_mask mask = sycl::ext::oneapi::group_ballot(sg, true);
133133
return opportunistic_group(mask);
134134
#elif defined(__NVPTX__)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ group<Dimensions> get_child_group(root_group<Dimensions> g) {
9393
return this_group<Dimensions>();
9494
}
9595

96-
template <int Dimensions> sub_group get_child_group(group<Dimensions> g) {
96+
template <int Dimensions> sycl::sub_group get_child_group(group<Dimensions> g) {
9797
(void)g;
9898
return this_sub_group();
9999
}

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,15 @@
2222
// Forward declarations of types not allowed to be wrapped in uniform:
2323
namespace sycl {
2424
__SYCL_INLINE_VER_NAMESPACE(_V1) {
25-
namespace ext::oneapi {
2625

2726
struct sub_group;
28-
29-
} // namespace ext::oneapi
30-
3127
template <int, bool> class item;
3228
template <int> class id;
3329
template <int> class nd_item;
3430
template <int> class h_item;
3531
template <int> class group;
3632
template <int> class nd_range;
37-
using ext::oneapi::sub_group;
33+
using sycl::sub_group;
3834

3935
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
4036
} // namespace sycl

0 commit comments

Comments
 (0)