Skip to main content

Module cast_fusion

Module cast_fusion 

Source
Expand description

Cast-fusion capability predicate — builds the fuel_graph::opt::CapabilityPredicate consumed by CastFusionRule from the live KernelBindingTable.

The rule itself lives in fuel-graph and is decoupled from the binding table by design (fuel-graph doesn’t know what BackendId means). The predicate factory here closes the gap: it walks the binding table to answer “does any registered backend have a kernel for (op_kind, dtypes)?”

§Usage

ⓘ
use fuel_graph::opt::{CastFusionRule, RuleRegistry};
use fuel_memory::cast_fusion::cast_fusion_predicate;

let registry = RuleRegistry::default_rules()
    .with_rule(Box::new(CastFusionRule::new(cast_fusion_predicate())));

The predicate consults crate::dispatch::global_bindings at call time, so it picks up registrations done after construction.

Functions§

cast_fusion_predicate
Build a CapabilityPredicate backed by the process-wide crate::dispatch::global_bindings.