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

30 lines · 572 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2fn vc_max s view uint * zz view ulong 4 to ulong
3r = ulong 1
4for jj ulong get zz 1
5i = add get zz 0 jj
6if gt ulong get s i r
7r = ulong get s i
8end
9end
10ret r
11end
12fn av_max s view uint * n ulong to ulong
13zz = new ulong 4 0
14put zz 2 n
15r = ulong 1
16for bb ulong add div n 1000000 1
17put zz 0 mul bb 1000000
18cnt = sub n get zz 0
19if gt cnt 1000000
20cnt = ulong 1000000
21end
22put zz 1 cnt
23rr = vc_max s zz
24if gt rr r
25r = rr
26end
27end
28ret r
29end
30note Preserve the cut-F float polynomial, scalar order and empty-split handling.