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-tile.om

106 lines · 2038 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/arest-tile.om: the units over gpu/nvidia/om/apirest/tiledata.om: argroups, arrun, artiles,
3note artile, artg, argtile, as tile_parts() and misc_parts() of CUDApp tests/api_rest_partitions.h call them.
4note Composed before arestg.om.
5text t_name "AREST-TILE"
6text t_groups "groups"
7text t_run "run"
8text t_tiles "tiles"
9text t_tile "tile"
10text t_tg "tg"
11text t_gtile "gtile"
12note Q the four q words, n, n ids, n rows
13fn ax_groups q view ulong 256 nq ulong to ulong
14n = get q 4
15if or gt n 64 ne nq add 5 mul n 2
16ckbad
17end
18a = new ulong 4 0
19for i ulong 4
20put a i get q i
21end
22ids = new uint 64 0
23rows = new uint 64 0
24for i ulong n bound 64
25put ids i uint get q add 5 i
26put rows i uint get q add add 5 n i
27end
28ret argroups a part ids 0 n part rows 0 n
29end
30note Q i, n, n ids
31fn ax_run q view ulong 256 nq ulong to ulong
32n = get q 1
33if or gt n 64 ne nq add 2 n
34ckbad
35end
36ids = new uint 64 0
37for i ulong n bound 64
38put ids i uint get q add 2 i
39end
40ret arrun get q 0 part ids 0 n
41end
42note Q the eight q words; for tiles (m 0) three counts follow; m 1 is artile, 2 artg, 3 argtile (q edited)
43fn ax_t q view ulong 256 ny ulong o edit ulong 256 m ulong to ulong
44if gt ny 128
45ckbad
46end
47a = new ulong 8 0
48for i ulong 8
49put a i get q i
50end
51cnt = new uint 3 0
52if eq m 0
53for i ulong 3
54put cnt i uint get q add 8 i
55end
56end
57y = new ulong 128 0x5a5a5a5a5a5a5a5a
58r = ulong 0
59if eq m 0
60r = artiles a part cnt 0 3 part y 0 ny
61end
62if eq m 1
63r = artile a part y 0 ny
64end
65if eq m 2
66r = artg a part y 0 ny
67end
68if eq m 3
69r = argtile a part y 0 ny
70end
71for i ulong 128
72put o i get y i
73end
74for i ulong 8
75put o add 128 i get a i
76end
77ret r
78end
79fn arop q view ulong 256 nq ulong ny ulong o edit ulong 256 to ulong
80if ckis 0 t_groups
81ret ax_groups q nq
82end
83if ckis 0 t_run
84ret ax_run q nq
85end
86if ckis 0 t_tiles
87if ne nq 11
88ckbad
89end
90ret ax_t q ny o 0
91end
92if ne nq 8
93ckbad
94end
95if ckis 0 t_tile
96ret ax_t q ny o 1
97end
98if ckis 0 t_tg
99ret ax_t q ny o 2
100end
101if ckis 0 t_gtile
102ret ax_t q ny o 3
103end
104ckbad
105ret 0
106end