Deterministic GPU codegen in reduction grouping