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_ids32_wide.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note moe_ids32 at wide capacity: router u32 little-endian picks to logical ulong words. |
| 3 | note 1280 entries = 128 tokens * 10 routed picks. n counts active entries, not tokens. |
| 4 | note No masking or expert validation here; moe_plan_wide validates ids. |
| 5 | fn moe_ids32_wide src view uchar 5120 n ulong ids edit ulong 1280 to ulong |
| 6 | if gt n 1280 |
| 7 | ret 1 |
| 8 | end |
| 9 | for i ulong n |
| 10 | v = ulong 0 |
| 11 | for b ulong 4 |
| 12 | v = or v shl ulong get src add mul i 4 b mul b 8 |
| 13 | end |
| 14 | put ids i v |
| 15 | end |
| 16 | ret 0 |
| 17 | end |