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 / attention-mirror / step.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Step 0 starts; actions 1 allocate, 2 prep, 3 copy, 4 attend, 5 complete; 0 refuses. |
| 3 | note Caller reports completion only after each synchronous operation succeeds. |
| 4 | note A failed allocation or copy cannot advance to attention. No trusted-prefix state exists. |
| 5 | fn native_attnmirnext phase ulong need ulong have ulong ok ulong to ulong |
| 6 | if ne ok 1 |
| 7 | ret 0 |
| 8 | end |
| 9 | if ne need 0 |
| 10 | if or lt need 20608 or gt need 536887424 ne rem need 16 0 |
| 11 | ret 0 |
| 12 | end |
| 13 | end |
| 14 | if eq phase 0 |
| 15 | if gt need have |
| 16 | ret 1 |
| 17 | end |
| 18 | ret 2 |
| 19 | end |
| 20 | if eq phase 1 |
| 21 | if lt have need |
| 22 | ret 0 |
| 23 | end |
| 24 | ret 2 |
| 25 | end |
| 26 | if eq phase 2 |
| 27 | if ne need 0 |
| 28 | ret 3 |
| 29 | end |
| 30 | ret 4 |
| 31 | end |
| 32 | if eq phase 3 |
| 33 | if eq need 0 |
| 34 | ret 0 |
| 35 | end |
| 36 | ret 4 |
| 37 | end |
| 38 | if eq phase 4 |
| 39 | ret 5 |
| 40 | end |
| 41 | ret 0 |
| 42 | end |