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

32 lines · 754 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/hostrest.om: the Omega port of CUDApp tests/api_hostrest_test.c. Composed after
3note gpu/nvidia/om/apiviews/hostrest.om (the ah_rest unit) and gpu/nvidia/checks/lib.om; run with
4note gpu/nvidia/checks/hostrest.tsv. Row: OP P0 .. P8 R in lowercase hex; ah_rest OP over P (P9 .. P15
5note zero) must be R.
6text t_name "HOSTREST"
7fn cname to void
8for i ulong len t_name bound 64
9ckoc ulong get t_name i
10end
11end
12fn hrx i ulong to ulong
13n = cklen i
14if or eq n 0 gt n 16
15ckbad
16end
17v = ulong 0
18for j ulong n bound 16
19v = or shl v 4 cknib ckch i j
20end
21ret v
22end
23fn crow to bool
24if ne ckcnt 11
25ckbad
26end
27p = new ulong 16 0
28for k ulong 9
29put p k hrx add k 1
30end
31ret eq ah_rest hrx 0 view p hrx 10
32end