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

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