VectorAPI reduction operation support for testing infrastructure
Paul Sandoz
paul.sandoz at oracle.com
Wed Mar 28 01:04:38 UTC 2018
> On Mar 27, 2018, at 4:45 PM, Halimi, Jean-Philippe <jean-philippe.halimi at intel.com> wrote:
>
> Hi all,
>
> I would like to share a patch adding support for reduction operations testing in VectorAPI.
>
> Could you please review the patch here:
> http://cr.openjdk.java.net/~jphalimi/webrev_reduction_testing_v1.1/
>
122 # Reductions.
123 #gen_reduction_op "andAll" "\&" $template_file "BITWISE" "-1"
124 #gen_reduction_op "orAll" "|" $template_file "BITWISE" "0"
125 #gen_reduction_op "xorAll" "^" $template_file "BITWISE" "0"
126 #gen_reduction_op "subAll" "-" $template_file "" "0"
The actual reduction generation is commented out, is that intentional?
Include addAll, minAll, maxAll, mullAll. For FP we need to be careful about rounding errors.
For the reductive tests i would generate the simplest scalar binary function without a loop (like in the Java implementations) and push the looping logic into the assertReductionArraysEquals, which would accept the binary function e.g. this is what the Java implementations do:
int rOp(int v, FBinOp f) {
int[] vec = getElements();
for (int i = 0; i < length(); i++) {
v = f.apply(i, v, vec[i]);
}
return v;
}
public int addAll() {
return rOp((int) 0, (i, a, b) -> (int) (a + b));
}
Paul.
More information about the panama-dev
mailing list