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 / tests / models / quant-scales.om

30 lines · 809 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Verification-only exhaustive BF16 input probe, compared to unchanged C pack oracle.
3note Output65536 records: status byte then little-endian folded binary32 bits.
4note Invalid output value bits are diagnostic only, never admitted by quant_repack.
5fn qsc_put out edit uchar 327680 p ulong v uint to void
6for j ulong 4
7put out add p j uchar and shr v mul j 8 255
8end
9end
10fn main to int
11sc = new uchar 1024 0
12out = new uchar 327680 0
13for i ulong 65536
14put sc 0 uchar and i 255
15put sc 1 uchar shr i 8
16r = quant_svalid sc 0 1
17put out mul i 5 uchar r
18v = bitcast uint quant_fold sc 0
19qsc_put out add mul i 5 1 v
20end
21p = ulong 0
22while lt p 327680 bound 327680
23n = write 1 out p sub ulong 327680 p
24if le n 0
25ret 82
26end
27p = add p ulong n
28end
29ret 0
30end