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 / abft / cul1-unit.om

86 lines · 1426 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Unit cases for native/abft/cul1.om; concatenated after native/learn53/task.om, tests/learn53/fixtures.om
3note and native/abft/cul1.om (tests/abft/driver.om). keval stays the exact oracle; kabft is the checksum.
4global ksave uchar 4096
5fn kseeds want int to void
6for s ulong 8
7check eq kabft 144 36 add mul s 2654435761 1 want
8end
9end
10fn abclean to void
11mat
12check eq keval 144 36 0
13kseeds 0
14end
15fn abone to void
16mat
17cw 7 60
18check eq keval 144 36 1
19kseeds 1
20mat
21cw 1 1073741845
22check eq keval 144 36 1
23kseeds 1
24mat
25cw 1 22
26cw 2 23
27kseeds 1
28end
29fn abcanary to void
30mat
31cw 0 0
32check eq kabft 144 36 1 1
33mat
34cw 4 0
35check eq keval 144 36 1
36check eq kabft 144 36 1 1
37mat
38cw 8 0
39check eq kabft 144 36 1 1
40end
41fn abrect to void
42note Declared miss: 2^31 added to C[0][0], C[0][1], C[1][0], C[1][1]; Wolfram 2^31+21 = 2147483669 etc.
43mat
44cw 1 2147483669
45cw 2 2147483672
46cw 5 2147483695
47cw 6 2147483702
48check eq keval 144 36 1
49kseeds 0
50end
51fn abrefuse to void
52vec
53check eq keval 136 28 0
54check eq kabft 136 28 1 69
55mat
56check eq kabft 144 32 1 65
57mat
58tw 21 1
59check eq kabft 144 36 1 65
60end
61fn abpure to void
62mat
63for i ulong 4096
64put ksave i get kt i
65end
66check eq kabft 144 36 7 0
67same = true
68for i ulong 4096
69if ne get ksave i get kt i
70same = false
71end
72end
73check same
74end
75fn main to int
76abclean
77abone
78abcanary
79abrect
80abrefuse
81abpure
82if ne get tally 1 0
83ret 1
84end
85ret 0
86end