Skip to main content

global_bindings

Function global_bindings 

Source
pub fn global_bindings() -> Arc<KernelBindingTable> ⓘ
Expand description

Take a snapshot of the process-wide kernel-binding table. CPU dispatch wrappers are auto-registered on first access. When built with the cuda feature, the CUDA PTX path + the baracuda-kernels-sys path are also auto-registered — production callers picking up the global table see all available backends without manual init.

Returns an owned Arc, not a lock guard (GAP-015). The read guard is acquired and released entirely inside this function, so a caller cannot hold one across a call that might write the table — the shape that deadlocked. Holding the returned Arc indefinitely is safe and cheap; it keeps that snapshot alive, it does not block anyone.

Snapshot semantics are a correctness property, not just a side effect. A caller sees one point-in-time table for as long as it holds the Arc, so a kernel adopted concurrently is invisible to a pass already in flight. That makes an optimize pass a pure function of (graph, table snapshot). Under the old guard, a pass could observe the table mutate mid-pass and emit a plan not reproducible from its own inputs — which would break the base_map_hash recipe-identity property that Tier-2 convergence depends on. Adoption exists to affect subsequent passes, so no known path wants mid-pass visibility.