weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
use crate::fixed_point_batch::FixedPointBatch;

impl<'a, F> FixedPointBatch<'a, F>
where
    F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>, &mut Vec<Vec<u8>>) -> Result<(), String>,
{
    /// Run IFDS reachability against prepared CSR buffers with retained batch scratch.
    pub fn ifds_prepared(
        &mut self,
        prepared: &crate::ifds_gpu::PreparedIfdsCsr,
        seed_facts: &[(u32, u32, u32)],
        max_iterations: u32,
    ) -> Result<Vec<u32>, String> {
        crate::ifds_gpu::solve_prepared_borrowed_with_scratch_via(
            self.dispatch,
            prepared,
            seed_facts,
            max_iterations,
            &mut self.ifds_scratch,
        )
    }

    /// Run IFDS reachability against prepared CSR buffers into caller-owned
    /// result storage with retained batch scratch.
    pub fn ifds_prepared_into(
        &mut self,
        prepared: &crate::ifds_gpu::PreparedIfdsCsr,
        seed_facts: &[(u32, u32, u32)],
        max_iterations: u32,
        result: &mut Vec<u32>,
    ) -> Result<(), String> {
        crate::ifds_gpu::solve_prepared_borrowed_with_scratch_into_via(
            self.dispatch,
            prepared,
            seed_facts,
            max_iterations,
            &mut self.ifds_scratch,
            result,
        )
    }

    /// Run several IFDS reachability queries against prepared CSR buffers
    /// while reusing retained batch scratch across every seed set.
    pub fn ifds_prepared_many(
        &mut self,
        prepared: &crate::ifds_gpu::PreparedIfdsCsr,
        seed_sets: &[&[(u32, u32, u32)]],
        max_iterations: u32,
    ) -> Result<Vec<Vec<u32>>, String> {
        crate::ifds_gpu::solve_prepared_borrowed_many_with_scratch_via(
            self.dispatch,
            prepared,
            seed_sets,
            max_iterations,
            &mut self.ifds_scratch,
        )
    }

    /// Run several IFDS reachability queries against prepared CSR buffers into
    /// caller-owned result rows with retained batch scratch.
    pub fn ifds_prepared_many_into(
        &mut self,
        prepared: &crate::ifds_gpu::PreparedIfdsCsr,
        seed_sets: &[&[(u32, u32, u32)]],
        max_iterations: u32,
        results: &mut Vec<Vec<u32>>,
    ) -> Result<(), String> {
        crate::ifds_gpu::solve_prepared_borrowed_many_with_scratch_into_via(
            self.dispatch,
            prepared,
            seed_sets,
            max_iterations,
            &mut self.ifds_scratch,
            results,
        )
    }
}