interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / om / numeric / tile.om

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