8
8
#include < algorithm>
9
9
#include < execution>
10
10
11
- #if defined(DATA20 ) || defined(INDICES)
11
+ #if defined(DATA23 ) || defined(INDICES)
12
12
#include < ranges>
13
13
#endif
14
14
@@ -89,7 +89,7 @@ template <class T>
89
89
void STDStream<T>::copy()
90
90
{
91
91
// c[i] = a[i]
92
- #if defined(DATA17) || defined(DATA20 )
92
+ #if defined(DATA17) || defined(DATA23 )
93
93
std::copy (exe_policy, a, a + array_size, c);
94
94
#elif INDICES
95
95
std::for_each_n (exe_policy, counting_iter (0 ), array_size, [a=a,c=c](intptr_t i) {
@@ -104,7 +104,7 @@ template <class T>
104
104
void STDStream<T>::mul()
105
105
{
106
106
// b[i] = scalar * c[i];
107
- #if defined(DATA17) || defined(DATA20 )
107
+ #if defined(DATA17) || defined(DATA23 )
108
108
std::transform (exe_policy, c, c + array_size, b, [](T ci){ return startScalar*ci; });
109
109
#elif INDICES
110
110
std::for_each_n (exe_policy, counting_iter (0 ), array_size, [b=b, c=c](intptr_t i) {
@@ -119,7 +119,7 @@ template <class T>
119
119
void STDStream<T>::add()
120
120
{
121
121
// c[i] = a[i] + b[i];
122
- #if defined(DATA17) || defined(DATA20 )
122
+ #if defined(DATA17) || defined(DATA23 )
123
123
std::transform (exe_policy, a, a + array_size, b, c, std::plus<T>());
124
124
#elif INDICES
125
125
std::for_each_n (exe_policy, counting_iter (0 ), array_size, [a=a, b=b, c=c](intptr_t i) {
@@ -134,7 +134,7 @@ template <class T>
134
134
void STDStream<T>::triad()
135
135
{
136
136
// a[i] = b[i] + scalar * c[i];
137
- #if defined(DATA17) || defined(DATA20 )
137
+ #if defined(DATA17) || defined(DATA23 )
138
138
std::transform (exe_policy, b, b + array_size, c, a, [scalar = startScalar](T bi, T ci){ return bi+scalar*ci; });
139
139
#elif INDICES
140
140
std::for_each_n (exe_policy, counting_iter (0 ), array_size, [a=a, b=b, c=c](intptr_t i) {
@@ -149,13 +149,13 @@ template <class T>
149
149
void STDStream<T>::nstream()
150
150
{
151
151
// a[i] += b[i] + scalar * c[i];
152
- #if defined(DATA17) || defined(DATA20 ) // Until we can require GCC 14.1
152
+ #if defined(DATA17) || defined(DATA23 ) // Until we can require GCC 14.1
153
153
// Need to do in two round-trips with C++17 STL.
154
154
// 1: a[i] += b[i]
155
155
// 2: a[i] += scalar * c[i];
156
156
std::transform (exe_policy, a, a + array_size, b, a, [](T ai, T bi){ return ai + bi; });
157
157
std::transform (exe_policy, a, a + array_size, c, a, [](T ai, T ci){ return ai + startScalar*ci; });
158
- #elif DATA20
158
+ #elif DATA23
159
159
// Requires GCC 14.1 (Ubuntu 24.04):
160
160
auto as = std::ranges::subrange (a, a + array_size);
161
161
auto bs = std::ranges::subrange (b, b + array_size);
@@ -178,7 +178,7 @@ void STDStream<T>::nstream()
178
178
template <class T >
179
179
T STDStream<T>::dot()
180
180
{
181
- #if defined(DATA17) || defined(DATA20 )
181
+ #if defined(DATA17) || defined(DATA23 )
182
182
// sum = 0; sum += a[i] * b[i]; return sum;
183
183
return std::transform_reduce (exe_policy, a, a + array_size, b, T{0 });
184
184
#elif INDICES
0 commit comments