interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / gpu / nvidia / om / api / attn_count.om

29 lines · 560 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_count s view uint * q view ulong 4 v uint 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_count s view uint * n ulong v uint 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_count s q v
26r = add r rr
27end
28ret r
29end