The approach for handling reductions in the outer most
dimension follows that for inner most dimensions, outlined
below
- First, transpose to move reduction dims, if needed
- Convert reduction from n-d to 2-d canonical form
Then, for outer reductions, we emit the appropriate op
(add/mul/min/max/or/and/xor) and combine the results.
nit: spell out the type here as it not not obvious. I would potentially do it for elementType and srcShape as well. In general the rule is that if the type is obvious you should use auto otherwise you should spell out the type.
https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable