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/apirest/tiledata.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 / apirest / tiledata.om` 135 lines · 2359 bytes Raw Blame History 1 om2 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note Descriptor words are native aligned ulong values: two addresses, packed row/count, zero padding. 4 fn ar_tw q view ulong 8 e ulong nt ulong y edit ulong * to void 5 p = mul nt 4 6 v = add get q 1 mul e get q 3 7 put y p v 8 v = add get q 2 mul e get q 4 9 put y add p 1 v 10 ret 11 end 12 fn ar_tiles q view ulong 8 cnt view uint * y edit ulong * to ulong 13 nt = ulong 0 14 row = uint 0 15 for e ulong len cnt 16 r = uint 0 17 for guard ulong `4294967296` 18 if not lt r get cnt e 19 break 20 end 21 if ge nt get q 0 22 ret 0 23 end 24 p = mul nt 4 25 ar_tw q e nt y 26 n = sub get cnt e r 27 if gt ulong n get q 5 28 n = uint get q 5 29 end 30 p = or ulong add row r shl ulong n 32 31 put y add mul nt 4 2 p 32 p = add mul nt 4 3 33 put y p 0 34 nt = add nt 1 35 r = add r uint get q 5 36 end 37 row = add row get cnt e 38 end 39 ret nt 40 end 41 fn ar_tg q view ulong 8 y edit ulong * to ulong 42 if lt len y mul get q 0 4 43 ret 0 44 end 45 for t ulong get q 0 46 p = mul t 4 47 put y p get q 1 48 put y add p 1 mul t get q 2 49 put y add p 2 get q 3 50 put y add p 3 0 51 end 52 ret get q 0 53 end 54 fn ar_tile q view ulong 8 y edit ulong * to ulong 55 nt = get q 0 56 r = uint 0 57 for guard ulong `4294967296` 58 if not lt r uint get q 2 59 break 60 end 61 if ge nt div len y 4 62 ret 0 63 end 64 n = sub uint get q 2 r 65 if gt ulong n get q 3 66 n = uint get q 3 67 end 68 p = mul nt 4 69 put y p get q 4 70 put y add p 1 get q 5 71 p = or ulong uint add get q 1 ulong r shl ulong n 32 72 put y add mul nt 4 2 p 73 p = add mul nt 4 3 74 put y p 0 75 nt = add nt 1 76 r = add r uint get q 3 77 end 78 ret nt 79 end 80 fn ar_ct n uint bm uint to uint 81 ret div add n sub bm 1 bm 82 end 83 fn ar_groups q view ulong 4 ids view uint * rows view uint * to ulong 84 if ne len ids len rows 85 ret `18446744073709551615` 86 end 87 segs = uint 0 88 tiles = uint 0 89 n = uint 0 90 for i ulong `4294967296` 91 if ge i len ids 92 break 93 end 94 if ge ulong get ids i get q 0 95 ret `18446744073709551615` 96 end 97 if ge ulong get rows i get q 1 98 ret `18446744073709551615` 99 end 100 if gt i 0 101 if lt get ids i get ids sub i 1 102 ret `18446744073709551615` 103 end 104 end 105 if eq i 0 106 segs = 1 107 else 108 if ne get ids i get ids sub i 1 109 if ne n 0 110 tiles = add tiles ar_ct n uint get q 2 111 end 112 segs = add segs 1 113 n = uint 0 114 end 115 end 116 n = add n 1 117 end 118 if ne n 0 119 tiles = add tiles ar_ct n uint get q 2 120 end 121 ret or ulong segs shl ulong tiles 32 122 end 123 fn ar_run i ulong ids view uint * to ulong 124 j = i 125 for guard ulong `4294967296` 126 if not lt j len ids 127 break 128 end 129 if ne get ids j get ids i 130 break 131 end 132 j = add j 1 133 end 134 ret j 135 end