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 / gemmex / dot.om

29 lines · 1241 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note One run of the host recompute of a flagged element (CUDApp#144, src/omega_gpu_gemm_ex.c host_dot): n stored
3note elements of row i of op(A) (type ta) and column j of op(B) (type tb), gathered by the C shell inside one block_k
4note block, added in k order: s += ((f64 a) * (f64 b)) * f, f = (f64 sa) * (f64 sb) under block scales; without them
5note f is 1.0 and the product times f is the product itself (x * 1.0 = x exactly, a NaN x already quiet), so s += x.
6note q: 0 ta, 1 tb, 2 n (<= 16384), 3 s bits in, 4 block scales, 5 sa bits, 6 sb bits. Gives the s bits out.
7note a and b are read as words (the C shell gathers them into word-aligned windows).
8fn gemm_ex_dot q view ulong 8 a view ulong 8192 b view ulong 8192 to ulong
9ta = get q 0
10tb = get q 1
11ea = gx_es ta
12eb = gx_es tb
13s = bitcast f64 get q 3
14if eq get q 4 0
15for i ulong get q 2
16x = f64 gx_ldf ta gx_wel view a i ea
17s = add s mul x f64 gx_ldf tb gx_wel view b i eb
18end
19ret bitcast ulong s
20end
21f = f64 bitcast f32 uint get q 5
22f = mul f f64 bitcast f32 uint get q 6
23for i ulong get q 2
24x = f64 gx_ldf ta gx_wel view a i ea
25x = mul x f64 gx_ldf tb gx_wel view b i eb
26s = add s mul x f
27end
28ret bitcast ulong s
29end