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 / host-trace / batch-chip.om

121 lines · 1900 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Chip run ONLY inside the owner's spark-window exclusive lease. No host test invokes main.
3note VECTOR_1D 287-launch synthetic step, NOT an Omega LLM step or decoded token.
4note Reports integer host wall nanoseconds. No fabricated GPU timestamps or training wait claim.
5global bcmode uchar 16
6global bcnum uchar 32
7text bcarg "--chip"
8text bcline "BATCH_CHIP "
9text bcsep " "
10text bclf "\n"
11fn bcprint n ulong to void
12if ge n 10
13bcprint div n 10
14end
15put bcnum 0 uchar add ulong 48 rem n 10
16r = write 1 bcnum 0 1
17end
18fn bcspace to void
19r = write 1 bcsep 0 1
20end
21fn bcverify to bool
22for i ulong 64
23v = mapget get gbmem 7 mul i 4 4
24if ne v mul i 3
25ret false
26end
27end
28ret true
29end
30fn bcstep bat bool to bool
31if bat
32if not gbbegin 287
33ret false
34end
35for i ulong 287
36gbbody 64
37if not gbappend i i
38ret false
39end
40end
41ret gbbsubmit 5000000000
42end
43for i ulong 287
44if not gblaunch 64
45ret false
46end
47end
48ret true
49end
50fn bcrun phase ulong bat bool to bool
51for rep ulong 20
52r = mapset get gbmem 7 0 4 4294967295
53start = monons
54if not bcstep bat
55ret false
56end
57elapsed = sub monons start
58if or lt elapsed 0 not bcverify
59ret false
60end
61r = write 1 bcline 0 len bcline
62bcprint phase
63bcspace
64bcprint rep
65bcspace
66bcprint 287
67bcspace
68if bat
69bcprint get gbst 6
70bcspace
71bcprint get gbst 7
72else
73bcprint 287
74bcspace
75bcprint 287
76end
77bcspace
78bcprint ulong elapsed
79r = write 1 bclf 0 1
80end
81ret true
82end
83fn main to int
84if ne argcnt 2
85ret 64
86end
87if ne argread 1 bcmode 0 16 long len bcarg
88ret 64
89end
90for i ulong len bcarg
91if ne get bcmode i get bcarg i
92ret 64
93end
94end
95if not gbopen 64
96ok = nvstop
97ret 2
98end
99if not gbbopen
100ok = nvstop
101ret 3
102end
103for i ulong 64
104r = mapset get gbmem 5 mul i 4 4 i
105r = mapset get gbmem 6 mul i 4 4 mul i 2
106end
107ok = bcrun 0 false
108if ok
109ok = bcrun 1 true
110end
111if ok
112ok = bcrun 2 false
113end
114if not nvstop
115ret 5
116end
117if not ok
118ret 4
119end
120ret 0
121end