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

35 lines · 991 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/arest-gath16.om: argath16 (gpu/nvidia/om/apirest/gath16.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-GATH16"
6text t_gath "gath16"
7fn ax_c rows view uint 34 x view ushort 170 y edit ushort 170 n ulong to ulong
8ret argath16 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 ushort 170 0
16for i ulong 170
17put x i ushort i
18end
19y = new ushort 170 0xffff
20r = ax_c rows x y n
21m = mul n 5
22h = ardg0
23for i ulong m bound 170
24h = ardg h ulong get y i
25end
26put o 0 h
27ret r
28end
29fn arop q view ulong 256 nq ulong ny ulong o edit ulong 256 to ulong
30n = get q 0
31if or or ne nq 1 gt n 34 not ckis 0 t_gath
32ckbad
33end
34ret ax_g n o
35end