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 / pipeline / cache-caller.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Actual compiled policy->cache caller; synthetic records, no GPU/model claim. |
| 3 | fn main to int |
| 4 | q = new ulong 64 0 |
| 5 | a = new ulong 1024 0 |
| 6 | p = new ulong 528 0 |
| 7 | o = new ulong 16 0 |
| 8 | lease = new ulong 16 0 |
| 9 | req = new ulong 16 0 |
| 10 | pl_fixture q a |
| 11 | note Existing session recoveries begins at zero: no invented nonzero epoch. |
| 12 | put q 3 0 |
| 13 | put a 17 0 |
| 14 | put a 81 0 |
| 15 | put a 145 0 |
| 16 | rc = kc_init p 0 1 128 1 |
| 17 | if ne rc 0 |
| 18 | ret 1 |
| 19 | end |
| 20 | note Selection cannot upload or fabricate residency during graph recording. |
| 21 | if ne pl_pin q a p o lease 75 |
| 22 | ret 2 |
| 23 | end |
| 24 | if ne get lease 0 0 |
| 25 | ret 3 |
| 26 | end |
| 27 | put req 0 0 |
| 28 | put req 1 1 |
| 29 | put req 2 1 |
| 30 | put req 7 1 |
| 31 | for j ulong 4 |
| 32 | put req add 3 j get a add 85 j |
| 33 | end |
| 34 | if ne kc_prepare p req 1 |
| 35 | ret 4 |
| 36 | end |
| 37 | if ne kc_commit p 0 1 0 0 |
| 38 | ret 5 |
| 39 | end |
| 40 | if ne pl_pin q a p o lease 0 |
| 41 | ret 6 |
| 42 | end |
| 43 | if ne get o 1 1 |
| 44 | ret 7 |
| 45 | end |
| 46 | note Cache identity is the exact chosen canonical artifact, not shape alone. |
| 47 | for j ulong 4 |
| 48 | if ne get lease add 4 j get a add 85 j |
| 49 | ret 8 |
| 50 | end |
| 51 | end |
| 52 | if ne kc_acquire p get lease 1 get lease 2 get lease 3 0 |
| 53 | ret 9 |
| 54 | end |
| 55 | if ne kc_retire p get lease 1 get lease 2 get lease 3 0 |
| 56 | ret 10 |
| 57 | end |
| 58 | if ne kc_unpin p get lease 1 get lease 2 get lease 3 0 |
| 59 | ret 11 |
| 60 | end |
| 61 | note Recovery invalidates an old selection and old recorded/inflight tokens. |
| 62 | if ne kc_invalidate p 2 1 0 |
| 63 | ret 12 |
| 64 | end |
| 65 | if ne kc_acquire p get lease 1 get lease 2 get lease 3 -2 |
| 66 | ret 13 |
| 67 | end |
| 68 | if ne pl_pin q a p o lease 75 |
| 69 | ret 14 |
| 70 | end |
| 71 | for j ulong 16 |
| 72 | if ne get o j 0 |
| 73 | ret 15 |
| 74 | end |
| 75 | if ne get lease j 0 |
| 76 | ret 16 |
| 77 | end |
| 78 | end |
| 79 | ret 0 |
| 80 | end |