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 / speculation / vector-checks-test.om
| 1 | note CPU-only regression at the seeded dynamic-loop limit, no device opens. |
| 2 | global gbmem long 8 |
| 3 | global gbmax uint 1 |
| 4 | text ok "VECTOR_CHECKS_HOST_PASS\n" |
| 5 | fn ck yes bool to void |
| 6 | if not yes |
| 7 | exit int 80 |
| 8 | end |
| 9 | end |
| 10 | fn supply i ulong to void |
| 11 | ck eq mapget get gbmem 5 mul i 4 4 aval i 257 |
| 12 | ck eq mapget get gbmem 6 mul i 4 4 bval i 257 |
| 13 | ck eq mapget get gbmem 7 mul i 4 4 xor expect i 257 4294967295 |
| 14 | r = mapset get gbmem 7 mul i 4 4 expect i 257 |
| 15 | end |
| 16 | fn run n uint to void |
| 17 | put gbmax 0 add n 64 |
| 18 | for i ulong 3 |
| 19 | m = mapnew neg int 1 0 mul ulong get gbmax 0 4 3 34 |
| 20 | ck gt m 0 |
| 21 | put gbmem add i 5 m |
| 22 | end |
| 23 | prepare n 257 |
| 24 | note Check every prepared input and poison value, then supply the expected result. |
| 25 | base = ulong 0 |
| 26 | while lt base ulong n |
| 27 | count = sub ulong n base |
| 28 | if gt count 65536 |
| 29 | count = ulong 65536 |
| 30 | end |
| 31 | for j ulong count |
| 32 | supply add base j |
| 33 | end |
| 34 | base = add base count |
| 35 | end |
| 36 | verify n 257 false |
| 37 | r = mapset get gbmem 7 mul sub ulong n 1 4 4 xor expect sub ulong n 1 257 1 |
| 38 | verify n 257 true |
| 39 | for i ulong 3 |
| 40 | ck eq mapdrop get gbmem add i 5 0 |
| 41 | end |
| 42 | end |
| 43 | fn main to int |
| 44 | run 1 |
| 45 | run 999999 |
| 46 | run 1000000 |
| 47 | run 1000001 |
| 48 | run 1048576 |
| 49 | ck eq write 1 ok 0 len ok long len ok |
| 50 | ret 0 |
| 51 | end |