Libraryless. Click here for Pure Java version (9216L/51K).
1 | import jdk.incubator.vector.*; |
2 | |
3 | static Pair<int[]> rowAndColSums_8x8_vectorAPI(int[] data) { |
4 | VectorSpecies<Int> species = IntVector.SPECIES_256; |
5 | int[] rowSums = new[8]; |
6 | int[] colSums = new[8]; |
7 | IntVector vColSums = IntVector.zero(species); |
8 | for y to 8: { |
9 | IntVector v = IntVector.fromArray(species, data, y*8); |
10 | rowSums[y] = v.reduceLanes(VectorOperators.ADD); |
11 | vColSums = vColSums.add(v); |
12 | } |
13 | vColSums.intoArray(colSums, 0); |
14 | ret pair(rowSums, colSums); |
15 | } |
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030540 |
Snippet name: | rowAndColSums_8x8_vectorAPI |
Eternal ID of this version: | #1030540/2 |
Text MD5: | b68beb11771cda952d30d74bdbf45d35 |
Transpilation MD5: | 41c8c1d5daca9741ee140d547a3fc374 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-01-06 19:57:44 |
Source code size: | 490 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 219 / 300 |
Version history: | 1 change(s) |
Referenced in: | [show references] |