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_rpois.om
| 1 | om2 |
| 2 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | note Inner traversal blocks preserve the checked one-million-iteration guard. |
| 4 | fn vc_rpois w view f32 * ids view uint * q view ulong 4 poison ulong to ulong |
| 5 | r = ulong 0 |
| 6 | pv = bitcast f32 uint and poison 4294967295 |
| 7 | pi = uint shr poison 32 |
| 8 | for zzj ulong get q 1 |
| 9 | i = add get q 0 zzj |
| 10 | if eq get w i pv |
| 11 | r = add r 1 |
| 12 | else |
| 13 | if eq get ids i pi |
| 14 | r = add r 1 |
| 15 | end |
| 16 | end |
| 17 | end |
| 18 | ret r |
| 19 | end |
| 20 | |
| 21 | fn av_rpois w view f32 * ids view uint * n ulong poison ulong to ulong |
| 22 | q = new ulong 4 0 |
| 23 | r = ulong 0 |
| 24 | for zzb ulong add div n 1000000 1 |
| 25 | put q 0 mul zzb 1000000 |
| 26 | zzn = sub n get q 0 |
| 27 | if gt zzn 1000000 |
| 28 | zzn = ulong 1000000 |
| 29 | end |
| 30 | put q 1 zzn |
| 31 | rr = vc_rpois w ids q poison |
| 32 | r = add r rr |
| 33 | end |
| 34 | ret r |
| 35 | end |