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 / encoder / bw_spec_native.om

94 lines · 1735 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Function-mode host probe. Concatenate bw_enc_sm121 and bw_spec_sm121 first.
3note Mode 0 must return 0; mode 1 corrupts an expected operand byte and returns 1;
4note mode 2 returns the real raw SHFL range refusal E_RANGE, never a setup error.
5fn np_eq a view ulong 4 b view ulong 4 to bool
6for i ulong 4
7if ne get a i get b i
8ret false
9end
10end
11ret true
12end
13fn sp_native_probe mode ulong to ulong
14state = new ulong 3001 0
15fresh = new ulong 3001 0
16o = new ulong 16 0
17dec = new ulong 16 0
18w = new ulong 4 4294967295
19ref = new ulong 4 0
20if ne sp_dec state w dec E_NOMAT
21ret 10
22end
23if ne get state 3000 1
24ret 11
25end
26if eq mode 2
27put o 0 42
28put o 6 32
29ret sp_enc state o w
30end
31note Warmed table mutation must survive cached initialization and change semantics.
32put o 0 1
33put o 1 5
34if ne enc1 o ref E_OK
35ret 12
36end
37shift = get state 57
38put state 57 add shift 1
39status = sp_enc state o w
40put state 57 shift
41if ne status E_OK
42ret 13
43end
44if np_eq w ref
45ret 14
46end
47if ne sp_dec state w dec E_OK
48ret 15
49end
50if eq get dec 1 get o 1
51ret 16
52end
53note Another zero-filled owner must retain canonical bytes independently.
54if ne get fresh 3000 0
55ret 17
56end
57if ne sp_enc fresh o w E_OK
58ret 18
59end
60if not np_eq w ref
61ret 19
62end
63note RRU full GPR destination and explicit uniform-source flags survive native calls.
64put o 0 8
65put o 1 32
66put o 2 1
67put o 4 3
68put o 5 2
69put o 8 1
70put o 12 1
71put o 14 1
72if ne enc1 o ref E_OK
73ret 20
74end
75if ne sp_enc state o w E_OK
76ret 21
77end
78if eq mode 1
79put ref 0 xor get ref 0 65536
80end
81if not np_eq w ref
82ret 1
83end
84if ne sp_dec state w dec E_OK
85ret 22
86end
87if or ne get dec 1 32 ne get dec 5 2
88ret 23
89end
90if or ne get dec 8 1 ne get dec 14 1
91ret 24
92end
93ret 0
94end