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

51 lines · 1410 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/gdn_admit.om: the Omega port of CUDApp tests/gdn_admit_diff.c. Composed after gpu/nvidia/om/gdn/admit.om
3note and gpu/nvidia/checks/lib.om; run with gpu/nvidia/checks/gdn_admit.tsv, whose expected values the retained C
4note admission oracle (src/omega_gpu_gdn_admit.c, CUDAPP_MIGRATION_PENDING_C_GDN_ADMIT) wrote over the domain of the
5note old differential (each predicate at v-1/v/v+1, 0 and the extremes of every field, the non-finite f32 classes,
6note every alignment residue class).
7note Case: OP A B C I0..I6 R O0..O9. o[0..6] = I0..I6, then gdn_admit OP A B C o must refuse (1) exactly when R is 1;
8note when admitted, the outputs the C binding reads back must equal O: shape and alloc o[0..9], layout o[0..6], move
9note o[0]. The other ops return a verdict only.
10text t_name "GDN_ADMIT"
11fn cname to void
12for i ulong len t_name bound 64
13ckoc ulong get t_name i
14end
15end
16note how many outputs of gdn_admit OP the C binding reads
17fn gouts op ulong to ulong
18if or eq op 1 eq op 2
19ret 10
20end
21if eq op 7
22ret 7
23end
24if eq op 8
25ret 1
26end
27ret 0
28end
29fn crow to bool
30if ne ckcnt 22
31ckbad
32end
33o = new ulong 16 0
34for j ulong 7
35put o j cknum add 4 j
36end
37op = cknum 0
38r = gdn_admit op cknum 1 cknum 2 cknum 3 o
39if ne r cknum 11
40ret false
41end
42if ne r 0
43ret true
44end
45for j ulong gouts op bound 10
46if ne get o j cknum add 12 j
47ret false
48end
49end
50ret true
51end