99
1010#include < sycl/detail/helpers.hpp> // for Builder
1111#include < sycl/detail/memcpy.hpp> // detail::memcpy
12- #include < sycl/exception .hpp> // for errc, exception
13- #include < sycl/feature_test.hpp> // for SYCL_EXT_ONEAPI_SUB_GROUP_MASK
14- #include < sycl/id.hpp> // for id
15- #include < sycl/marray.hpp> // for marray
16- #include < sycl/vector.hpp> // for vec
12+ #include < sycl/detail/spirv .hpp>
13+ #include < sycl/feature_test.hpp> // for SYCL_EXT_ONEAPI_SUB_GROUP_MASK
14+ #include < sycl/id.hpp> // for id
15+ #include < sycl/marray.hpp> // for marray
16+ #include < sycl/vector.hpp> // for vec
1717
1818#include < assert.h> // for assert
1919#include < climits> // for CHAR_BIT
@@ -342,8 +342,7 @@ template <typename Group>
342342std::enable_if_t <std::is_same_v<std::decay_t <Group>, sub_group> ||
343343 std::is_same_v<std::decay_t <Group>, sycl::sub_group>,
344344 sub_group_mask>
345- group_ballot (Group g, bool predicate) {
346- (void )g;
345+ group_ballot ([[maybe_unused]] Group g, [[maybe_unused]] bool predicate) {
347346#ifdef __SYCL_DEVICE_ONLY__
348347 auto res = __spirv_GroupNonUniformBallot (
349348 sycl::detail::spirv::group_scope<Group>::value, predicate);
@@ -353,20 +352,11 @@ group_ballot(Group g, bool predicate) {
353352 return sycl::detail::Builder::createSubGroupMask<sub_group_mask>(
354353 val, g.get_max_local_range ()[0 ]);
355354#else
356- (void )predicate;
357- throw exception{errc::feature_not_supported,
358- " Sub-group mask is not supported on host device" };
355+ // Groups are not user-constructible, this call should not be reachable from
356+ // host and therefore we do nothing here.
359357#endif
360358}
361359
362360} // namespace ext::oneapi
363361} // namespace _V1
364362} // namespace sycl
365-
366- // We have a cyclic dependency with
367- // sub_group_mask.hpp
368- // detail/spirv.hpp
369- // non_uniform_groups.hpp
370- // "Break" it by including this at the end (instead of beginning). Ideally, we
371- // should refactor this somehow...
372- #include < sycl/detail/spirv.hpp>
0 commit comments