Lines Matching full:accumulator

35 // a traversal of the unmasked elements of an array.  Each accumulator class
44 template <typename TYPE, typename ACCUMULATOR>
46 const Descriptor *mask, ACCUMULATOR &accumulator, const char *intrinsic,
62 if (!accumulator.template AccumulateAt<TYPE>(xAt)) {
75 if (!accumulator.template AccumulateAt<TYPE>(xAt)) {
81 template <TypeCategory CAT, int KIND, typename ACCUMULATOR>
84 ACCUMULATOR &&accumulator, const char *intrinsic,
92 DoTotalReduction<CppType>(x, dim, mask, accumulator, intrinsic, terminator);
94 // Result is returned from accumulator, as in REDUCE() for derived type
96 accumulator.GetResult();
98 accumulator.template GetResult<CppType>();
103 accumulator.GetResult(&result);
105 accumulator.template GetResult<CppType>(&result);
131 template <typename TYPE, typename ACCUMULATOR>
134 ACCUMULATOR &accumulator) {
141 if (!accumulator.template AccumulateAt<TYPE>(xAt)) {
146 accumulator.GetResult(result, zeroBasedDim);
148 accumulator.template GetResult<TYPE>(result, zeroBasedDim);
152 template <typename TYPE, typename ACCUMULATOR>
155 TYPE *result, ACCUMULATOR &accumulator) {
168 if (!accumulator.template AccumulateAt<TYPE>(xAt)) {
174 accumulator.GetResult(result, zeroBasedDim);
176 accumulator.template GetResult<TYPE>(result, zeroBasedDim);
182 template <typename ACCUMULATOR, TypeCategory CAT, int KIND>
186 ACCUMULATOR &accumulator) {
197 accumulator.Reinitialize();
198 ReduceDimMaskToScalar<CppType, ACCUMULATOR>(
199 x, dim - 1, at, *mask, result.Element<CppType>(at), accumulator);
204 accumulator.Reinitialize();
206 accumulator.GetResult(result.Element<CppType>(at));
213 accumulator.Reinitialize();
214 ReduceDimToScalar<CppType, ACCUMULATOR>(
215 x, dim - 1, at, result.Element<CppType>(at), accumulator);
227 using Accumulator =
229 Accumulator accumulator{x};
232 PartialReduction<Accumulator, TypeCategory::Integer, KIND>(result, x,
233 x.ElementBytes(), dim, mask, terminator, intrinsic, accumulator);
254 using Accumulator = ACCUM<CppTypeFor<TypeCategory::Real, Intermediate>>;
255 Accumulator accumulator{x};
258 PartialReduction<Accumulator, CAT, KIND>(result, x, x.ElementBytes(), dim,
259 mask, terminator, intrinsic, accumulator);
295 template <typename ACCUMULATOR> struct LocationResultHelper {
298 ACCUMULATOR &accumulator, const Descriptor &result) const {
299 accumulator.GetResult(
305 template <typename ACCUMULATOR> struct PartialLocationHelper {
309 const char *intrinsic, ACCUMULATOR &accumulator) const {
312 PartialReduction<ACCUMULATOR, TypeCategory::Integer, KIND>(result, x,
314 terminator, intrinsic, accumulator);
337 template <TypeCategory CAT, int KIND, typename ACCUMULATOR>
342 ACCUMULATOR accumulator{x};
354 DoTotalReduction<Type>(x, dim, mask, accumulator, intrinsic, terminator);
355 accumulator.GetResult(result.OffsetElement<Type>());
361 PartialReduction<ACCUMULATOR, CAT, KIND>(result, x, x.ElementBytes(), dim,
362 mask, terminator, intrinsic, accumulator);