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

29 lines · 553 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_cntf s view f32 * q view ulong 4 v f32 to ulong
5r = ulong 0
6for zzj ulong get q 1
7i = add get q 0 zzj
8if eq get s i v
9r = add r 1
10end
11end
12ret r
13end
14
15fn av_cntf s view f32 * n ulong v f32 to ulong
16q = new ulong 4 0
17r = ulong 0
18for zzb ulong add div n 1000000 1
19put q 0 mul zzb 1000000
20zzn = sub n get q 0
21if gt zzn 1000000
22zzn = ulong 1000000
23end
24put q 1 zzn
25rr = vc_cntf s q v
26r = add r rr
27end
28ret r
29end