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