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 / cpubf16.om

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