@@ -20,7 +20,9 @@ namespace sycl {
20
20
template <typename T, typename AllocatorT, typename BinaryOperation>
21
21
std::enable_if_t <has_known_identity<BinaryOperation, T>::value,
22
22
ext::oneapi::detail::reduction_impl<
23
- T, BinaryOperation, 1 , false , access::placeholder::true_t >>
23
+ T, BinaryOperation, 0 , 1 ,
24
+ ext::oneapi::detail::default_reduction_algorithm<
25
+ false , access::placeholder::true_t , 1 >>>
24
26
reduction (buffer<T, 1 , AllocatorT> Var, handler &CGH, BinaryOperation,
25
27
const property_list &PropList = {}) {
26
28
bool InitializeToIdentity =
@@ -35,7 +37,9 @@ reduction(buffer<T, 1, AllocatorT> Var, handler &CGH, BinaryOperation,
35
37
template <typename T, typename AllocatorT, typename BinaryOperation>
36
38
std::enable_if_t <!has_known_identity<BinaryOperation, T>::value,
37
39
ext::oneapi::detail::reduction_impl<
38
- T, BinaryOperation, 1 , false , access::placeholder::true_t >>
40
+ T, BinaryOperation, 0 , 1 ,
41
+ ext::oneapi::detail::default_reduction_algorithm<
42
+ false , access::placeholder::true_t , 1 >>>
39
43
reduction (buffer<T, 1 , AllocatorT>, handler &, BinaryOperation,
40
44
const property_list &PropList = {}) {
41
45
// TODO: implement reduction that works even when identity is not known.
@@ -49,9 +53,11 @@ reduction(buffer<T, 1, AllocatorT>, handler &, BinaryOperation,
49
53
// / the given USM pointer \p Var, handler \p CGH, reduction operation
50
54
// / \p Combiner, and optional reduction properties.
51
55
template <typename T, typename BinaryOperation>
52
- std::enable_if_t <
53
- has_known_identity<BinaryOperation, T>::value,
54
- ext::oneapi::detail::reduction_impl<T, BinaryOperation, 1 , true >>
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 >>>
55
61
reduction (T *Var, BinaryOperation, const property_list &PropList = {}) {
56
62
bool InitializeToIdentity =
57
63
PropList.has_property <property::reduction::initialize_to_identity>();
@@ -64,9 +70,11 @@ reduction(T *Var, BinaryOperation, const property_list &PropList = {}) {
64
70
// / The reduction algorithm may be less efficient for this variant as the
65
71
// / reduction identity is not known statically and it is not provided by user.
66
72
template <typename T, typename BinaryOperation>
67
- std::enable_if_t <
68
- !has_known_identity<BinaryOperation, T>::value,
69
- ext::oneapi::detail::reduction_impl<T, BinaryOperation, 1 , true >>
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 >>>
70
78
reduction (T *, BinaryOperation, const property_list &PropList = {}) {
71
79
// TODO: implement reduction that works even when identity is not known.
72
80
(void )PropList;
@@ -79,8 +87,10 @@ reduction(T *, BinaryOperation, const property_list &PropList = {}) {
79
87
// / reduction identity value \p Identity, reduction operation \p Combiner,
80
88
// / and optional reduction properties.
81
89
template <typename T, typename AllocatorT, typename BinaryOperation>
82
- ext::oneapi::detail::reduction_impl<T, BinaryOperation, 1 , false ,
83
- access::placeholder::true_t >
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 >>
84
94
reduction (buffer<T, 1 , AllocatorT> Var, handler &CGH, const T &Identity,
85
95
BinaryOperation Combiner, const property_list &PropList = {}) {
86
96
bool InitializeToIdentity =
@@ -92,7 +102,10 @@ reduction(buffer<T, 1, AllocatorT> Var, handler &CGH, const T &Identity,
92
102
// / the given USM pointer \p Var, reduction identity value \p Identity,
93
103
// / binary operation \p Combiner, and optional reduction properties.
94
104
template <typename T, typename BinaryOperation>
95
- ext::oneapi::detail::reduction_impl<T, BinaryOperation, 1 , true >
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 >>
96
109
reduction (T *Var, const T &Identity, BinaryOperation Combiner,
97
110
const property_list &PropList = {}) {
98
111
bool InitializeToIdentity =
@@ -109,8 +122,10 @@ reduction(T *Var, const T &Identity, BinaryOperation Combiner,
109
122
template <typename T, size_t Extent, typename BinaryOperation>
110
123
std::enable_if_t <Extent != dynamic_extent &&
111
124
has_known_identity<BinaryOperation, T>::value,
112
- ext::oneapi::detail::reduction_impl<span<T, Extent>,
113
- BinaryOperation, 1 , true >>
125
+ ext::oneapi::detail::reduction_impl<
126
+ T, BinaryOperation, 1 , Extent,
127
+ ext::oneapi::detail::default_reduction_algorithm<
128
+ true , access::placeholder::false_t , 1 >>>
114
129
reduction (span<T, Extent> Span, BinaryOperation,
115
130
const property_list &PropList = {}) {
116
131
bool InitializeToIdentity =
@@ -126,8 +141,10 @@ reduction(span<T, Extent> Span, BinaryOperation,
126
141
template <typename T, size_t Extent, typename BinaryOperation>
127
142
std::enable_if_t <Extent != dynamic_extent &&
128
143
!has_known_identity<BinaryOperation, T>::value,
129
- ext::oneapi::detail::reduction_impl<span<T, Extent>,
130
- BinaryOperation, 1 , true >>
144
+ ext::oneapi::detail::reduction_impl<
145
+ T, BinaryOperation, 1 , Extent,
146
+ ext::oneapi::detail::default_reduction_algorithm<
147
+ true , access::placeholder::false_t , 1 >>>
131
148
reduction (span<T, Extent> Span, BinaryOperation,
132
149
const property_list &PropList = {}) {
133
150
// TODO: implement reduction that works even when identity is not known.
@@ -142,8 +159,10 @@ reduction(span<T, Extent> Span, BinaryOperation,
142
159
// / reduction operation \p Combiner, and optional reduction properties.
143
160
template <typename T, size_t Extent, typename BinaryOperation>
144
161
std::enable_if_t <Extent != dynamic_extent,
145
- ext::oneapi::detail::reduction_impl<span<T, Extent>,
146
- BinaryOperation, 1 , true >>
162
+ ext::oneapi::detail::reduction_impl<
163
+ T, BinaryOperation, 1 , Extent,
164
+ ext::oneapi::detail::default_reduction_algorithm<
165
+ true , access::placeholder::false_t , 1 >>>
147
166
reduction (span<T, Extent> Span, const T &Identity, BinaryOperation Combiner,
148
167
const property_list &PropList = {}) {
149
168
bool InitializeToIdentity =
0 commit comments