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

64 lines · 1274 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/attnhost.om: the Omega port of the policy and clock blocks of CUDApp
3note tests/attn_host_diff.c (its scan block is gpu/nvidia/checks/attnscan.om). Composed after
4note gpu/nvidia/om/api/attn_host.om (ah_plan), gpu/nvidia/om/api/clock_ns.om (clock_ns) and
5note gpu/nvidia/checks/lib.om; run with gpu/nvidia/checks/attnhost.tsv. Rows, lowercase hex:
6note p OP IN0..IN22 R OUT0..OUT22: ah_plan on q = IN (q 23..31 zero) answers R and leaves q = OUT, with
7note q 23..31 still zero.
8note c S NS R: clock_ns S NS answers R.
9text t_name "ATTNHOST"
10fn cname to void
11for i ulong len t_name bound 64
12ckoc ulong get t_name i
13end
14end
15fn ahx i ulong to ulong
16n = cklen i
17if or eq n 0 gt n 16
18ckbad
19end
20v = ulong 0
21for j ulong n bound 16
22v = or shl v 4 cknib ckch i j
23end
24ret v
25end
26fn prow to bool
27if ne ckcnt 49
28ckbad
29end
30q = new ulong 32 0
31for k ulong 23
32put q k ahx add k 2
33end
34r = ah_plan q uint ahx 1
35ok = eq r ahx 25
36for k ulong 23
37if ne get q k ahx add k 26
38ok = false
39end
40end
41for k ulong 9
42if ne get q add k 23 0
43ok = false
44end
45end
46ret ok
47end
48fn crow to bool
49if ne cklen 0 1
50ckbad
51end
52k = ckch 0 0
53if eq k 112
54ret prow
55end
56if eq k 99
57if ne ckcnt 4
58ckbad
59end
60ret eq clock_ns ahx 1 ahx 2 ahx 3
61end
62ckbad
63ret false
64end