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
CUDApp / tests / learn53 / catalog-check.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Emitter stream checker; first byte selects expected catalog, remaining bytes task. |
| 3 | global CBuf uchar 258 |
| 4 | fn main to int |
| 5 | pos = ulong 0 |
| 6 | done = false |
| 7 | while eq done false bound 259 |
| 8 | r = read 0 CBuf pos sub 258 pos |
| 9 | if lt r 0 |
| 10 | ret 1 |
| 11 | end |
| 12 | if eq r 0 |
| 13 | done = true |
| 14 | else |
| 15 | pos = add pos ulong r |
| 16 | if eq pos 258 |
| 17 | ret 1 |
| 18 | end |
| 19 | end |
| 20 | end |
| 21 | if eq pos 0 |
| 22 | ret 1 |
| 23 | end |
| 24 | n = kload ulong get CBuf 0 |
| 25 | if or eq n 0 ne pos add n 1 |
| 26 | ret 1 |
| 27 | end |
| 28 | for i ulong n |
| 29 | if ne get kt i get CBuf add i 1 |
| 30 | ret 1 |
| 31 | end |
| 32 | end |
| 33 | ret 0 |
| 34 | end |