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_gtab.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | fn vc_gtab s view uint * tab edit uint * q view ulong 16 which ulong to ulong |
| 3 | for jj ulong get q 7 |
| 4 | i = add get q 6 jj |
| 5 | if eq which 0 |
| 6 | put tab mul i 4 get s i |
| 7 | v = add get q 1 mul i get q 2 |
| 8 | v = and v 4294967295 |
| 9 | put tab add mul i 4 2 uint v |
| 10 | put tab add mul i 4 3 uint 0 |
| 11 | else |
| 12 | put tab add mul i 4 1 get s i |
| 13 | end |
| 14 | end |
| 15 | ret 0 |
| 16 | end |
| 17 | fn av_gtab s view uint * tab edit uint * q view ulong 16 which ulong to ulong |
| 18 | z = new ulong 16 0 |
| 19 | for j ulong 16 |
| 20 | put z j get q j |
| 21 | end |
| 22 | for bb ulong add div get q 0 1000000 1 |
| 23 | put z 6 mul bb 1000000 |
| 24 | cnt = sub get q 0 get z 6 |
| 25 | if gt cnt 1000000 |
| 26 | cnt = ulong 1000000 |
| 27 | end |
| 28 | put z 7 cnt |
| 29 | rc = vc_gtab s tab z which |
| 30 | if ne rc 0 |
| 31 | ret rc |
| 32 | end |
| 33 | end |
| 34 | ret 0 |
| 35 | end |