20 template <
typename T,
typename AllocatorT,
typename BinaryOperation>
21 std::enable_if_t<has_known_identity<BinaryOperation, T>::value,
22 ext::oneapi::detail::reduction_impl<
23 T, BinaryOperation, 0, 1,
24 ext::oneapi::detail::default_reduction_algorithm<
25 false, access::placeholder::true_t, 1>>>
29 PropList.has_property<property::reduction::initialize_to_identity>();
37 template <
typename T,
typename AllocatorT,
typename BinaryOperation>
38 std::enable_if_t<!has_known_identity<BinaryOperation, T>::value,
39 ext::oneapi::detail::reduction_impl<
40 T, BinaryOperation, 0, 1,
41 ext::oneapi::detail::default_reduction_algorithm<
42 false, access::placeholder::true_t, 1>>>
47 throw runtime_error(
"Identity-less reductions with unknown identity are not "
49 PI_ERROR_INVALID_VALUE);
55 template <
typename T,
typename BinaryOperation>
56 std::enable_if_t<has_known_identity<BinaryOperation, T>::value,
57 ext::oneapi::detail::reduction_impl<
58 T, BinaryOperation, 0, 1,
59 ext::oneapi::detail::default_reduction_algorithm<
60 true, access::placeholder::false_t, 1>>>
63 PropList.has_property<property::reduction::initialize_to_identity>();
72 template <
typename T,
typename BinaryOperation>
73 std::enable_if_t<!has_known_identity<BinaryOperation, T>::value,
74 ext::oneapi::detail::reduction_impl<
75 T, BinaryOperation, 0, 1,
76 ext::oneapi::detail::default_reduction_algorithm<
77 true, access::placeholder::false_t, 1>>>
81 throw runtime_error(
"Identity-less reductions with unknown identity are not "
83 PI_ERROR_INVALID_VALUE);
89 template <
typename T,
typename AllocatorT,
typename BinaryOperation>
90 ext::oneapi::detail::reduction_impl<
91 T, BinaryOperation, 0, 1,
92 ext::oneapi::detail::default_reduction_algorithm<
93 false, access::placeholder::true_t, 1>>
95 BinaryOperation Combiner,
const property_list &PropList = {}) {
97 PropList.has_property<property::reduction::initialize_to_identity>();
104 template <
typename T,
typename BinaryOperation>
105 ext::oneapi::detail::reduction_impl<
106 T, BinaryOperation, 0, 1,
107 ext::oneapi::detail::default_reduction_algorithm<
108 true, access::placeholder::false_t, 1>>
109 reduction(T *Var,
const T &Identity, BinaryOperation Combiner,
112 PropList.has_property<property::reduction::initialize_to_identity>();
116 #if __cplusplus >= 201703L
117 template <
typename T,
size_t Extent,
typename BinaryOperation>
122 has_known_identity<BinaryOperation, T>::value,
123 ext::oneapi::detail::reduction_impl<
124 T, BinaryOperation, 1, Extent,
125 ext::oneapi::detail::default_reduction_algorithm<
126 true, access::placeholder::false_t, 1>>>
127 reduction(span<T, Extent> Span, BinaryOperation,
128 const property_list &PropList = {}) {
130 PropList.has_property<property::reduction::initialize_to_identity>();
139 template <
typename T,
size_t Extent,
typename BinaryOperation>
141 !has_known_identity<BinaryOperation, T>::value,
142 ext::oneapi::detail::reduction_impl<
143 T, BinaryOperation, 1, Extent,
144 ext::oneapi::detail::default_reduction_algorithm<
145 true, access::placeholder::false_t, 1>>>
146 reduction(span<T, Extent>, BinaryOperation,
147 const property_list &PropList = {}) {
150 throw runtime_error(
"Identity-less reductions with unknown identity are not "
152 PI_ERROR_INVALID_VALUE);
158 template <
typename T,
size_t Extent,
typename BinaryOperation>
160 ext::oneapi::detail::reduction_impl<
161 T, BinaryOperation, 1, Extent,
162 ext::oneapi::detail::default_reduction_algorithm<
163 true, access::placeholder::false_t, 1>>>
164 reduction(span<T, Extent> Span,
const T &Identity, BinaryOperation Combiner,
165 const property_list &PropList = {}) {
167 PropList.has_property<property::reduction::initialize_to_identity>();