CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / om / numeric / tile.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | note |
| 4 | note One 32-lane tile of the OMEGA-NUMERIC reduce reference tree (ref_tile of |
| 5 | note src/omega_numeric_reduce.c and omega_warp_reduce_sum of |
| 6 | note src/omega_numeric.c). Composed after om/numeric/numeric.om. op 0 SUM and |
| 7 | note 3 MEAN add, 1 MAX and 2 MIN combine with the ref fmax/fmin; lanes fold |
| 8 | note in place at deltas 16 8 4 2 1, lane i ascending, as the C loops do. |
| 9 | fn tilecomb op ulong a ulong b ulong to ulong |
| 10 | if or eq op 0 eq op 3 |
| 11 | ret fadd32 a b |
| 12 | end |
| 13 | if eq op 1 |
| 14 | ret fmax32 a b |
| 15 | end |
| 16 | ret fmin32 a b |
| 17 | end |
| 18 | fn numeric_tile op ulong t view ulong 32 to ulong |
| 19 | v = new ulong 32 0 |
| 20 | for i ulong 32 |
| 21 | put v i get t i |
| 22 | end |
| 23 | d = ulong 16 |
| 24 | for s ulong 5 |
| 25 | for i ulong sub 32 d |
| 26 | put v i tilecomb op get v i get v add i d |
| 27 | end |
| 28 | d = shr d 1 |
| 29 | end |
| 30 | ret get v 0 |
| 31 | end |