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 / components / api_policy.om

70 lines · 1024 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Pure shape refusals at CUDApp b774723. Result 0 accepted, 1 bad, 2 too large.
3note Modes 0 matmul; 1 rmsnorm; 2 rope; 3 attention heads; 4 bounded subrange;
4note 5 bf16 weight shape; 6 router expert shape. Pointer admission stays in C.
5fn api_policy mode ulong a ulong b ulong c ulong to ulong
6if eq mode 0
7if or eq a 0 or eq b 0 eq c 0
8ret 1
9end
10if or gt a 8192 or gt b 16384 gt c 262144
11ret 2
12end
13ret 0
14end
15if eq mode 1
16if or eq a 0 or eq b 0 ne rem b 128 0
17ret 1
18end
19if gt b 16384
20ret 2
21end
22ret 0
23end
24if eq mode 2
25if or eq a 0 or lt b 2 ne and b 1 0
26ret 1
27end
28if gt b 2048
29ret 2
30end
31ret 0
32end
33if eq mode 3
34if or eq a 0 or eq b 0 eq c 0
35ret 1
36end
37if or gt c 256 gt a 1024
38ret 2
39end
40if ne rem a b 0
41ret 1
42end
43ret 0
44end
45if eq mode 4
46if gt a c
47ret 1
48end
49if gt b sub c a
50ret 1
51end
52ret 0
53end
54if eq mode 5
55if or eq a 0 or eq b 0 ne rem b 256 0
56ret 1
57end
58if gt b c
59ret 2
60end
61ret 0
62end
63if eq mode 6
64if or and ne a 128 ne a 256 gt b 1
65ret 1
66end
67ret 0
68end
69ret 1
70end