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 / group.om

69 lines · 1338 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Fixed public byte spans avoid a dynamic-view ABI. C marshals each eight-id row and scatters the returned stable-map entries.
3fn gr_id ids view uchar 32 slot ulong to ulong
4p = mul slot 4
5ret ulong get ids p
6end
7fn gr_rate cnt ulong bytes ulong to ulong
8ret mul div add cnt 3 4 bytes
9end
10fn mg_group c view ulong 16 ids view uchar 32 st edit ulong 512 out edit ulong 32 to ulong
11for i ulong 32
12put out i 0
13end
14if eq get c 0 0
15for s ulong 8
16e = gr_id ids s
17put st e add get st e 1
18end
19ret 1
20end
21if eq get c 0 1
22e = get c 6
23for i ulong sub 256 e
24if ne get st e 0
25put out 0 e
26put out 1 get c 7
27put out 2 get st e
28put out 3 get st e
29if eq get c 3 2
30if gt get st e 1
31put out 3 sub get st e 1
32end
33end
34put out 4 gr_rate get st e get c 4
35put st add e 256 get c 7
36ret 1
37end
38e = add e 1
39end
40put out 0 256
41ret 1
42end
43if eq get c 0 2
44for s ulong 8
45e = gr_id ids s
46p = get st add e 256
47put out mul s 4 p
48put out add mul s 4 1 get c 2
49put out add mul s 4 2 p
50put out add mul s 4 3 add mul get c 2 9 s
51put st add e 256 add p 1
52end
53ret 1
54end
55if eq get c 0 3
56put out 0 get c 2
57put out 1 add mul get c 2 9 8
58ret 1
59end
60if eq get c 0 4
61put out 0 mul get c 1 8
62put out 1 add get out 0 get c 5
63put out 2 get c 1
64put out 3 add get c 1 get c 5
65put out 4 gr_rate get c 1 get c 4
66ret 1
67end
68ret 0
69end