17 inline namespace _V1 {
18 namespace ext::oneapi {
20 template <
typename T =
void>
using plus = std::plus<T>;
21 template <
typename T =
void>
using multiplies = std::multiplies<T>;
22 template <
typename T =
void>
using bit_or = std::bit_or<T>;
23 template <
typename T =
void>
using bit_xor = std::bit_xor<T>;
24 template <
typename T =
void>
using bit_and = std::bit_and<T>;
30 #ifdef __SYCL_DEVICE_ONLY__
33 struct GroupOpISigned {};
34 struct GroupOpIUnsigned {};
37 struct GroupOpBool {};
39 template <
typename T,
typename =
void>
struct GroupOpTag;
42 struct GroupOpTag<T,
std::enable_if_t<detail::is_sigeninteger<T>::value>> {
43 using type = GroupOpISigned;
47 struct GroupOpTag<T,
std::enable_if_t<detail::is_sugeninteger<T>::value>> {
48 using type = GroupOpIUnsigned;
52 struct GroupOpTag<T,
std::enable_if_t<detail::is_sgenfloat<T>::value>> {
53 using type = GroupOpFP;
57 struct GroupOpTag<T,
std::enable_if_t<detail::is_genbool<T>::value>> {
58 using type = GroupOpBool;
63 #define __SYCL_CALC_OVERLOAD(GroupTag, SPIRVOperation, BinaryOperation) \
64 template <__spv::GroupOperation O, typename Group, typename T> \
65 static T calc(Group g, GroupTag, T x, BinaryOperation) { \
66 return sycl::detail::spirv::Group##SPIRVOperation<O>(g, x); \
104 #undef __SYCL_CALC_OVERLOAD
107 template <
typename>
class BinaryOperation>
108 static T calc(Group g,
typename GroupOpTag<T>::type, T x,
109 BinaryOperation<void>) {
110 return calc<O>(g,
typename GroupOpTag<T>::type(), x, BinaryOperation<T>());
114 #endif // __SYCL_DEVICE_ONLY__