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_gtab.om

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