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/data.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 / data.om` 133 lines · 2137 bytes Raw Blame History 1 om2 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note Runtime extents, not fixed capacities. Chunked counted loops never hit the dynamic million-step guard. 4 fn ar_fill v ulong y edit uint * to ulong 5 base = ulong 0 6 for chunks ulong `281474976710656` 7 if ge base len y 8 break 9 end 10 for j ulong 65536 11 i = add base j 12 if ge i len y 13 break 14 end 15 put y i uint v 16 end 17 base = add base 65536 18 end 19 ret 0 20 end 21 fn ar_count v ulong x view uint * to ulong 22 n = ulong 0 23 base = ulong 0 24 for chunks ulong `281474976710656` 25 if ge base len x 26 break 27 end 28 for j ulong 65536 29 i = add base j 30 if ge i len x 31 break 32 end 33 if eq get x i uint v 34 n = add n 1 35 end 36 end 37 base = add base 65536 38 end 39 ret n 40 end 41 fn ar_args va view ulong * y edit uint * to ulong 42 if lt len y mul len va 2 43 ret 1 44 end 45 for i ulong len va 46 put y mul i 2 uint and get va i `4294967295` 47 put y add mul i 2 1 uint shr get va i 32 48 end 49 ret 0 50 end 51 fn ar_pad x view uint * y edit uint * to ulong 52 if lt len y len x 53 ret 1 54 end 55 for i ulong `18446744073709551615` 56 if ge i len y 57 break 58 end 59 v = uint 0 60 if lt i len x 61 v = get x i 62 end 63 put y i v 64 end 65 ret 0 66 end 67 fn ar_idle rec view uint * to ulong 68 if ne rem len rec 6 0 69 ret 0 70 end 71 for i ulong `18446744073709551615` 72 if ge i div len rec 6 73 break 74 end 75 p = mul i 6 76 if or ne get rec add p 1 0 eq get rec p 1 77 ret 0 78 end 79 end 80 ret 1 81 end 82 fn ar_route e ulong x view f32 * y edit f32 * to ulong 83 if eq e 0 84 ret 0 85 end 86 k = div len x e 87 n = mul mul div k 4 e 4 88 for i ulong `18446744073709551615` 89 if ge i n 90 break 91 end 92 p = mul rem div i 4 e k 93 p = add p mul div i mul e 4 4 94 p = add p rem i 4 95 put y i get x p 96 end 97 for i ulong `18446744073709551615` 98 if ge i mul e 4 99 break 100 end 101 put y add n i 0.0f32 102 end 103 ret 0 104 end 105 fn ar_perm lb ulong x view f32 * y edit f32 * to ulong 106 row = mul 32 lb 107 if eq row 0 108 ret 0 109 end 110 for i ulong `18446744073709551615` 111 if ge i len x 112 break 113 end 114 p = mul div i row row 115 p = add p mul rem div i 4 32 lb 116 p = add p mul div rem i row 128 4 117 p = add p rem i 4 118 put y i mul get x p bitcast f32 uint `1602224128` 119 end 120 ret 0 121 end 122 fn ar_widen x view ushort * y edit f32 * to ulong 123 if ne len x len y 124 ret 1 125 end 126 for i ulong `18446744073709551615` 127 if ge i len x 128 break 129 end 130 put y i bitcast f32 shl uint get x i 16 131 end 132 ret 0 133 end