interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / om / api / attn_total.om

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