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_total.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_total.om` 28 lines · 537 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 fn vc_total eff view uint * zz view ulong 4 bs ulong to ulong 3 r = ulong 0 4 for jj ulong get zz 1 5 i = add get zz 0 jj 6 v = ulong get eff i 7 if ne v 0 8 r = add r div add v sub bs 1 bs 9 end 10 end 11 ret r 12 end 13 fn av_total eff view uint * n ulong bs ulong to ulong 14 zz = new ulong 4 0 15 put zz 2 n 16 r = ulong 0 17 for bb ulong add div n `1000000` 1 18 put zz 0 mul bb `1000000` 19 cnt = sub n get zz 0 20 if gt cnt `1000000` 21 cnt = ulong `1000000` 22 end 23 put zz 1 cnt 24 rr = vc_total eff zz bs 25 r = add r rr 26 end 27 ret r 28 end