import jdk.incubator.vector.*; static Pair rowAndColSums_8x8_vectorAPI(int[] data) { VectorSpecies species = IntVector.SPECIES_256; int[] rowSums = new[8]; int[] colSums = new[8]; IntVector vColSums = IntVector.zero(species); for y to 8: { IntVector v = IntVector.fromArray(species, data, y*8); rowSums[y] = v.reduceLanes(VectorOperators.ADD); vColSums = vColSums.add(v); } vColSums.intoArray(colSums, 0); ret pair(rowSums, colSums); }