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 / abft / cul1-unit.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Unit cases for native/abft/cul1.om; concatenated after native/learn53/task.om, tests/learn53/fixtures.om |
| 3 | note and native/abft/cul1.om (tests/abft/driver.om). keval stays the exact oracle; kabft is the checksum. |
| 4 | global ksave uchar 4096 |
| 5 | fn kseeds want int to void |
| 6 | for s ulong 8 |
| 7 | check eq kabft 144 36 add mul s 2654435761 1 want |
| 8 | end |
| 9 | end |
| 10 | fn abclean to void |
| 11 | mat |
| 12 | check eq keval 144 36 0 |
| 13 | kseeds 0 |
| 14 | end |
| 15 | fn abone to void |
| 16 | mat |
| 17 | cw 7 60 |
| 18 | check eq keval 144 36 1 |
| 19 | kseeds 1 |
| 20 | mat |
| 21 | cw 1 1073741845 |
| 22 | check eq keval 144 36 1 |
| 23 | kseeds 1 |
| 24 | mat |
| 25 | cw 1 22 |
| 26 | cw 2 23 |
| 27 | kseeds 1 |
| 28 | end |
| 29 | fn abcanary to void |
| 30 | mat |
| 31 | cw 0 0 |
| 32 | check eq kabft 144 36 1 1 |
| 33 | mat |
| 34 | cw 4 0 |
| 35 | check eq keval 144 36 1 |
| 36 | check eq kabft 144 36 1 1 |
| 37 | mat |
| 38 | cw 8 0 |
| 39 | check eq kabft 144 36 1 1 |
| 40 | end |
| 41 | fn abrect to void |
| 42 | note Declared miss: 2^31 added to C[0][0], C[0][1], C[1][0], C[1][1]; Wolfram 2^31+21 = 2147483669 etc. |
| 43 | mat |
| 44 | cw 1 2147483669 |
| 45 | cw 2 2147483672 |
| 46 | cw 5 2147483695 |
| 47 | cw 6 2147483702 |
| 48 | check eq keval 144 36 1 |
| 49 | kseeds 0 |
| 50 | end |
| 51 | fn abrefuse to void |
| 52 | vec |
| 53 | check eq keval 136 28 0 |
| 54 | check eq kabft 136 28 1 69 |
| 55 | mat |
| 56 | check eq kabft 144 32 1 65 |
| 57 | mat |
| 58 | tw 21 1 |
| 59 | check eq kabft 144 36 1 65 |
| 60 | end |
| 61 | fn abpure to void |
| 62 | mat |
| 63 | for i ulong 4096 |
| 64 | put ksave i get kt i |
| 65 | end |
| 66 | check eq kabft 144 36 7 0 |
| 67 | same = true |
| 68 | for i ulong 4096 |
| 69 | if ne get ksave i get kt i |
| 70 | same = false |
| 71 | end |
| 72 | end |
| 73 | check same |
| 74 | end |
| 75 | fn main to int |
| 76 | abclean |
| 77 | abone |
| 78 | abcanary |
| 79 | abrect |
| 80 | abrefuse |
| 81 | abpure |
| 82 | if ne get tally 1 0 |
| 83 | ret 1 |
| 84 | end |
| 85 | ret 0 |
| 86 | end |