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 / dnn-activations / plan.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Plan words: input bytes, output bytes, CTA count, threads, reserved zero. |
| 3 | fn da_plan n ulong op ulong dtype ulong p edit ulong 8 to ulong |
| 4 | for i ulong 8 |
| 5 | put p i 0 |
| 6 | end |
| 7 | if or eq n 0 gt n 4294967295 |
| 8 | ret 1 |
| 9 | end |
| 10 | if or gt op 3 gt dtype 2 |
| 11 | ret 1 |
| 12 | end |
| 13 | bytes = ulong 4 |
| 14 | if ne dtype 0 |
| 15 | bytes = ulong 2 |
| 16 | end |
| 17 | put p 0 mul n bytes |
| 18 | put p 1 mul n 4 |
| 19 | put p 2 div add n 31 32 |
| 20 | put p 3 32 |
| 21 | ret 0 |
| 22 | end |