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 / evidence / LEARN53-L777-CONTINUATION / author / omega-core-test.om

325 lines · 5808 bytes Raw Blame History
1note Handwritten component acceptance tests; public task oracle belongs to L776.
2global Checks ulong 1
3global Digits uchar 16
4text Good "BENCHMARK_CORE_PASS\n"
5text PhraseA "Add the two input numbers and return their sum"
6text PhraseB "ADD the TWO input numbers, and return their sum."
7text PhraseC "Find a maximum element in a sorted collection"
8text HalfA "a b c"
9text HalfB "a b c d"
10text Repeat "a a a a a a"
11
12fn check actual ulong expected ulong to void
13put Checks 0 add get Checks 0 1
14if ne actual expected
15exit int add get Checks 0 40
16end
17end
18
19fn fixture to void
20for i ulong 2048
21put LT i 0
22end
23for i ulong 4
24a = mul i 32
25put LT a add i 1
26put LT add a 1 add div i 2 1
27put LT add a 2 1
28put LT add a 3 add i 1
29put LT add a 4 1
30put LT add a 5 1
31put LT add a 6 776
32put LT add a 7 add i 1
33for j ulong 20
34put LT add a add j 8 add add mul i 100 j 1
35end
36put LT add a 28 16
37put LT add a 29 16
38put LT add a 30 1000
39end
40for i ulong 4
41put LPin i add i 1
42put LPin add i 4 add i 1
43put LPin add i 8 add i 5
44put LPin add i 12 add i 5
45end
46for i ulong 9
47put LC i 0
48end
49put LC 0 10
50put LC 1 20
51put LC 2 30
52put LC 3 40
53put LC 4 50
54put LC 5 60
55put LC 6 4096
56for i ulong 24
57put LS i 0
58end
59end
60
61fn manifesttests to void
62fixture
63check lmanifest 4 0
64check lmanifest 0 1
65check lmanifest 65 1
66put LT 0 0
67check lmanifest 4 2
68fixture
69put LT 5 2
70check lmanifest 4 3
71fixture
72put LT 4 0
73check lmanifest 4 3
74fixture
75put LT 6 0
76check lmanifest 4 4
77fixture
78put LT 1 4
79check lmanifest 4 5
80fixture
81put LT 1 3
82check lmanifest 4 5
83fixture
84put LT 2 2
85check lmanifest 4 5
86fixture
87for j ulong 4
88put LT add 8 j 0
89end
90check lmanifest 4 6
91fixture
92put LT 29 257
93check lmanifest 4 7
94fixture
95put LT 32 1
96check lmanifest 4 8
97fixture
98for j ulong 4
99put LT add 40 j get LT add 8 j
100end
101check lmanifest 4 9
102fixture
103for j ulong 4
104put LT add 44 j get LT add 12 j
105end
106check lmanifest 4 10
107fixture
108put LT 71 1
109check lmanifest 4 11
110fixture
111for j ulong 4
112put LT add 80 j get LT add 16 j
113end
114check lmanifest 4 12
115fixture
116for j ulong 4
117put LT add 84 j get LT add 20 j
118end
119check lmanifest 4 13
120fixture
121for j ulong 4
122put LT add 88 j get LT add 24 j
123end
124check lmanifest 4 14
125fixture
126put LT 67 1
127check lmanifest 4 15
128fixture
129put LT 31 1
130check lmanifest 4 7
131fixture
132put LT 28 0
133check lmanifest 4 7
134fixture
135put LT 30 1000001
136check lmanifest 4 7
137end
138
139fn observationtests to void
140for i ulong 256
141put LWant i uchar and i 255
142put LGot i uchar and i 255
143end
144check lobserve 0 0 0 8 8 0
145put LGot 7 99
146check lobserve 0 0 0 8 8 7
147check lobserve 0 0 0 8 0 9
148check lobserve 0 0 0 8 7 7
149check lobserve 0 0 0 0 0 10
150check lobserve 0 102 102 0 0 0
151check lobserve 0 102 103 0 0 8
152check lobserve 0 102 102 0 1 8
153check lobserve 0 9 9 0 0 10
154check lobserve 0 0 102 8 0 8
155check lobserve 0 0 0 257 257 10
156for i ulong 6
157check lobserve add i 1 0 0 8 8 add i 1
158end
159check lobserve 7 0 0 8 8 10
160end
161
162fn accountingtests to void
163fixture
164check lbegin 4 2 1000 0
165check lbegin 4 2 1000 20
166check lattempt 0 1 7 0
167check lattempt 0 2 0 0
168check lattempt 1 1 0 0
169check lattempt 2 1 4 0
170check lattempt 3 1 11 0
171check lfinish 0
172check get LS 3 5
173check get LS 4 1
174check get LS 5 2
175check get LS 8 50
176check get LS 9 100
177check get LS 10 150
178check get LS 11 200
179check get LS 12 250
180check get LS 13 300
181check get LS 14 4096
182check get LS 16 5
183check get LS 19 1
184check lattempt 0 3 0 24
185check lfinish 24
186fixture
187check lbegin 4 2 1000 0
188check lattempt 0 1 0 0
189check lfinish 30
190check get LS 18 0
191fixture
192check lbegin 4 2 1000 0
193check lattempt 0 2 0 28
194check get LS 8 10
195check lfinish 28
196fixture
197check lbegin 4 1 1000 0
198check lattempt 0 1 7 0
199check lattempt 0 2 0 28
200check get LS 5 0
201fixture
202check lbegin 4 2 99 0
203check lattempt 0 1 0 29
204check get LS 18 0
205fixture
206check lbegin 4 2 1000 0
207put LPin 7 999
208check lattempt 0 1 0 26
209check get LS 8 10
210check get LS 5 0
211fixture
212check lbegin 4 2 1000 0
213put LPin 15 999
214check lattempt 0 1 0 26
215fixture
216check lbegin 4 2 1000 0
217put LC 0 18446744073709551615
218check lattempt 0 1 0 23
219fixture
220check lbegin 4 2 1000 0
221put LC 7 1
222check lattempt 0 1 0 25
223fixture
224check lbegin 4 2 1000 0
225put LC 7 13
226put LC 8 1
227check lattempt 0 1 0 0
228check get LS 15 13
229check get LS 16 0
230fixture
231check lbegin 4 2 1000 0
232check lattempt 64 1 0 27
233check get LS 8 10
234fixture
235check lbegin 4 0 1000 21
236fixture
237check lbegin 4 65 1000 21
238fixture
239check lbegin 4 2 0 21
240fixture
241check lbegin 4 2 1000 0
242put LC 8 2
243check lattempt 0 1 0 25
244fixture
245check lbegin 4 2 1000 0
246put LS 8 1000000000000
247check lattempt 0 1 0 23
248check get LS 18 0
249fixture
250check lbegin 1 64 100000 0
251for i ulong 64
252check lattempt 0 add i 1 7 0
253end
254check lattempt 0 65 0 31
255check get LS 3 65
256check get LS 8 650
257check get LS 5 0
258check lfinish 31
259fixture
260check lbegin 1 1 1000 0
261put LC 6 8192
262check lattempt 0 1 0 0
263check get LS 14 8192
264check lfinish 0
265end
266
267fn neartests to void
268for i ulong len PhraseA
269put LText i get PhraseA i
270end
271for i ulong len PhraseB
272put LText add 256 i get PhraseB i
273end
274check lnear len PhraseA len PhraseB 1
275for i ulong len PhraseC
276put LText add 256 i get PhraseC i
277end
278check lnear len PhraseA len PhraseC 0
279check lnear 0 0 2
280check lnear 257 1 3
281put LText 0 255
282check lnear len PhraseA len PhraseC 3
283for i ulong len HalfA
284put LText i get HalfA i
285end
286for i ulong len HalfB
287put LText add 256 i get HalfB i
288end
289check lnear len HalfA len HalfB 0
290for i ulong len Repeat
291put LText i get Repeat i
292put LText add 256 i get Repeat i
293end
294check lnear len Repeat len Repeat 1
295for i ulong 128
296put LText mul i 2 97
297put LText add mul i 2 1 32
298end
299check lnear 256 5 3
300end
301
302fn countout to void
303n = get Checks 0
304put Digits 0 uchar add div n 100 48
305put Digits 1 uchar add rem div n 10 10 48
306put Digits 2 uchar add rem n 10 48
307put Digits 3 10
308w = write 1 Digits 0 4
309if ne w 4
310exit 36
311end
312end
313
314fn main to int
315manifesttests
316observationtests
317accountingtests
318neartests
319w = write 1 Good 0 len Good
320if ne w long len Good
321ret 35
322end
323countout
324ret 0
325end