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

39 lines · 1029 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/arest-gath32.om: argath32 (gpu/nvidia/om/apirest/gath32.om), as data_parts() of CUDApp
3note tests/api_rest_partitions.h calls it. Q n; rows[i] = 33 - i, x the test's 170 words of 34 rows of 5; output 0
4note the digest of the n * 5 gathered words. Composed before arestg.om.
5text t_name "AREST-GATH32"
6text t_gath "gath32"
7fn ax_c rows view uint 34 x view uint 170 y edit uint 170 n ulong to ulong
8ret argath32 part rows 0 n part x 0 170 part y 0 mul n 5
9end
10fn ax_g n ulong o edit ulong 256 to ulong
11rows = new uint 34 0
12for i ulong n bound 34
13put rows i uint sub 33 i
14end
15x = new uint 170 0
16for i ulong 170
17if eq rem i 2 1
18put x i 4294967295
19else
20put x i uint i
21end
22end
23y = new uint 170 0x5a5a5a5a
24r = ax_c rows x y n
25m = mul n 5
26h = ardg0
27for i ulong m bound 170
28h = ardg h ulong get y i
29end
30put o 0 h
31ret r
32end
33fn arop q view ulong 256 nq ulong ny ulong o edit ulong 256 to ulong
34n = get q 0
35if or or ne nq 1 gt n 34 not ckis 0 t_gath
36ckbad
37end
38ret ax_g n o
39end