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

30 lines · 559 bytes Raw Blame History
1om2
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Inner traversal blocks preserve the checked one-million-iteration guard.
4fn vc_bffin s view ushort * q view ulong 4 to ulong
5for zzj ulong get q 1
6i = add get q 0 zzj
7if eq and get s i 32640 32640
8ret add i 1
9end
10end
11ret 0
12end
13
14fn av_bffin s view ushort * n ulong to ulong
15q = new ulong 4 0
16r = ulong 0
17for zzb ulong add div n 1000000 1
18put q 0 mul zzb 1000000
19zzn = sub n get q 0
20if gt zzn 1000000
21zzn = ulong 1000000
22end
23put q 1 zzn
24rr = vc_bffin s q
25if ne rr 0
26ret rr
27end
28end
29ret r
30end