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

36 lines · 597 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2fn vc_best s view uint * zz view ulong 4 hd ulong to ulong
3r = ulong 0
4p = new ulong 16 0
5put p 1 hd
6for jj ulong get zz 1
7i = add get zz 0 jj
8put p 0 ulong get s i
9rc = api_at_plan 3 p
10if ne rc 0
11ret 0
12end
13if gt get p 8 r
14r = get p 8
15end
16end
17ret r
18end
19fn av_best s view uint * n ulong hd ulong to ulong
20zz = new ulong 4 0
21put zz 2 n
22r = ulong 0
23for bb ulong add div n 1000000 1
24put zz 0 mul bb 1000000
25cnt = sub n get zz 0
26if gt cnt 1000000
27cnt = ulong 1000000
28end
29put zz 1 cnt
30rr = vc_best s zz hd
31if gt rr r
32r = rr
33end
34end
35ret r
36end