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
omega-mv / gpu / nvidia / checks / arest-gath16.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note gpu/nvidia/checks/arest-gath16.om: argath16 (gpu/nvidia/om/apirest/gath16.om), as data_parts() of CUDApp |
| 3 | note 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 |
| 4 | note the digest of the n * 5 gathered words. Composed before arestg.om. |
| 5 | text t_name "AREST-GATH16" |
| 6 | text t_gath "gath16" |
| 7 | fn ax_c rows view uint 34 x view ushort 170 y edit ushort 170 n ulong to ulong |
| 8 | ret argath16 part rows 0 n part x 0 170 part y 0 mul n 5 |
| 9 | end |
| 10 | fn ax_g n ulong o edit ulong 256 to ulong |
| 11 | rows = new uint 34 0 |
| 12 | for i ulong n bound 34 |
| 13 | put rows i uint sub 33 i |
| 14 | end |
| 15 | x = new ushort 170 0 |
| 16 | for i ulong 170 |
| 17 | put x i ushort i |
| 18 | end |
| 19 | y = new ushort 170 0xffff |
| 20 | r = ax_c rows x y n |
| 21 | m = mul n 5 |
| 22 | h = ardg0 |
| 23 | for i ulong m bound 170 |
| 24 | h = ardg h ulong get y i |
| 25 | end |
| 26 | put o 0 h |
| 27 | ret r |
| 28 | end |
| 29 | fn arop q view ulong 256 nq ulong ny ulong o edit ulong 256 to ulong |
| 30 | n = get q 0 |
| 31 | if or or ne nq 1 gt n 34 not ckis 0 t_gath |
| 32 | ckbad |
| 33 | end |
| 34 | ret ax_g n o |
| 35 | end |