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 / checks / arest-pfhost.om

80 lines · 1491 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/arest-pfhost.om: pfreg and pfcount (gpu/nvidia/om/apirest/pfhost.om) through the root arpfreg
3note (pfreg.om), as CUDApp tests/test_prefill_host_rest.c calls them. Unit pfreg: Q w, d. Unit pfcount: Q n, over
4note the test's x (eleven bit patterns in turn); the answer is the count of -999.0f. Unit pfsweep: Q the largest n;
5note the answer is the digest of the counts for every n from 0 up to it, the test's whole loop. Composed before
6note arestg.om.
7text t_name "AREST-PFHOST"
8text t_pfreg "pfreg"
9text t_pfcount "pfcount"
10text t_pfsweep "pfsweep"
11fn ax_cls k ulong to uint
12if eq k 0
13ret 0
14end
15if eq k 1
16ret 0x80000000
17end
18if eq k 2
19ret 1
20end
21if eq k 3
22ret 0x80000001
23end
24if eq k 4
25ret 0x7f800000
26end
27if eq k 5
28ret 0xff800000
29end
30if eq k 6
31ret 0x7fc00000
32end
33if eq k 7
34ret 0x7f800001
35end
36if eq k 8
37ret 0xc479c000
38end
39if eq k 9
40ret 0xc479bfff
41end
42ret 0xc479c001
43end
44fn ax_cnt q view ulong 256 sweep bool to ulong
45n = get q 0
46if gt n 4096
47ckbad
48end
49x = new f32 4096 0.0f32
50for i ulong 4096
51put x i bitcast f32 ax_cls rem i 11
52end
53if not sweep
54ret pfcount part x 0 n
55end
56h = ardg0
57for k ulong add n 1 bound 4097
58h = ardg h pfcount part x 0 k
59end
60ret h
61end
62fn arop q view ulong 256 nq ulong ny ulong o edit ulong 256 to ulong
63if ckis 0 t_pfreg
64if ne nq 2
65ckbad
66end
67ret arpfreg uint get q 0 uint get q 1
68end
69if ne nq 1
70ckbad
71end
72if ckis 0 t_pfcount
73ret ax_cnt q false
74end
75if ckis 0 t_pfsweep
76ret ax_cnt q true
77end
78ckbad
79ret 0
80end