runtime.Compute · builtin ·
Compute.RuntimeCounter
Read a process-lifetime instrumentation counter. Counter 1 counts compute dispatch encodes; the counter does not reset when read.
Built into Yeho; no package import is needed. Native services require an admitted host and the correct resource lifecycle.
Compute.RuntimeCounter(int value) -> intStatus: registered-intrinsic
Parameters
int value- Supply value as int.
GPU · [gpu]
Run a GPU pass and read the process-lifetime dispatch-encode counter. Counter 1 counts encodes, not frames or GPU duration.
gpu · compute · gameplay · executed
[gpu]
compute DoubleRewards(buffer of int rewards, int multiplier)
{
int index = compute.index
if index >= rewards.count { return }
rewards[index] = rewards[index] * multiplier
}
buffer of int rewards
rewards.Add(100)
rewards.Add(80)
rewards.Add(60)
computeTask job = dispatch DoubleRewards(rewards, 2)
wait job
if job.failed { Console.Error(job.error.message) Process.Exit(1) }
for index from 0 < rewards.count { Console.Log(Text.From(rewards[index])) }
Console.Log(Text.From(Compute.RuntimeCounter(1)))
project.mech
manifestVersion = "2"
package = "api.example.runtime__compute_runtimecounter"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Expected output
200 160 120 1
Notes and source
The example checks the call shape. Opening windows, recording audio, changing files, network operations, and process operations have real effects when run. Follow the corresponding package lifecycle before using live resources.
yeho/src/compiler/common/intrinsic_registry.cpp:1420