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 / graph / prefill.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Copy descriptors: source and destination VAs remain opaque. The executor owns allocation, synchronization and memory movement. |
| 3 | fn graph_copy q view ulong 16 d edit ulong 16 to ulong |
| 4 | if ne and or get q 0 or get q 1 get q 2 15 0 |
| 5 | ret 0 |
| 6 | end |
| 7 | if ge get q 3 get q 2 |
| 8 | ret 2 |
| 9 | end |
| 10 | part = sub get q 2 get q 3 |
| 11 | if gt part get q 4 |
| 12 | part = get q 4 |
| 13 | end |
| 14 | put d 0 add get q 0 get q 3 |
| 15 | put d 1 add get q 1 get q 3 |
| 16 | put d 2 part |
| 17 | put d 3 div part 16 |
| 18 | put d 4 div add div part 16 sub get q 5 1 get q 5 |
| 19 | ret 1 |
| 20 | end |
| 21 | fn graph_xfer q view ulong 16 d edit ulong 16 to ulong |
| 22 | if ne and or get q 1 get q 2 15 0 |
| 23 | ret 0 |
| 24 | end |
| 25 | if gt add get q 1 get q 2 get q 3 |
| 26 | ret 0 |
| 27 | end |
| 28 | if ge get q 4 get q 2 |
| 29 | ret 2 |
| 30 | end |
| 31 | part = sub get q 2 get q 4 |
| 32 | if gt part 67108864 |
| 33 | part = 67108864 |
| 34 | end |
| 35 | put d 2 part |
| 36 | put d 3 get q 4 |
| 37 | put d 0 add add get q 0 get q 1 get q 4 |
| 38 | put d 1 get q 5 |
| 39 | if eq get q 6 0 |
| 40 | put d 1 get d 0 |
| 41 | put d 0 get q 5 |
| 42 | end |
| 43 | ret 1 |
| 44 | end |