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

49 lines · 1334 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Quiet mean/sd/dof/n[0:4], pressure[4], residual present[5], mean/sd/dof/n[6:10].
3note Scale[10], core[11], power by core[12:15]. Output mean/sd/dof/n/known/borrowed/energy[16:23].
4fn cm_prediction words edit ulong 32 to ulong
5mean = bitcast f64 get words 0
6sd = bitcast f64 get words 1
7dof = bitcast f64 get words 2
8n = get words 3
9put words 20 ulong 0
10put words 21 ulong 0
11if eq get words 4 0
12put words 20 ulong 1
13else
14if ne get words 5 0
15mean = add mean bitcast f64 get words 6
16rsd = bitcast f64 get words 7
17sd = bitcast f64 cm_sqrt bitcast ulong add mul sd sd mul rsd rsd
18rdof = bitcast f64 get words 8
19if lt rdof dof
20dof = rdof
21end
22n = get words 9
23put words 20 ulong 1
24else
25sd = bitcast f64 cm_sqrt bitcast ulong add mul sd sd f64 1.0
26put words 21 ulong 1
27end
28end
29scale = bitcast f64 get words 10
30if not ge scale f64 1.0
31scale = f64 1.0
32end
33put words 16 bitcast ulong mean
34put words 17 bitcast ulong mul sd scale
35put words 18 bitcast ulong dof
36put words 19 and n 4294967295
37core = get words 11
38if ge core 3
39core = ulong 2
40end
41mw = bitcast f64 get words add 12 core
42put words 22 ulong 0
43if gt mw f64 0.0
44cost = bitcast f64 cm_exp bitcast ulong mean true
45energy = mul mul cost mw bitcast f64 ulong 4562254508917369340
46put words 22 bitcast ulong energy
47end
48ret 0
49end