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

44 lines · 938 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Copy descriptors: source and destination VAs remain opaque. The executor owns allocation, synchronization and memory movement.
3fn graph_copy q view ulong 16 d edit ulong 16 to ulong
4if ne and or get q 0 or get q 1 get q 2 15 0
5ret 0
6end
7if ge get q 3 get q 2
8ret 2
9end
10part = sub get q 2 get q 3
11if gt part get q 4
12part = get q 4
13end
14put d 0 add get q 0 get q 3
15put d 1 add get q 1 get q 3
16put d 2 part
17put d 3 div part 16
18put d 4 div add div part 16 sub get q 5 1 get q 5
19ret 1
20end
21fn graph_xfer q view ulong 16 d edit ulong 16 to ulong
22if ne and or get q 1 get q 2 15 0
23ret 0
24end
25if gt add get q 1 get q 2 get q 3
26ret 0
27end
28if ge get q 4 get q 2
29ret 2
30end
31part = sub get q 2 get q 4
32if gt part 67108864
33part = 67108864
34end
35put d 2 part
36put d 3 get q 4
37put d 0 add add get q 0 get q 1 get q 4
38put d 1 get q 5
39if eq get q 6 0
40put d 1 get d 0
41put d 0 get q 5
42end
43ret 1
44end