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
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note One run of the host recompute of a flagged element (CUDApp#144, src/omega_gpu_gemm_ex.c host_dot): n stored |
| 3 | note 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 |
| 4 | note block, added in k order: s += ((f64 a) * (f64 b)) * f, f = (f64 sa) * (f64 sb) under block scales; without them |
| 5 | note 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. |
| 6 | note 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. |
| 7 | note a and b are read as words (the C shell gathers them into word-aligned windows). |
| 8 | fn gemm_ex_dot q view ulong 8 a view ulong 8192 b view ulong 8192 to ulong |
| 9 | ta = get q 0 |
| 10 | tb = get q 1 |
| 11 | ea = gx_es ta |
| 12 | eb = gx_es tb |
| 13 | s = bitcast f64 get q 3 |
| 14 | if eq get q 4 0 |
| 15 | for i ulong get q 2 |
| 16 | x = f64 gx_ldf ta gx_wel view a i ea |
| 17 | s = add s mul x f64 gx_ldf tb gx_wel view b i eb |
| 18 | end |
| 19 | ret bitcast ulong s |
| 20 | end |
| 21 | f = f64 bitcast f32 uint get q 5 |
| 22 | f = mul f f64 bitcast f32 uint get q 6 |
| 23 | for i ulong get q 2 |
| 24 | x = f64 gx_ldf ta gx_wel view a i ea |
| 25 | x = mul x f64 gx_ldf tb gx_wel view b i eb |
| 26 | s = add s mul x f |
| 27 | end |
| 28 | ret bitcast ulong s |
| 29 | end |