aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / om / ribbon / q38-workspace-allocation-counter.c.txt
| 1 | /* External measurement instrument. No production implementation. */ |
| 2 | #include "omega_gpu_prefill.h" |
| 3 | #include <stdatomic.h> |
| 4 | static _Atomic uint64_t host_count, dev_count; |
| 5 | int __real_omega_gpu_pf_alloc_host(size_t bytes, OmegaGpuMem *out); |
| 6 | int __real_omega_gpu_pf_alloc_dev(size_t bytes, OmegaGpuMem *out); |
| 7 | int __wrap_omega_gpu_pf_alloc_host(size_t bytes, OmegaGpuMem *out) { |
| 8 | atomic_fetch_add(&host_count, 1); return __real_omega_gpu_pf_alloc_host(bytes,out); |
| 9 | } |
| 10 | int __wrap_omega_gpu_pf_alloc_dev(size_t bytes, OmegaGpuMem *out) { |
| 11 | atomic_fetch_add(&dev_count, 1); return __real_omega_gpu_pf_alloc_dev(bytes,out); |
| 12 | } |
| 13 | void measurement_alloc_reset(void) { atomic_store(&host_count,0);atomic_store(&dev_count,0); } |
| 14 | uint64_t measurement_alloc_host_count(void) { return atomic_load(&host_count); } |
| 15 | uint64_t measurement_alloc_dev_count(void) { return atomic_load(&dev_count); } |