use super::{CsrGraph, FixedPointBatch};
impl<'a, F> FixedPointBatch<'a, F>
where
F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>, &mut Vec<Vec<u8>>) -> Result<(), String>,
{
pub fn live(
&mut self,
graph: CsrGraph<'_>,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::live::live_closure_borrowed_into_with_scratch_via(
self.dispatch,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn live_into(
&mut self,
graph: CsrGraph<'_>,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::live::live_closure_borrowed_into_result_with_scratch_via(
self.dispatch,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
pub fn prepare_live(
&mut self,
graph: CsrGraph<'_>,
) -> Result<crate::fixed_point_graph::FixedPointForwardGraph, String> {
crate::live::prepare_live_graph_with_scratch(
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
&mut self.scratch,
)
}
pub fn prepare_live_into(
&mut self,
graph: CsrGraph<'_>,
prepared: &mut crate::fixed_point_graph::FixedPointForwardGraph,
) -> Result<(), String> {
crate::live::prepare_live_graph_into_with_scratch(
prepared,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
&mut self.scratch,
)
}
pub fn prepare_live_plan(
&mut self,
graph: CsrGraph<'_>,
) -> Result<crate::fixed_point_graph::FixedPointAnalysisPlan, String> {
crate::live::prepare_live_plan_with_scratch(
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
&mut self.scratch,
)
}
pub fn prepare_live_plan_into(
&mut self,
graph: CsrGraph<'_>,
plan: &mut crate::fixed_point_graph::FixedPointAnalysisPlan,
) -> Result<(), String> {
crate::live::prepare_live_plan_into_with_scratch(
plan,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
&mut self.scratch,
)
}
pub fn live_prepared(
&mut self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::live::live_closure_prepared_borrowed_into_with_scratch_via(
self.dispatch,
graph,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn live_prepared_into(
&mut self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::live::live_closure_prepared_borrowed_into_result_with_scratch_via(
self.dispatch,
graph,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
pub fn live_plan(
&mut self,
plan: &crate::fixed_point_graph::FixedPointAnalysisPlan,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::live::live_closure_plan_borrowed_into_with_scratch_via(
self.dispatch,
plan,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn live_plan_into(
&mut self,
plan: &crate::fixed_point_graph::FixedPointAnalysisPlan,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::live::live_closure_plan_borrowed_into_result_with_scratch_via(
self.dispatch,
plan,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
}