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 / mxfp4-driver.om

36 lines · 704 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Binary stdin records are packed byte, lane, and scale (one byte each).
3note Binary stdout is little-endian IEEE binary32; EOF only at record boundary.
4global mxin uchar 3
5global mxout uchar 4
6fn main to int
7for row ulong 200000
8off = ulong 0
9while lt off 3 bound 3
10n = read 0 mxin off sub ulong 3 off
11if lt n 0
12ret 2
13end
14if eq n 0
15if eq off 0
16ret 0
17end
18ret 3
19end
20off = add off ulong n
21end
22v = mxfp4byte uint get mxin 0 uint get mxin 1 uint get mxin 2
23for j ulong 4
24put mxout j uchar and shr v mul j 8 255
25end
26off = 0
27while lt off 4 bound 4
28n = write 1 mxout off sub ulong 4 off
29if le n 0
30ret 4
31end
32off = add off ulong n
33end
34end
35ret 5
36end