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-export.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Development fixture emitter: exactly one input byte, public catalog ID1..8. |
| 3 | global CIn uchar 2 |
| 4 | fn main to int |
| 5 | pos = ulong 0 |
| 6 | done = false |
| 7 | while eq done false bound 3 |
| 8 | r = read 0 CIn pos sub 2 pos |
| 9 | if lt r 0 |
| 10 | ret 74 |
| 11 | end |
| 12 | if eq r 0 |
| 13 | done = true |
| 14 | else |
| 15 | pos = add pos ulong r |
| 16 | if eq pos 2 |
| 17 | ret 65 |
| 18 | end |
| 19 | end |
| 20 | end |
| 21 | if ne pos 1 |
| 22 | ret 65 |
| 23 | end |
| 24 | n = kload ulong get CIn 0 |
| 25 | if eq n 0 |
| 26 | ret 77 |
| 27 | end |
| 28 | pos = 0 |
| 29 | while lt pos n bound 257 |
| 30 | w = write 1 kt pos sub n pos |
| 31 | if le w 0 |
| 32 | ret 74 |
| 33 | end |
| 34 | pos = add pos ulong w |
| 35 | end |
| 36 | ret 0 |
| 37 | end |