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
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note C4 extra-queue admission, scalar form for the freestanding engine. bridge-freest admits scalar |
| 3 | note parameters, literal shift counts and no loops, so the three queues are spelled out. |
| 4 | note i is the queue index; open has bit j set when queue j is already open (bits 1..3; other bits ignored). |
| 5 | note Same rule as op 6 of om/streams/streams.om: 0 index outside 1..3, 1 already open, 2 out of order, 3 open it. |
| 6 | fn streams_xq i ulong open ulong to ulong |
| 7 | if or eq i 0 gt i 3 |
| 8 | ret 0 |
| 9 | end |
| 10 | q1 = and shr open 1 1 |
| 11 | q2 = and shr open 2 1 |
| 12 | q3 = and shr open 3 1 |
| 13 | if eq i 1 |
| 14 | if ne q1 0 |
| 15 | ret 1 |
| 16 | end |
| 17 | ret 3 |
| 18 | end |
| 19 | if eq i 2 |
| 20 | if ne q2 0 |
| 21 | ret 1 |
| 22 | end |
| 23 | if eq q1 0 |
| 24 | ret 2 |
| 25 | end |
| 26 | ret 3 |
| 27 | end |
| 28 | if ne q3 0 |
| 29 | ret 1 |
| 30 | end |
| 31 | if or eq q1 0 eq q2 0 |
| 32 | ret 2 |
| 33 | end |
| 34 | ret 3 |
| 35 | end |