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 / speculation / cost-test.om

141 lines · 2308 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2fn sample r ulong n ulong to void
3for i ulong 16
4put cobs i 0
5end
6put cobs 0 r
7put cobs 1 n
8put cobs 2 1
9put cobs 5 add 100 n
10put cobs 8 1
11put cobs 10 add 106 n
12put cobs 11 add 100 mul r 10
13put cobs 12 add slen r 1
14put cobs 13 7
15put cobs 14 1
16put cobs 15 63
17end
18fn collect to void
19fixture
20check eq cstart 0
21check eq cseal 75
22for r ulong 7
23for i ulong 5
24sample r i
25check eq cadd 0
26end
27end
28check eq cseal 0
29check eq scost 0 108
30check eq get srows 4 102
31check eq get srows 6 5
32check eq get crange 0 106
33check eq get crange 1 110
34check eq get craw 74 110
35check eq get srows 10 5
36check eq get srows 75 160
37check eq svalid 0
38check eq sbegin 0 0
39put scontrol 0 0
40put scontrol 1 0
41check eq sselect 1000 256 1000 7 2 0 0
42check eq get decision 3 108
43scancel
44end
45fn reject to void
46fixture
47check eq cstart 0
48sample 0 0
49put cobs 15 31
50check eq cadd 65
51sample 0 0
52put cobs 5 0
53check eq cadd 65
54sample 0 0
55put cobs 2 0
56check eq cadd 75
57sample 0 0
58put cobs 3 1
59check eq cadd 75
60sample 0 0
61put cobs 10 100
62check eq cadd 65
63sample 0 0
64put cobs 10 18446744073709551615
65check eq cadd 65
66sample 0 0
67put cobs 5 18446744073709551615
68check eq cadd 65
69sample 0 0
70put cobs 4 1
71check eq cadd 65
72sample 0 0
73put cobs 13 8
74check eq cadd 69
75sample 0 0
76put cobs 14 2
77check eq cadd 69
78sample 0 0
79put cobs 12 2
80check eq cadd 65
81sample 7 0
82check eq cadd 65
83sample 0 0
84put cobs 11 0
85check eq cadd 65
86sample 0 1
87check eq cadd 65
88check eq get ccount 0 0
89sample 0 0
90check eq cadd 0
91check eq cadd 65
92check eq get ccount 0 1
93put sid 0 999
94check eq cseal 69
95sample 0 1
96check eq cadd 69
97end
98fn capacity to void
99fixture
100note Unsupported shapes must be declared before collection, not dropped after observing costs.
101for r ulong 7
102if gt r 0
103put srows mul r 11 0
104end
105end
106check eq cstart 0
107for i ulong 32
108sample 0 i
109check eq cadd 0
110end
111sample 0 32
112check eq cadd 77
113check eq get ccount 0 32
114check eq get craw 506 137
115check eq cseal 0
116check eq get srows 11 0
117put srows 11 1
118check eq cseal 69
119end
120fn main to int
121collect
122reject
123capacity
124fixture
125check eq cstart 0
126sample 0 0
127put sprofile 2 1
128check eq cadd 69
129check eq cseal 69
130fixture
131check eq cstart 0
132put sprofile 3 64000
133check eq cadd 69
134check eq cseal 69
135fixture
136check eq cstart 0
137put srows 11 0
138check eq cadd 69
139check eq cseal 69
140ret finish
141end