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