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_any.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_any s view uint * q view ulong 4 to ulong |
| 5 | r = ulong 0 |
| 6 | for zzj ulong get q 1 |
| 7 | i = add get q 0 zzj |
| 8 | r = or r ulong get s i |
| 9 | end |
| 10 | ret r |
| 11 | end |
| 12 | |
| 13 | fn av_any s view uint * n ulong to ulong |
| 14 | q = new ulong 4 0 |
| 15 | r = ulong 0 |
| 16 | for zzb ulong add div n 1000000 1 |
| 17 | put q 0 mul zzb 1000000 |
| 18 | zzn = sub n get q 0 |
| 19 | if gt zzn 1000000 |
| 20 | zzn = ulong 1000000 |
| 21 | end |
| 22 | put q 1 zzn |
| 23 | rr = vc_any s q |
| 24 | r = or r rr |
| 25 | end |
| 26 | ret r |
| 27 | end |