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 / blackwell / cpui.om

36 lines · 765 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2fn bw_imac sum uint a uint b uint to uint
3ret uint and add ulong sum mul ulong a ulong b 4294967295
4end
5fn bw_idot a view uint * b view uint * r ulong sh ulong to uint
6nn = and sh 4294967295
7kk = shr sh 32
8ai = and mul div r nn kk 4294967295
9bi = rem r nn
10sum = uint 0
11for p ulong 4294967295
12if ge p kk
13ret sum
14end
15sum = bw_imac sum get a ai get b bi
16ai = and add ai 1 4294967295
17bi = and add bi nn 4294967295
18end
19ret sum
20end
21fn bw_cpui a view uint * b view uint * c edit uint * to int
22nn = bw_dim len a len b len c
23if eq nn 0
24ret -1
25end
26kk = div len b nn
27sh = or shl kk 32 nn
28for t ulong 18446744073709551615
29if ge t len c
30ret 0
31end
32v = bw_idot view a view b t sh
33put c and t 4294967295 v
34end
35ret 0
36end