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

31 lines · 899 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/plat_policy.om: the Omega port of CUDApp tests/platform_linux_policy.c. Composed after
3note gpu/nvidia/om/platform-linux/plat_policy.om and gpu/nvidia/checks/lib.om; run with
4note gpu/nvidia/checks/plat_policy.tsv, whose rows the C oracle plat_c wrote for every case of the old test.
5note Case: NAME, m[0..15], WANT, q[0..15]. plat_policy m q, with q starting at zero, must return WANT and leave
6note exactly q[0..15] in q (the old test's byte compare of the result and the whole reply).
7text t_name "PLAT_POLICY"
8fn cname to void
9for i ulong len t_name bound 64
10ckoc ulong get t_name i
11end
12end
13fn crow to bool
14if ne ckcnt 34
15ckbad
16end
17m = new ulong 16 0
18q = new ulong 16 0
19for i ulong 16
20put m i cknum add i 1
21end
22if ne plat_policy m q cknum 17
23ret false
24end
25for i ulong 16
26if ne get q i cknum add i 18
27ret false
28end
29end
30ret true
31end