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 / context.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Synthetic private graph contexts; no evaluator or hardware qualification. |
| 3 | fn main to int |
| 4 | keys = new ulong 128 0 |
| 5 | actual = new ulong 4 0 |
| 6 | if ne native_context keys 0 actual 0 |
| 7 | ret 1 |
| 8 | end |
| 9 | put actual 0 99 |
| 10 | if ne native_context keys 33 actual -1 |
| 11 | ret 2 |
| 12 | end |
| 13 | if ne native_context keys 18446744073709551615 actual -1 |
| 14 | ret 3 |
| 15 | end |
| 16 | put actual 0 1 |
| 17 | put actual 1 3 |
| 18 | put actual 3 8 |
| 19 | for i ulong 32 |
| 20 | put keys mul i 4 1 |
| 21 | put keys add mul i 4 1 3 |
| 22 | put keys add mul i 4 2 i |
| 23 | put keys add mul i 4 3 8 |
| 24 | end |
| 25 | for i ulong 32 |
| 26 | put actual 2 i |
| 27 | if ne native_context keys 32 actual long add i 1 |
| 28 | ret 4 |
| 29 | end |
| 30 | end |
| 31 | note No active context, or an excluded late context, is not a default binding. |
| 32 | put actual 2 31 |
| 33 | if ne native_context keys 0 actual 0 |
| 34 | ret 5 |
| 35 | end |
| 36 | if ne native_context keys 31 actual 0 |
| 37 | ret 6 |
| 38 | end |
| 39 | note Every tuple field participates: operation,layer,window start,window rows. |
| 40 | put actual 2 0 |
| 41 | for j ulong 4 |
| 42 | old = get actual j |
| 43 | put actual j 123 |
| 44 | if ne native_context keys 32 actual 0 |
| 45 | ret 7 |
| 46 | end |
| 47 | put actual j old |
| 48 | end |
| 49 | note Duplicate matches refuse rather than silently choosing first or last. |
| 50 | for j ulong 4 |
| 51 | put keys add 124 j get keys j |
| 52 | end |
| 53 | if ne native_context keys 32 actual -1 |
| 54 | ret 8 |
| 55 | end |
| 56 | note Unrelated duplicate registrations cannot change a different exact context. |
| 57 | put actual 2 2 |
| 58 | if ne native_context keys 32 actual 3 |
| 59 | ret 9 |
| 60 | end |
| 61 | put actual 2 123 |
| 62 | if ne native_context keys 32 actual 0 |
| 63 | ret 10 |
| 64 | end |
| 65 | note Context ordinals intentionally track immutable registry order, not a tuner. |
| 66 | put actual 2 0 |
| 67 | if ne native_context keys 1 actual 1 |
| 68 | ret 11 |
| 69 | end |
| 70 | note Raw tuple lookup does not claim an operation kind is supported or qualified. |
| 71 | put keys 0 0 |
| 72 | put actual 0 0 |
| 73 | if ne native_context keys 1 actual 1 |
| 74 | ret 12 |
| 75 | end |
| 76 | ret 0 |
| 77 | end |