interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / om / api / attn_table.om

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