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/tests/learn53/omega-unit.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 / tests / learn53 / omega-unit.om` 231 lines · 3920 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note SYNTHETIC unit metadata, pins and costs, NEVER a real benchmark record. 3 fn afix to void 4 for i ulong 2048 5 put LT i 0 6 end 7 for i ulong 24 8 put LS i 0 9 end 10 for i ulong 8 11 id = add i 1 12 a = mul i 32 13 n = kload id 14 put LT a id 15 put LT add a 1 2 16 put LT add a 2 1 17 put LT add a 3 kw 2 18 put LT add a 4 1 19 put LT add a 5 1 20 put LT add a 6 53 21 put LT add a 7 1 22 for j ulong 20 23 put LT add a add 8 j add add mul i 100 j 1 24 end 25 put LT add a 28 csize id 26 put LT add a 29 coutn id 27 put LT add a 30 `1000000` 28 end 29 for i ulong 4 30 put LPin i add i 1 31 put LPin add i 4 add i 1 32 put LPin add i 8 add i 5 33 put LPin add i 12 add i 5 34 end 35 for i ulong 9 36 put LC i 0 37 end 38 put LC 0 10 39 put LC 1 20 40 put LC 2 30 41 put LC 3 40 42 put LC 4 50 43 put LC 5 60 44 put LC 6 4096 45 end 46 fn agood id ulong to void 47 cvalues id 48 for i ulong 256 49 put LGot i get ko i 50 end 51 end 52 fn aobs to void 53 for i ulong 8 54 id = add i 1 55 agood id 56 check eq aobserve id 0 0 coutn id 0 57 put LGot sub coutn id 1 0 58 check eq aobserve id 0 0 coutn id 7 59 end 60 agood 1 61 check eq aobserve 0 0 0 28 10 62 check eq aobserve 9 0 0 28 10 63 check eq aobserve `18446744073709551615` 0 0 28 10 64 check eq aobserve 1 0 0 0 9 65 check eq aobserve 1 0 0 27 7 66 check eq aobserve 1 0 0 257 10 67 check eq aobserve 1 0 0 `18446744073709551615` 10 68 check eq aobserve 1 0 101 0 8 69 check eq aobserve 1 7 0 28 10 70 for i ulong 6 71 check eq aobserve 1 add i 1 0 28 add i 1 72 end 73 note A task mutation is discarded; correct output for weakened task is wrong. 74 n = kload 1 75 tw 28 0 76 tw 21 1 77 tw 22 99 78 tw 14 3 79 check eq aobserve 1 0 0 28 0 80 check eq kw 28 9 81 check eq kw 21 0 82 check eq kw 22 0 83 check eq kw 14 1 84 cw 5 6 85 for i ulong 28 86 put LGot i get ko i 87 end 88 check eq aobserve 1 0 0 28 7 89 note Wrong logical output, skipped write, dense stride, PASS spoof, wrong task. 90 for i ulong 4 91 agood 1 92 if eq i 0 93 cw 3 12 94 end 95 if eq i 1 96 cw 5 `2779096485` 97 end 98 if eq i 2 99 cw 2 11 100 cw 3 15 101 cw 5 `2779096485` 102 end 103 if eq i 3 104 cw 1 `1397965136` 105 end 106 for j ulong 28 107 put LGot j get ko j 108 end 109 check eq aobserve 1 0 0 28 7 110 end 111 agood 1 112 check eq aobserve 2 0 0 28 7 113 end 114 fn aall to void 115 afix 116 check eq abegin 1000 0 117 check eq abegin 1000 20 118 for i ulong 8 119 id = add i 1 120 agood id 121 check eq aattempt i 1 0 0 coutn id 0 122 end 123 check eq lfinish 0 124 check eq get LS 18 1 125 check eq get LS 4 8 126 check eq get LS 5 8 127 check eq get LS 3 8 128 check eq get LS 16 8 129 check eq get LS 14 4096 130 note A subsequent invalid begin clears old completed-valid state. 131 put LT 1 3 132 check eq abegin 1000 1 133 check eq get LS 18 0 134 end 135 fn amissing to void 136 afix 137 check eq abegin 1000 0 138 for i ulong 7 139 id = add i 1 140 agood id 141 check eq aattempt i 1 0 0 coutn id 0 142 end 143 check eq lfinish 30 144 check eq get LS 18 0 145 afix 146 check eq abegin 1000 0 147 agood 1 148 check eq aattempt 0 1 0 0 28 0 149 check eq aattempt 0 1 0 0 28 28 150 check eq lfinish 28 151 check eq get LS 18 0 152 afix 153 check eq abegin 1000 0 154 check eq aattempt 8 1 0 0 28 27 155 check eq lfinish 27 156 end 157 fn abad to void 158 afix 159 check eq abegin 1000 0 160 for i ulong 8 161 id = add i 1 162 agood id 163 if eq id 8 164 put LGot 4 0 165 end 166 check eq aattempt i 1 0 0 coutn id 0 167 end 168 check eq lfinish 0 169 check eq get LS 18 1 170 check eq get LS 4 7 171 check eq get LS 5 7 172 note A valid experiment can report failure, never silently drop that task. 173 check eq get LS 1 8 174 check eq get LS 3 8 175 end 176 fn apins to void 177 for i ulong 8 178 afix 179 check eq abegin 1000 0 180 p = add i 4 181 if ge i 4 182 p = add i 8 183 end 184 put LPin p 999 185 agood 1 186 check eq aattempt 0 1 0 0 28 26 187 check eq get LS 4 0 188 check eq lfinish 26 189 end 190 afix 191 check eq abegin 1000 0 192 put LC 0 `18446744073709551615` 193 agood 1 194 check eq aattempt 0 1 0 0 28 23 195 check eq get LS 4 0 196 check eq lfinish 23 197 afix 198 check eq abegin 1 0 199 agood 1 200 check eq aattempt 0 1 0 0 28 29 201 check eq lfinish 29 202 check eq get LS 18 0 203 end 204 fn ameta to void 205 for i ulong 32 206 if or lt i 8 ge i 28 207 afix 208 put LT i 999 209 check eq abegin 1000 1 210 check eq get LS 18 0 211 end 212 end 213 afix 214 for i ulong 4 215 put LT add i 8 0 216 end 217 check eq abegin 1000 6 218 check eq get LS 18 0 219 end 220 fn main to int 221 aobs 222 aall 223 amissing 224 abad 225 apins 226 ameta 227 if ne get tally 1 0 228 ret 1 229 end 230 ret 0 231 end