{"id":"tag--cpu","name":"cpu","owner":"yeho","package":"runtime","kind":"runtime","signature":"cpu","description":"Require the CPU compute route with [cpu]. The current source developer example selects --backend cpu-oracle explicitly.","context":"CPU and GPU data processing with explicit ownership and completion.","parameters":[],"returns":"","members":[],"tags":["compute","cpu","gameplay","gpu","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"docs/runtime/execution-boundaries.md; docs/runtime/metal-compute-v1.md"},"status":"experimental","notes":[],"examples":[{"id":"cpu","title":"CPU · [cpu]","description":"Apply damage to a small batch of health values on the explicit CPU route. Each invocation owns one element.","code":"[cpu]\ncompute ApplyDamage(buffer of int health, int damage)\n{\n    int index = compute.index\n    if index >= health.count { return }\n    health[index] = health[index] - damage\n}\n\nbuffer of int health\nhealth.Add(100)\nhealth.Add(80)\nhealth.Add(60)\ncomputeTask job = dispatch ApplyDamage(health, 10)\nwait job\nif job.failed { Console.Error(job.error.message) Process.Exit(1) }\nfor index from 0 < health.count { Console.Log(Text.From(health[index])) }\n","tags":["cpu","compute","gameplay"],"run":"cpu-oracle","expected":"90\n70\n50","verifyRun":true,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.tag__cpu\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","verification":"executed","sha256":"858a749e940128584df45c3a77fee21a94e96601fa6e54adf97170500c72bbc7","checked":"2026-09-09","diagnostic":"","observedOutput":"90\n70\n50","checkedBackend":"cpu-oracle"}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=tag--cpu","json":"https://demonhunterlabs.com/reference/items/tag--cpu.json","markdown":"https://demonhunterlabs.com/reference/text/tag--cpu.md"}
