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 / native / nvml / step.om

57 lines · 883 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note step.om: the exported nvml_step, after nvml.om and query.om. Ops in s 0: 1 nvmlInit_v2,
3note 2 nvmlShutdown, 3 GetCount_v2, 4 GetHandleByIndex_v2, 5 GetName, 6 GetUUID, 7 GetTemperature,
4note 8 GetMemoryInfo, 9 GetUtilizationRates, 10 GetComputeRunningProcesses_v3. A new call
5note (resume point 0) clears the outputs. Result 0; an unknown op answers UNKNOWN (999).
6
7fn nvml_step s edit ulong SN b edit uchar BN to ulong
8if eq get s 22 0
9put s 5 0
10put s 6 0
11put s 7 0
12put s 27 0
13end
14op = get s 0
15if eq op 1
16init s b
17ret 0
18end
19if eq op 2
20shut s b
21ret 0
22end
23if eq op 3
24count s
25ret 0
26end
27if eq op 4
28handle s
29ret 0
30end
31if eq op 5
32name s b
33ret 0
34end
35if eq op 6
36uuid s b
37ret 0
38end
39if eq op 7
40temp s b
41ret 0
42end
43if eq op 8
44mem s b
45ret 0
46end
47if eq op 9
48util s b
49ret 0
50end
51if eq op 10
52procs s b
53ret 0
54end
55done s 999
56ret 0
57end