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 / tools / tilelab_process.om

77 lines · 1265 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Shared bounded argument packing and direct child execution. No shell or GPU calls.
3global ta uchar 4096
4global tb uchar 4096
5global tp ulong 2
6global tw uchar 4096
7global tn ulong 1
8global ts uchar 4
9fn tl_clear to void
10put tp 0 2
11put tp 1 0
12end
13fn tl_add to void
14n = get tn 0
15p = get tp 0
16if or ge get tp 1 64 gt add add p n 2 4096
17exit 90
18end
19put ta p uchar and n 255
20put ta add p 1 uchar shr n 8
21for i ulong n
22put ta add add p 2 i get tb i
23end
24put tp 0 add add p 2 n
25put tp 1 add get tp 1 1
26end
27fn tl_arg idx ulong to void
28n = argread idx tb 0 4095
29if lt n 0
30exit 90
31end
32put tn 0 ulong n
33end
34fn tl_word idx ulong to void
35note Both scans advance p once per pass through the fixed 4096-byte word pool.
36p = ulong 0
37k = ulong 0
38while lt k idx bound 4096
39if ge p len tw
40exit 90
41end
42if eq get tw p 10
43k = add k 1
44end
45p = add p 1
46end
47n = ulong 0
48while lt p len tw bound 4096
49if eq get tw p 10
50break
51end
52put tb n get tw p
53n = add n 1
54p = add p 1
55end
56put tn 0 n
57end
58fn tl_run to int
59put ta 0 uchar get tp 1
60put ta 1 0
61pid = fork
62if lt pid 0
63ret 91
64end
65if eq pid 0
66r = execprog ta 0 get tp 0
67exit 127
68end
69r = waitpid int pid ts 0 4 0
70if ne r pid
71ret 91
72end
73if ne get ts 0 0
74ret 92
75end
76ret int get ts 1
77end