22 #include <type_traits>
25 inline namespace _V1 {
26 namespace ext::oneapi::experimental {
28 template <
typename ParentGroup>
class tangle_group;
30 template <
typename Group>
31 #ifdef __SYCL_DEVICE_ONLY__
32 [[__sycl_detail__::__uses_aspects__(sycl::aspect::ext_oneapi_tangle_group)]]
34 inline std::enable_if_t<sycl::is_group_v<std::decay_t<Group>> &&
35 std::is_same_v<Group, sycl::sub_group>,
47 #ifdef __SYCL_DEVICE_ONLY__
50 throw runtime_error(
"Non-uniform groups are not supported on host device.",
51 PI_ERROR_INVALID_DEVICE);
56 #ifdef __SYCL_DEVICE_ONLY__
57 return sycl::detail::CallerPositionInMask(
Mask);
59 throw runtime_error(
"Non-uniform groups are not supported on host device.",
60 PI_ERROR_INVALID_DEVICE);
65 #ifdef __SYCL_DEVICE_ONLY__
68 throw runtime_error(
"Non-uniform groups are not supported on host device.",
69 PI_ERROR_INVALID_DEVICE);
74 #ifdef __SYCL_DEVICE_ONLY__
77 throw runtime_error(
"Non-uniform groups are not supported on host device.",
78 PI_ERROR_INVALID_DEVICE);
83 #ifdef __SYCL_DEVICE_ONLY__
86 throw runtime_error(
"Non-uniform groups are not supported on host device.",
87 PI_ERROR_INVALID_DEVICE);
92 #ifdef __SYCL_DEVICE_ONLY__
95 throw runtime_error(
"Non-uniform groups are not supported on host device.",
96 PI_ERROR_INVALID_DEVICE);
101 #ifdef __SYCL_DEVICE_ONLY__
104 throw runtime_error(
"Non-uniform groups are not supported on host device.",
105 PI_ERROR_INVALID_DEVICE);
110 #ifdef __SYCL_DEVICE_ONLY__
113 throw runtime_error(
"Non-uniform groups are not supported on host device.",
114 PI_ERROR_INVALID_DEVICE);
119 #ifdef __SYCL_DEVICE_ONLY__
120 uint32_t Lowest =
static_cast<uint32_t
>(
Mask.
find_low()[0]);
121 return __spirv_SubgroupLocalInvocationId() == Lowest;
123 throw runtime_error(
"Non-uniform groups are not supported on host device.",
124 PI_ERROR_INVALID_DEVICE);
139 template <
typename Group>
140 inline std::enable_if_t<sycl::is_group_v<std::decay_t<Group>> &&
141 std::is_same_v<Group, sycl::sub_group>,
145 #ifdef __SYCL_DEVICE_ONLY__
146 #if defined(__SPIR__) || defined(__SPIRV__)
153 #elif defined(__NVPTX__)
160 throw runtime_error(
"Non-uniform groups are not supported on host device.",
161 PI_ERROR_INVALID_DEVICE);
166 template <
typename ParentGroup>
171 template <
typename ParentGroup>
172 struct is_group<ext::oneapi::experimental::tangle_group<ParentGroup>>
id_type get_group_id() const
typename ParentGroup::linear_id_type linear_id_type
range_type get_group_range() const
static constexpr int dimensions
range_type get_local_range() const
linear_id_type get_local_linear_range() const
linear_id_type get_local_linear_id() const
linear_id_type get_group_linear_id() const
id_type get_local_id() const
static constexpr sycl::memory_scope fence_scope
linear_id_type get_group_linear_range() const
tangle_group(sub_group_mask m)
fence_scope
The scope that fence() operation should apply to.
std::enable_if_t< sycl::is_group_v< std::decay_t< Group > > &&std::is_same_v< Group, sycl::sub_group >, tangle_group< Group > > get_tangle_group(Group group)
std::enable_if_t< std::is_same_v< std::decay_t< Group >, sub_group >||std::is_same_v< std::decay_t< Group >, sycl::sub_group >, sub_group_mask > group_ballot(Group g, bool predicate=true)