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 / native / speculation / costs.om

237 lines · 3766 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Bounded observation collector over the existing native benchmark owner's measurements.
3note It does not measure time, prove provenance, launch a model or synthesize missing costs.
4global cobs ulong 16
5global craw ulong 3584
6global ccount ulong 7
7global csum ulong 49
8global crange ulong 21
9global cbind ulong 36
10global cshape ulong 21
11fn cstart to int
12if ne get sstate 0 0
13ret 75
14end
15v = sheader
16if ne v 0
17ret v
18end
19if ne get srows 0 1
20ret 77
21end
22for r ulong 7
23b = mul r 11
24if gt get srows b 1
25ret 65
26end
27if eq get srows b 1
28if ne get srows add b 1 slen r
29ret 65
30end
31if ne get srows add b 2 add slen r 1
32ret 65
33end
34end
35for i ulong 3
36put cshape add mul r 3 i get srows add b i
37end
38end
39for i ulong 32
40put cbind i get sid i
41end
42put cbind 32 get sprofile 1
43put cbind 33 get sprofile 4
44put cbind 34 get sprofile 2
45put cbind 35 get sprofile 3
46for i ulong 7
47put ccount i 0
48end
49for i ulong 49
50put csum i 0
51end
52for i ulong 21
53put crange i 0
54end
55ret 0
56end
57fn cbound to int
58if ne get cbind 34 get sprofile 2
59ret 69
60end
61if ne get cbind 35 get sprofile 3
62ret 69
63end
64for r ulong 7
65for i ulong 3
66if ne get cshape add mul r 3 i get srows add mul r 11 i
67ret 69
68end
69end
70end
71ret 0
72end
73fn cvalid to int
74status = cbound
75if ne status 0
76ret status
77end
78for i ulong 32
79if ne get cbind i get sid i
80ret 69
81end
82if ne get sid i get sid add i 32
83ret 69
84end
85end
86if ne get cbind 32 get sprofile 1
87ret 69
88end
89if ne get cobs 13 get cbind 32
90ret 69
91end
92if ne get cobs 14 get cbind 33
93ret 69
94end
95if ne get sprofile 4 get cbind 33
96ret 69
97end
98if ne get cobs 15 63
99ret 65
100end
101r = get cobs 0
102if ge r 7
103ret 65
104end
105if ne get srows mul r 11 1
106ret 77
107end
108if ne get cobs 1 get ccount r
109ret 65
110end
111if ge get ccount r 32
112ret 77
113end
114if ne get cobs 2 1
115ret 75
116end
117if ne get cobs 3 0
118ret 75
119end
120if ne get cobs 12 add slen r 1
121ret 65
122end
123if eq get cobs 5 0
124ret 65
125end
126if eq get cobs 11 0
127ret 65
128end
129if eq r 0
130if ne get cobs 4 0
131ret 65
132end
133end
134sum = ulong 0
135for i ulong 6
136v = get cobs add i 4
137if gt v 1000000000
138ret 65
139end
140sum = add sum v
141end
142if lt get cobs 10 sum
143ret 65
144end
145if gt get cobs 10 1000000000
146ret 65
147end
148ret 0
149end
150fn cadd to int
151status = cvalid
152if ne status 0
153ret status
154end
155r = get cobs 0
156n = get ccount r
157base = mul add mul r 32 n 16
158for i ulong 16
159put craw add base i get cobs i
160end
161sum = ulong 0
162for i ulong 6
163p = add mul r 7 i
164v = get cobs add i 4
165put csum p add get csum p v
166sum = add sum v
167end
168note Attribute uninstrumented round gaps to host overhead, preserving full wall cost.
169p = add mul r 7 3
170put csum p add get csum p sub get cobs 10 sum
171p = add mul r 7 6
172put csum p add get csum p get cobs 10
173base = mul r 3
174if eq n 0
175put crange base get cobs 10
176end
177if lt get cobs 10 get crange base
178put crange base get cobs 10
179end
180if gt get cobs 10 get crange add base 1
181put crange add base 1 get cobs 10
182end
183if gt get cobs 11 get crange add base 2
184put crange add base 2 get cobs 11
185end
186put ccount r add n 1
187ret 0
188end
189fn cseal to int
190note All enabled rows need at least five observations. No partial table publication.
191status = cbound
192if ne status 0
193ret status
194end
195if ne get sstate 0 0
196ret 75
197end
198for i ulong 32
199if ne get cbind i get sid i
200ret 69
201end
202if ne get sid i get sid add i 32
203ret 69
204end
205end
206if ne get cbind 32 get sprofile 1
207ret 69
208end
209if ne get cbind 33 get sprofile 4
210ret 69
211end
212for r ulong 7
213if eq get srows mul r 11 1
214if lt get ccount r 5
215ret 75
216end
217end
218end
219for r ulong 7
220if eq get srows mul r 11 1
221csealrow r
222end
223end
224put sstate 11 0
225ret 0
226end
227fn csealrow r ulong to void
228n = get ccount r
229b = mul r 11
230for i ulong 6
231note Ceiling each phase avoids inventing a faster zero-duration mean.
232v = div add get csum add mul r 7 i sub n 1 n
233put srows add add b 3 i v
234end
235put srows add b 9 get crange add mul r 3 2
236put srows add b 10 n
237end