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 / om / q38-head / envelope-driver.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | global QEIn uchar 20480 |
| 3 | global QEOut uchar 8 |
| 4 | fn main to int |
| 5 | off = ulong 0 |
| 6 | while lt off 20480 bound 20480 |
| 7 | n = read 0 QEIn off sub 20480 off |
| 8 | if le n 0 |
| 9 | ret 65 |
| 10 | end |
| 11 | off = add off ulong n |
| 12 | end |
| 13 | bits = new uint 5120 0 |
| 14 | for i ulong 5120 |
| 15 | v = ulong 0 |
| 16 | for j ulong 4 |
| 17 | v = or v shl ulong get QEIn add mul i 4 j mul j 8 |
| 18 | end |
| 19 | put bits i uint v |
| 20 | end |
| 21 | v = q38_envelope bits |
| 22 | for j ulong 8 |
| 23 | put QEOut j uchar and shr v mul j 8 255 |
| 24 | end |
| 25 | if ne write 1 QEOut 0 8 8 |
| 26 | ret 74 |
| 27 | end |
| 28 | ret 0 |
| 29 | end |