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-copy.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note gpu/nvidia/checks/arest-copy.om: arcopy (gpu/nvidia/om/apirest/copy.om), as data_parts() of CUDApp |
| 3 | note tests/api_rest_partitions.h calls it. Q n; bytes[i] = (unsigned char)i. The copy runs twice, into bytes that |
| 4 | note are all 0 and into bytes that are all 255; outputs 0 and 1 are the digests of the n copied bytes, so a byte |
| 5 | note the unit does not write differs from the table in one of them. Composed before arestg.om. |
| 6 | text t_name "AREST-COPY" |
| 7 | text t_copy "copy" |
| 8 | fn ax_c x view uchar 65537 n ulong m uchar o edit ulong 256 k ulong to ulong |
| 9 | y = new uchar 65537 m |
| 10 | r = arcopy part x 0 n part y 0 n |
| 11 | h = ardg0 |
| 12 | for i ulong n bound 65537 |
| 13 | h = ardg h ulong get y i |
| 14 | end |
| 15 | put o k h |
| 16 | ret r |
| 17 | end |
| 18 | fn arop q view ulong 256 nq ulong ny ulong o edit ulong 256 to ulong |
| 19 | n = get q 0 |
| 20 | if or or ne nq 1 gt n 65537 not ckis 0 t_copy |
| 21 | ckbad |
| 22 | end |
| 23 | x = new uchar 65537 0 |
| 24 | for i ulong 65537 |
| 25 | put x i uchar and i 255 |
| 26 | end |
| 27 | r = ax_c x n 0 o 0 |
| 28 | if ne ax_c x n 255 o 1 r |
| 29 | ckbad |
| 30 | end |
| 31 | ret r |
| 32 | end |