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 / device-trace / body-test.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Compose after vector.om and trace-emit.om. Complete kernels are not body fragments. |
| 3 | note Refusing EXIT must ignore its predicate: even an apparently inactive exit is unsupported. |
| 4 | |
| 5 | fn bsentinel to void |
| 6 | for i ulong 8192 |
| 7 | put gbout i 165 |
| 8 | end |
| 9 | put gboutlen 0 7 |
| 10 | end |
| 11 | |
| 12 | fn brefused on ulong to bool |
| 13 | ok = gtewrap on 2 |
| 14 | if ok |
| 15 | ret false |
| 16 | end |
| 17 | if ne get gterr 0 5 |
| 18 | ret false |
| 19 | end |
| 20 | if ne get gboutlen 0 7 |
| 21 | ret false |
| 22 | end |
| 23 | for i ulong 8192 |
| 24 | if ne get gbout i 165 |
| 25 | ret false |
| 26 | end |
| 27 | end |
| 28 | ret true |
| 29 | end |
| 30 | |
| 31 | fn ballflags to bool |
| 32 | for i ulong 3 |
| 33 | on = add i 1 |
| 34 | if eq i 2 |
| 35 | on = ulong 18446744073709551615 |
| 36 | end |
| 37 | bsentinel |
| 38 | ok = brefused on |
| 39 | if not ok |
| 40 | ret false |
| 41 | end |
| 42 | end |
| 43 | ret true |
| 44 | end |
| 45 | |
| 46 | fn main to int |
| 47 | put gtchecks 0 1 |
| 48 | gbvec |
| 49 | for i ulong get gblen 0 |
| 50 | put gbin i get gbcode i |
| 51 | end |
| 52 | put gbinlen 0 get gblen 0 |
| 53 | ok = ballflags |
| 54 | if not ok |
| 55 | ret 1 |
| 56 | end |
| 57 | note Disabled wrapping of an actual whole kernel remains byte-identical. |
| 58 | ok = gtewrap 0 2 |
| 59 | if not ok |
| 60 | ret 2 |
| 61 | end |
| 62 | if ne get gboutlen 0 get gbinlen 0 |
| 63 | ret 3 |
| 64 | end |
| 65 | for i ulong get gbinlen 0 |
| 66 | if ne get gbout i get gbin i |
| 67 | ret 4 |
| 68 | end |
| 69 | end |
| 70 | note Every predicate field, including PT, P0 and inverted predicates. |
| 71 | put gbinlen 0 16 |
| 72 | for p ulong 16 |
| 73 | for i ulong 16 |
| 74 | put gbin i 0 |
| 75 | end |
| 76 | put gbin 0 77 |
| 77 | put gbin 1 uchar or 9 shl p 4 |
| 78 | ok = ballflags |
| 79 | if not ok |
| 80 | ret 5 |
| 81 | end |
| 82 | end |
| 83 | ret 0 |
| 84 | end |