interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / om / streams / xq.om

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