interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / gpu / nvidia / om / graph / pf_order.om

118 lines · 1589 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Prefill mixer shares batch descriptor roles. Every token/recurrence dependency is selected here, never by the executor.
3fn gr_pord c view ulong 16 v view ulong 64 p ulong to ulong
4n = get v 30
5tail = add ulong 4 mul n 3
6multi = get c 3
7if or eq get c 5 1 eq get c 5 3
8multi = 0
9end
10if ne get c 2 0
11tail = add ulong 8 mul n 2
12else
13if ne multi 0
14tail = 6
15end
16end
17if lt p 4
18if eq p 0
19if ne get c 1 0
20ret shl ulong 20 32
21end
22ret 0
23end
24if eq p 1
25ret shl ulong 21 32
26end
27if eq p 2
28if eq get c 2 0
29ret shl ulong 22 32
30end
31ret 0
32end
33ret shl ulong 23 32
34end
35if lt p tail
36if eq get c 2 0
37if ne multi 0
38if eq p 4
39ret shl ulong 42 32
40end
41ret shl ulong 41 32
42end
43j = sub p 4
44t = div j 3
45if eq get c 5 1
46if ge n 2
47if ge add t 2 n
48if eq add t 2 n
49t = sub n 1
50else
51t = sub n 2
52end
53end
54end
55end
56if eq rem j 3 0
57ret or shl ulong 24 32 t
58end
59if eq rem j 3 1
60if eq get c 5 3
61if lt add t 1 n
62ret 0
63end
64end
65ret or shl ulong 25 32 t
66end
67if eq get c 5 3
68if gt t 0
69ret or shl ulong 43 32 sub t 1
70end
71end
72ret 0
73end
74if eq p 4
75ret shl ulong 26 32
76end
77if eq p 5
78if ne get c 4 0
79ret shl ulong 44 32
80end
81ret 0
82end
83if eq add p 1 tail
84ret shl ulong 41 32
85end
86if eq add p 2 tail
87if ne get c 4 0
88if ne get c 9 3
89ret shl ulong 45 32
90end
91end
92ret 0
93end
94j = sub p 6
95t = div j 2
96if ne get c 4 0
97if ne get c 9 3
98ret 0
99end
100if eq rem j 2 0
101ret 0
102end
103end
104ret or shl add ulong 27 rem j 2 32 t
105end
106j = sub p tail
107if eq j 0
108ret shl ulong 30 32
109end
110if eq j 1
111ret shl ulong 31 32
112end
113j = mul sub j 2 get v 62
114if ge j n
115ret shl ulong 255 32
116end
117ret or shl ulong 32 32 j
118end