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 / moe / moe_maps32.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Logical ABI ulong words to the existing GPU u32 maps. Unused output bytes untouched. |
| 3 | note Validate every active value before writing; caller retains map capacity/generation lease. |
| 4 | fn moe_m32 out edit uchar 9280 p ulong v ulong to void |
| 5 | for b ulong 4 |
| 6 | put out add mul p 4 b uchar and shr v mul b 8 255 |
| 7 | end |
| 8 | end |
| 9 | fn moe_maps32 m view ulong 8 mp view ulong 2320 out edit uchar 9280 to ulong |
| 10 | if gt get m 0 1152 |
| 11 | ret 1 |
| 12 | end |
| 13 | n = add get m 0 8 |
| 14 | for z ulong 2 |
| 15 | for i ulong n |
| 16 | if gt get mp add mul z 1160 i 4294967295 |
| 17 | ret 2 |
| 18 | end |
| 19 | end |
| 20 | end |
| 21 | for z ulong 2 |
| 22 | for i ulong n |
| 23 | p = add mul z 1160 i |
| 24 | moe_m32 out p get mp p |
| 25 | end |
| 26 | end |
| 27 | ret 0 |
| 28 | end |