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 / tools / dag_jstr.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note dagsim jstr byte policy. The C stream shell owns string termination and output effects. |
| 3 | fn dj_hex x uint to uchar |
| 4 | if lt x 10 |
| 5 | ret uchar add x 48 |
| 6 | end |
| 7 | ret uchar add x 87 |
| 8 | end |
| 9 | fn dag_jstr c uchar out edit uchar 6 to ulong |
| 10 | if or eq c 34 eq c 92 |
| 11 | put out 0 92 |
| 12 | put out 1 c |
| 13 | ret 2 |
| 14 | end |
| 15 | if lt c 32 |
| 16 | put out 0 92 |
| 17 | put out 1 117 |
| 18 | put out 2 48 |
| 19 | put out 3 48 |
| 20 | put out 4 dj_hex shr uint c 4 |
| 21 | put out 5 dj_hex and uint c 15 |
| 22 | ret 6 |
| 23 | end |
| 24 | put out 0 c |
| 25 | ret 1 |
| 26 | end |