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
CUDApp / om / api / attn_eff.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | fn vc_eff nb view uint * d edit uint * bs ulong zz view ulong 4 to ulong |
| 3 | p = new ulong 16 0 |
| 4 | put p 2 bs |
| 5 | for jj ulong get zz 1 |
| 6 | i = add get zz 0 jj |
| 7 | put p 0 ulong get d i |
| 8 | put p 1 ulong get nb i |
| 9 | rc = api_at_plan 15 p |
| 10 | if ne rc 0 |
| 11 | ret rc |
| 12 | end |
| 13 | put d i uint get p 8 |
| 14 | end |
| 15 | ret 0 |
| 16 | end |
| 17 | fn av_eff nb view uint * d edit uint * bs ulong to ulong |
| 18 | zz = new ulong 4 0 |
| 19 | for bb ulong add div len nb 1000000 1 |
| 20 | put zz 0 mul bb 1000000 |
| 21 | cnt = sub len nb get zz 0 |
| 22 | if gt cnt 1000000 |
| 23 | cnt = ulong 1000000 |
| 24 | end |
| 25 | put zz 1 cnt |
| 26 | rc = vc_eff nb d bs zz |
| 27 | if ne rc 0 |
| 28 | ret rc |
| 29 | end |
| 30 | end |
| 31 | ret 0 |
| 32 | end |