CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / tests / learn53 / catalog-unit.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | fn ctest to void |
| 3 | for i ulong 8 |
| 4 | id = add i 1 |
| 5 | cvalues id |
| 6 | n = kload id |
| 7 | check eq n csize id |
| 8 | check eq kvalid n 0 |
| 9 | check eq kw 16 id |
| 10 | check eq kw 14 1 |
| 11 | check eq kw 4 0 |
| 12 | check eq kw 21 0 |
| 13 | check eq kw 22 0 |
| 14 | check eq keval n coutn id 0 |
| 15 | last = sub div coutn id 4 2 |
| 16 | cw last 4294967294 |
| 17 | check eq keval n coutn id 1 |
| 18 | end |
| 19 | end |
| 20 | fn cstable to void |
| 21 | n = kload 1 |
| 22 | cvalues 1 |
| 23 | for i ulong 4096 |
| 24 | put saved i get kt i |
| 25 | end |
| 26 | check eq kload 0 0 |
| 27 | check eq kload 9 0 |
| 28 | check eq kload 18446744073709551615 0 |
| 29 | same = true |
| 30 | for i ulong 4096 |
| 31 | if ne get saved i get kt i |
| 32 | same = false |
| 33 | end |
| 34 | end |
| 35 | check same |
| 36 | check eq keval n 28 0 |
| 37 | note Loading a task must not forge or erase observed candidate output. |
| 38 | cw 3 12 |
| 39 | check eq kload 1 136 |
| 40 | check eq kc 3 12 |
| 41 | check eq keval 136 28 1 |
| 42 | note Poisoned task policy is reset by compiled catalog, not honored. |
| 43 | tw 21 1 |
| 44 | tw 22 99 |
| 45 | tw 14 3 |
| 46 | tw 16 99 |
| 47 | tw 28 0 |
| 48 | check eq kload 1 136 |
| 49 | cvalues 1 |
| 50 | check eq keval 136 28 0 |
| 51 | same = true |
| 52 | for i ulong 4096 |
| 53 | if ne get saved i get kt i |
| 54 | same = false |
| 55 | end |
| 56 | end |
| 57 | check same |
| 58 | end |
| 59 | fn main to int |
| 60 | ctest |
| 61 | cstable |
| 62 | if ne get tally 1 0 |
| 63 | ret 1 |
| 64 | end |
| 65 | ret 0 |
| 66 | end |