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