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 / encoder / ldg_mini.om

49 lines · 914 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note One instruction: LDG.E R2, desc[UR8][R30.64+64]. No padding or kernel builder.
3note Compose after bw_enc_sm121.om. No args emits one 128-byte C-adapter record.
4note An argument emits status zero plus the seeded four words, 24 bytes total.
5fn lm_word b edit uchar 128 pos ulong value ulong n ulong to void
6for h ulong n
7put b add pos h uchar and shr value mul h 8 255
8end
9end
10fn main to int
11a = new ulong 16 0
12o = new ulong 16 0
13w = new ulong 4 0
14b = new uchar 128 0
15put a 0 11
16put a 1 2
17put a 2 30
18put a 5 8
19put a 6 64
20if gt argcnt 1
21for k ulong 8
22put o k get a k
23end
24put o 12 1
25put o 14 1
26put o 15 1
27if ne enc1 o w 0
28ret 1
29end
30for k ulong 4
31pos = add 8 mul k 4
32lm_word b pos get w k 4
33end
34r = write 1 b 0 24
35if ne r 24
36ret 2
37end
38else
39for k ulong 16
40pos = mul k 8
41lm_word b pos get a k 8
42end
43r = write 1 b 0 128
44if ne r 128
45ret 2
46end
47end
48ret 0
49end