|
6 | 6 | #include "cedr_test_randomized.hpp" |
7 | 7 |
|
8 | 8 | namespace Kokkos { |
9 | | -struct Real2 { |
| 9 | +struct ComposeReal2 { |
10 | 10 | cedr::Real v[2]; |
11 | | - KOKKOS_INLINE_FUNCTION Real2 () { v[0] = v[1] = 0; } |
| 11 | + KOKKOS_INLINE_FUNCTION ComposeReal2 () { v[0] = v[1] = 0; } |
12 | 12 |
|
13 | | - KOKKOS_INLINE_FUNCTION void operator= (const Real2& s) { |
| 13 | + KOKKOS_INLINE_FUNCTION void operator= (const ComposeReal2& s) { |
14 | 14 | v[0] = s.v[0]; |
15 | 15 | v[1] = s.v[1]; |
16 | 16 | } |
17 | | - KOKKOS_INLINE_FUNCTION void operator= (const volatile Real2& s) volatile { |
| 17 | + KOKKOS_INLINE_FUNCTION void operator= (const volatile ComposeReal2& s) volatile { |
18 | 18 | v[0] = s.v[0]; |
19 | 19 | v[1] = s.v[1]; |
20 | 20 | } |
21 | 21 |
|
22 | | - KOKKOS_INLINE_FUNCTION Real2& operator+= (const Real2& o) { |
| 22 | + KOKKOS_INLINE_FUNCTION ComposeReal2& operator+= (const ComposeReal2& o) { |
23 | 23 | v[0] += o.v[0]; |
24 | 24 | v[1] += o.v[1]; |
25 | 25 | return *this; |
26 | 26 | } |
27 | 27 | }; |
28 | 28 |
|
29 | | -template<> struct reduction_identity<Real2> { |
30 | | - KOKKOS_INLINE_FUNCTION static Real2 sum() { return Real2(); } |
| 29 | +template<> struct reduction_identity<ComposeReal2> { |
| 30 | + KOKKOS_INLINE_FUNCTION static ComposeReal2 sum() { return ComposeReal2(); } |
31 | 31 | }; |
32 | 32 | } // namespace Kokkos |
33 | 33 |
|
@@ -171,16 +171,16 @@ void CAAS<ES>::reduce_locally () { |
171 | 171 | const auto calc_Qm_clip = KOKKOS_LAMBDA (const typename ESU::Member& t) { |
172 | 172 | const auto k = t.league_rank(); |
173 | 173 | const auto os = (k+1)*nlclcells; |
174 | | - const auto reduce = [&] (const Int& i, Kokkos::Real2& accum) { |
| 174 | + const auto reduce = [&] (const Int& i, Kokkos::ComposeReal2& accum) { |
175 | 175 | Real Qm_clip, Qm_term; |
176 | 176 | calc_Qm_scalars(d, probs, nt, nlclcells, k, os, i, Qm_clip, Qm_term); |
177 | 177 | d(os+i) = Qm_clip; |
178 | 178 | accum.v[0] += Qm_clip; |
179 | 179 | accum.v[1] += Qm_term; |
180 | 180 | }; |
181 | | - Kokkos::Real2 accum; |
| 181 | + Kokkos::ComposeReal2 accum; |
182 | 182 | Kokkos::parallel_reduce(Kokkos::TeamThreadRange(t, nlclcells), |
183 | | - reduce, Kokkos::Sum<Kokkos::Real2>(accum)); |
| 183 | + reduce, Kokkos::Sum<Kokkos::ComposeReal2>(accum)); |
184 | 184 | send( k) = accum.v[0]; |
185 | 185 | send(nt + k) = accum.v[1]; |
186 | 186 | }; |
@@ -253,7 +253,7 @@ void CAAS<ES>::finish_locally () { |
253 | 253 | } |
254 | 254 |
|
255 | 255 | template <typename ES> |
256 | | -const CAAS<ES>::DeviceOp& CAAS<ES>::get_device_op() { return o; } |
| 256 | +const typename CAAS<ES>::DeviceOp& CAAS<ES>::get_device_op() { return o; } |
257 | 257 |
|
258 | 258 | template <typename ES> |
259 | 259 | void CAAS<ES>::run () { |
|
0 commit comments