use vyre_foundation::execution_plan::ExecutionPlan;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum RoutingDecision {
CpuSimd,
GpuPipeline,
PersistentMegakernel,
}
pub trait RoutingPolicy: Send + Sync {
fn name(&self) -> &'static str;
fn route(&self, plan: &ExecutionPlan) -> RoutingDecision;
}
pub struct RoutingEngine {
policy: Box<dyn RoutingPolicy>,
}
impl RoutingEngine {
pub fn new(policy: impl RoutingPolicy + 'static) -> Self {
Self {
policy: Box::new(policy),
}
}
pub fn route(&self, plan: &ExecutionPlan) -> RoutingDecision {
self.policy.route(plan)
}
}
pub mod standard_policy;