weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
//! Resident fixed-point graph plans paired with compiled Vyre pipelines.

mod borrowed;
mod generic;
mod owned;

#[cfg(test)]
mod tests;

use crate::fixed_point_resident::FixedPointResidentGraph;

pub use generic::{GraphRef, PlanBuilder};

/// Resident graph resources paired with a backend-compiled pipeline.
#[derive(Clone, Debug, PartialEq)]
pub struct FixedPointResidentPlan {
    pub(crate) inner: generic::PlanBuilder<FixedPointResidentGraph>,
}

/// Borrowed resident graph resources paired with a backend-compiled pipeline.
///
/// Use this with [`crate::fixed_point_resident_cache::FixedPointResidentGraphCache`]
/// so repeated equivalent graph layouts can share one resident upload while
/// still exposing the same execution shape as [`FixedPointResidentPlan`].
#[derive(Clone, Debug, PartialEq)]
pub struct FixedPointBorrowedResidentPlan<'a> {
    pub(crate) inner: generic::PlanBuilder<&'a FixedPointResidentGraph>,
}

impl std::ops::Deref for FixedPointResidentPlan {
    type Target = generic::PlanBuilder<FixedPointResidentGraph>;

    fn deref(&self) -> &Self::Target {
        &self.inner
    }
}

impl<'a> std::ops::Deref for FixedPointBorrowedResidentPlan<'a> {
    type Target = generic::PlanBuilder<&'a FixedPointResidentGraph>;

    fn deref(&self) -> &Self::Target {
        &self.inner
    }
}