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 / components / cm_stats.om

38 lines · 899 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note 0 trial phase: 0 continue, 1 failed observation accepted, 2 zero latency refused.
3note 1 fit phase: stats[0:48], phi[48:56], residual flag[57], quiet mean[58], latency[59].
4fn cm_stats mode ulong out edit ulong 64 to ulong
5if eq mode 0
6put out 46 add get out 46 1
7if ne get out 56 0
8put out 47 add get out 47 1
9ret 1
10end
11if eq get out 59 0
12ret 2
13end
14ret 0
15end
16y = cm_log f64 get out 59 true
17if ne get out 57 0
18y = sub y bitcast f64 get out 58
19end
20k = ulong 0
21for i ulong 8
22x = bitcast f64 get out add 48 i
23for j ulong 8
24if ge j i
25z = bitcast f64 get out add 48 j
26v = bitcast f64 get out k
27put out k bitcast ulong add v mul x z
28k = add k 1
29end
30end
31v = bitcast f64 get out add 36 i
32put out add 36 i bitcast ulong add v mul x y
33end
34v = bitcast f64 get out 44
35put out 44 bitcast ulong add v mul y y
36put out 45 add get out 45 1
37ret 0
38end