Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/om/cache/templates_test.om # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / om / cache / templates_test.om` 253 lines · 6186 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note Independent admitted C exporter fixture, framed as launch4096/cubin32768/observed2048/sizes8LEu64. 3 note The driver performs no admission; stdin is verification-only. Runtime caller owns successful admission custody. 4 fn kt_sizes frame view uchar 38976 sizes edit ulong 8 to void 5 for i ulong 8 6 v = ulong 0 7 for j ulong 8 8 v = or v shl ulong get frame add add 38912 mul i 8 j mul j 8 9 end 10 put sizes i v 11 end 12 end 13 fn kt_obsmut launch edit uchar 4096 cubin view uchar 32768 obs edit uchar 2048 sizes view ulong 8 off ulong expected long to bool 14 old = get obs off 15 put obs off xor old 1 16 rc = native_templates launch cubin obs sizes 17 put obs off old 18 ret eq rc expected 19 end 20 fn kt_cubmut launch view uchar 4096 cubin edit uchar 32768 obs view uchar 2048 sizes view ulong 8 off ulong expected long to bool 21 old = get cubin off 22 put cubin off xor old 1 23 rc = native_templates launch cubin obs sizes 24 put cubin off old 25 ret eq rc expected 26 end 27 fn kt_lmut launch edit uchar 4096 cubin view uchar 32768 obs view uchar 2048 sizes view ulong 8 off ulong expected long to bool 28 old = get launch off 29 put launch off xor old 1 30 rc = native_templates launch cubin obs sizes 31 put launch off old 32 ret eq rc expected 33 end 34 fn kt_smut launch view uchar 4096 cubin view uchar 32768 obs view uchar 2048 sizes edit ulong 8 off ulong to bool 35 old = get sizes off 36 put sizes off xor old 1 37 rc = native_templates launch cubin obs sizes 38 put sizes off old 39 ret eq rc -20 40 end 41 fn kt_resign launch edit uchar 4096 obs view uchar 2048 to int 42 buf = new uchar 4096 0 43 hash = new uchar 32 0 44 for i ulong 768 45 put buf i get obs i 46 end 47 if ne kc_sha buf 768 hash 0 48 ret 1 49 end 50 for i ulong 32 51 put launch add mul ulong 23 8 i get hash i 52 end 53 ret 0 54 end 55 fn kt_semantic launch edit uchar 4096 cubin view uchar 32768 obs edit uchar 2048 sizes view ulong 8 off ulong to bool 56 old = get obs off 57 put obs off xor old 1 58 if ne kt_resign launch obs 0 59 ret false 60 end 61 rc = native_templates launch cubin obs sizes 62 put obs off old 63 if ne kt_resign launch obs 0 64 ret false 65 end 66 ret eq rc -25 67 end 68 fn kt_dupsection launch view uchar 4096 cubin edit uchar 32768 obs view uchar 2048 sizes view ulong 8 to bool 69 backup = new uchar 64 0 70 sh = kt_u cubin 40 8 71 src = add sh mul ulong 8 64 72 sh = add sh mul ulong 7 64 73 for i ulong 64 74 put backup i get cubin add sh i 75 put cubin add sh i get cubin add src i 76 end 77 rc = native_templates launch cubin obs sizes 78 for i ulong 64 79 put cubin add sh i get backup i 80 end 81 ret eq rc -22 82 end 83 fn kt_paramhash launch view uchar 4096 cubin edit uchar 32768 obs view uchar 2048 sizes view ulong 8 off ulong to bool 84 old = kt_u cubin off 4 85 for i ulong 4 86 put cubin add off i uchar and shr ulong `1175552` mul i 8 255 87 end 88 rc = native_templates launch cubin obs sizes 89 for i ulong 4 90 put cubin add off i uchar and shr old mul i 8 255 91 end 92 ret eq rc -26 93 end 94 fn kt_upperid launch view uchar 4096 cubin view uchar 32768 obs edit uchar 2048 sizes view ulong 8 to bool 95 old = get obs 1024 96 put obs 1024 65 97 rc = native_templates launch cubin obs sizes 98 put obs 1024 old 99 ret eq rc -24 100 end 101 fn kt_taildupe launch view uchar 4096 cubin edit uchar 32768 obs view uchar 2048 sizes view ulong 8 off ulong to bool 102 old = get cubin off 103 put cubin off 55 104 rc = native_templates launch cubin obs sizes 105 put cubin off old 106 ret eq rc -23 107 end 108 fn kt_cases launch edit uchar 4096 cubin edit uchar 32768 obs edit uchar 2048 sizes edit ulong 8 to int 109 if ne native_templates launch cubin obs sizes 0 110 ret 1 111 end 112 if not kt_obsmut launch cubin obs sizes 1024 -24 113 ret 2 114 end 115 if not kt_obsmut launch cubin obs sizes 960 -24 116 ret 3 117 end 118 if not kt_upperid launch cubin obs sizes 119 ret 4 120 end 121 if not kt_obsmut launch cubin obs sizes 900 -20 122 ret 5 123 end 124 if not kt_obsmut launch cubin obs sizes 992 -20 125 ret 6 126 end 127 if not kt_obsmut launch cubin obs sizes 1088 -20 128 ret 7 129 end 130 if not kt_obsmut launch cubin obs sizes 896 -22 131 ret 8 132 end 133 if not kt_smut launch cubin obs sizes 1 134 ret 9 135 end 136 if not kt_smut launch cubin obs sizes 2 137 ret 10 138 end 139 if not kt_smut launch cubin obs sizes 3 140 ret 11 141 end 142 if not kt_smut launch cubin obs sizes 7 143 ret 12 144 end 145 if not kt_lmut launch cubin obs sizes 216 -20 146 ret 13 147 end 148 if not kt_cubmut launch cubin obs sizes 32767 -20 149 ret 14 150 end 151 if not kt_cubmut launch cubin obs sizes 0 -21 152 ret 15 153 end 154 if not kt_cubmut launch cubin obs sizes 47 -21 155 ret 16 156 end 157 if not kt_cubmut launch cubin obs sizes 62 -21 158 ret 17 159 end 160 if not kt_dupsection launch cubin obs sizes 161 ret 18 162 end 163 p = kt_u cubin 40 8 164 p = add p mul ulong 8 64 165 if not kt_cubmut launch cubin obs sizes add p 44 -22 166 ret 19 167 end 168 p = kt_u cubin add p 24 8 169 if not kt_cubmut launch cubin obs sizes p -23 170 ret 20 171 end 172 if not kt_cubmut launch cubin obs sizes add p 4 -23 173 ret 21 174 end 175 if not kt_cubmut launch cubin obs sizes add p 16 -23 176 ret 22 177 end 178 if not kt_cubmut launch cubin obs sizes add p 18 -23 179 ret 23 180 end 181 if not kt_cubmut launch cubin obs sizes add p 26 -23 182 ret 24 183 end 184 if not kt_cubmut launch cubin obs sizes add p 32 -23 185 ret 25 186 end 187 if not kt_cubmut launch cubin obs sizes add p 36 -23 188 ret 26 189 end 190 if not kt_cubmut launch cubin obs sizes add p 45 -23 191 ret 27 192 end 193 if not kt_cubmut launch cubin obs sizes add p 46 -23 194 ret 28 195 end 196 if not kt_cubmut launch cubin obs sizes add p 58 -23 197 ret 29 198 end 199 if not kt_paramhash launch cubin obs sizes add p 20 200 ret 30 201 end 202 if not kt_lmut launch cubin obs sizes 120 -26 203 ret 31 204 end 205 if not kt_obsmut launch cubin obs sizes 768 -27 206 ret 32 207 end 208 if not kt_obsmut launch cubin obs sizes 0 -28 209 ret 33 210 end 211 if not kt_semantic launch cubin obs sizes 540 212 ret 34 213 end 214 if not kt_semantic launch cubin obs sizes 525 215 ret 35 216 end 217 if not kt_semantic launch cubin obs sizes 528 218 ret 36 219 end 220 if not kt_taildupe launch cubin obs sizes add p 49 221 ret 38 222 end 223 if ne native_templates launch cubin obs sizes 0 224 ret 37 225 end 226 ret 0 227 end 228 fn main to int 229 frame = new uchar 38976 0 230 pos = ulong 0 231 while lt pos 38976 bound 38976 232 n = read 0 frame pos sub 38976 pos 233 if le n 0 234 ret 90 235 end 236 pos = add pos ulong n 237 end 238 launch = new uchar 4096 0 239 cubin = new uchar 32768 0 240 obs = new uchar 2048 0 241 sizes = new ulong 8 0 242 for i ulong 4096 243 put launch i get frame i 244 end 245 for i ulong 32768 246 put cubin i get frame add 4096 i 247 end 248 for i ulong 2048 249 put obs i get frame add 36864 i 250 end 251 kt_sizes frame sizes 252 ret kt_cases launch cubin obs sizes 253 end