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 / core / cubadmit.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Copyright 2026 Drake Stapleton |
| 3 | note Target admission for omega_cubin_pack_target. The C caller passes a present flag |
| 4 | note (1 when the parameter pointer is non-null) and copies the message. Pointer I/O stays in C. |
| 5 | note Refusal 8 is OMEGA_CUBIN_E_TARGET. Refusal 1 is OMEGA_CUBIN_E_ARG. |
| 6 | note unsupported cubin target sm_ |
| 7 | fn ca0 o edit uchar 64 p ulong to ulong |
| 8 | put o add p 0 uchar 117 |
| 9 | put o add p 1 uchar 110 |
| 10 | put o add p 2 uchar 115 |
| 11 | put o add p 3 uchar 117 |
| 12 | put o add p 4 uchar 112 |
| 13 | put o add p 5 uchar 112 |
| 14 | put o add p 6 uchar 111 |
| 15 | put o add p 7 uchar 114 |
| 16 | put o add p 8 uchar 116 |
| 17 | put o add p 9 uchar 101 |
| 18 | put o add p 10 uchar 100 |
| 19 | put o add p 11 uchar 32 |
| 20 | put o add p 12 uchar 99 |
| 21 | put o add p 13 uchar 117 |
| 22 | put o add p 14 uchar 98 |
| 23 | put o add p 15 uchar 105 |
| 24 | put o add p 16 uchar 110 |
| 25 | put o add p 17 uchar 32 |
| 26 | put o add p 18 uchar 116 |
| 27 | put o add p 19 uchar 97 |
| 28 | put o add p 20 uchar 114 |
| 29 | put o add p 21 uchar 103 |
| 30 | put o add p 22 uchar 101 |
| 31 | put o add p 23 uchar 116 |
| 32 | put o add p 24 uchar 32 |
| 33 | put o add p 25 uchar 115 |
| 34 | put o add p 26 uchar 109 |
| 35 | put o add p 27 uchar 95 |
| 36 | ret add p 28 |
| 37 | end |
| 38 | note null parameter array |
| 39 | fn ca1 o edit uchar 64 p ulong to ulong |
| 40 | put o add p 0 uchar 110 |
| 41 | put o add p 1 uchar 117 |
| 42 | put o add p 2 uchar 108 |
| 43 | put o add p 3 uchar 108 |
| 44 | put o add p 4 uchar 32 |
| 45 | put o add p 5 uchar 112 |
| 46 | put o add p 6 uchar 97 |
| 47 | put o add p 7 uchar 114 |
| 48 | put o add p 8 uchar 97 |
| 49 | put o add p 9 uchar 109 |
| 50 | put o add p 10 uchar 101 |
| 51 | put o add p 11 uchar 116 |
| 52 | put o add p 12 uchar 101 |
| 53 | put o add p 13 uchar 114 |
| 54 | put o add p 14 uchar 32 |
| 55 | put o add p 15 uchar 97 |
| 56 | put o add p 16 uchar 114 |
| 57 | put o add p 17 uchar 114 |
| 58 | put o add p 18 uchar 97 |
| 59 | put o add p 19 uchar 121 |
| 60 | ret add p 20 |
| 61 | end |
| 62 | note decimal target, copied after the prefix. omnum writes at offset 0 of its own buffer. |
| 63 | fn cadec sm ulong msg edit uchar 64 p ulong to ulong |
| 64 | tmp = new uchar 24 0 |
| 65 | n = omnum sm 10 0 tmp |
| 66 | for i ulong n |
| 67 | put msg add p i get tmp i |
| 68 | end |
| 69 | ret add p n |
| 70 | end |
| 71 | fn cubadmit sm ulong np ulong present ulong msg edit uchar 64 to uint |
| 72 | p = ulong 0 |
| 73 | if and ne sm 86 ne sm 121 |
| 74 | p = ca0 msg 0 |
| 75 | p = cadec sm msg p |
| 76 | put msg p 0 |
| 77 | ret 8 |
| 78 | end |
| 79 | if and ne np 0 eq present 0 |
| 80 | p = ca1 msg 0 |
| 81 | put msg p 0 |
| 82 | ret 1 |
| 83 | end |
| 84 | put msg 0 0 |
| 85 | ret 0 |
| 86 | end |