Open rhornung67 opened 8 years ago
.
Interesting pattern to consider:
double* reg_data = ...; // reduction array for regions double* field_data = ...; // field on mesh double* zone2reg_map = ; // mapping mesh zones to regions
forall
A first cut to support this could be to have: RAJA::AtomicArray aa(init_val, max_reg);
Then, the summation inside the loop could be replaced with something like this: aa.plus_equal(zone_reg, field_data[zone]);
Retrieving the value could look this this: result = aa[region];
We may want to support reduction operations for data beyond scalars.
First, meet with application users and collect use cases from different codes to see what's really needed. For example, do users need reducer objects that take a pointer and a length in their constructors, take a pointer in their reduction operators, and return a pointer to the reduced array in the () operator. The reduced array is equivalent to applying the associated scalar reduction to each element in the array.
Second, document user input. Then, based on what's needed, add issues, prioritize, and schedule work.
Note that we don't need "loc" reductions for this because it doesn't really make sense.