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/api/attn_best.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 / api / attn_best.om` 36 lines · 597 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 fn vc_best s view uint * zz view ulong 4 hd ulong to ulong 3 r = ulong 0 4 p = new ulong 16 0 5 put p 1 hd 6 for jj ulong get zz 1 7 i = add get zz 0 jj 8 put p 0 ulong get s i 9 rc = api_at_plan 3 p 10 if ne rc 0 11 ret 0 12 end 13 if gt get p 8 r 14 r = get p 8 15 end 16 end 17 ret r 18 end 19 fn av_best s view uint * n ulong hd ulong to ulong 20 zz = new ulong 4 0 21 put zz 2 n 22 r = ulong 0 23 for bb ulong add div n `1000000` 1 24 put zz 0 mul bb `1000000` 25 cnt = sub n get zz 0 26 if gt cnt `1000000` 27 cnt = ulong `1000000` 28 end 29 put zz 1 cnt 30 rr = vc_best s zz hd 31 if gt rr r 32 r = rr 33 end 34 end 35 ret r 36 end