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_table.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | fn vc_table tab edit uint * slots edit uint * q view ulong 16 g ulong to ulong |
| 3 | for jj ulong get q 7 |
| 4 | b = add get q 6 jj |
| 5 | id = get tab b |
| 6 | v = uint g |
| 7 | if eq get q 1 2 |
| 8 | v = id |
| 9 | else |
| 10 | if ne get q 1 0 |
| 11 | if ge get slots ulong id 2147483648 |
| 12 | put slots ulong id uint g |
| 13 | g = add g 1 |
| 14 | end |
| 15 | v = uint get slots ulong id |
| 16 | else |
| 17 | g = add g 1 |
| 18 | end |
| 19 | end |
| 20 | put tab b v |
| 21 | end |
| 22 | ret g |
| 23 | end |
| 24 | fn av_table tab edit uint * slots edit uint * q view ulong 16 g ulong to ulong |
| 25 | z = new ulong 16 0 |
| 26 | for j ulong 16 |
| 27 | put z j get q j |
| 28 | end |
| 29 | for bb ulong add div len tab 1000000 1 |
| 30 | put z 6 mul bb 1000000 |
| 31 | cnt = sub len tab get z 6 |
| 32 | if gt cnt 1000000 |
| 33 | cnt = ulong 1000000 |
| 34 | end |
| 35 | put z 7 cnt |
| 36 | g = vc_table tab slots z g |
| 37 | end |
| 38 | ret g |
| 39 | end |