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 slice(
&mut self,
graph: CsrGraph<'_>,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::slice::slice_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 slice_into(
&mut self,
graph: CsrGraph<'_>,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::slice::slice_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_slice(
&self,
graph: CsrGraph<'_>,
) -> Result<crate::fixed_point_graph::FixedPointForwardGraph, String> {
crate::slice::prepare_slice_graph(
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn prepare_slice_into(
&self,
graph: CsrGraph<'_>,
prepared: &mut crate::fixed_point_graph::FixedPointForwardGraph,
) -> Result<(), String> {
crate::slice::prepare_slice_graph_into(
prepared,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn prepare_slice_plan(
&self,
graph: CsrGraph<'_>,
) -> Result<crate::fixed_point_graph::FixedPointAnalysisPlan, String> {
crate::slice::prepare_slice_plan(
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn prepare_slice_plan_into(
&self,
graph: CsrGraph<'_>,
plan: &mut crate::fixed_point_graph::FixedPointAnalysisPlan,
) -> Result<(), String> {
crate::slice::prepare_slice_plan_into(
plan,
graph.node_count,
graph.edge_offsets,
graph.edge_targets,
graph.edge_kind_mask,
)
}
pub fn slice_prepared(
&mut self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::slice::slice_closure_prepared_borrowed_into_with_scratch_via(
self.dispatch,
graph,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn slice_prepared_into(
&mut self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::slice::slice_closure_prepared_borrowed_into_result_with_scratch_via(
self.dispatch,
graph,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
pub fn slice_plan(
&mut self,
plan: &crate::fixed_point_graph::FixedPointAnalysisPlan,
seed_bits: &[u32],
max_iterations: u32,
) -> Result<Vec<u32>, String> {
crate::slice::slice_closure_plan_borrowed_into_with_scratch_via(
self.dispatch,
plan,
seed_bits,
max_iterations,
&mut self.scratch,
)
}
pub fn slice_plan_into(
&mut self,
plan: &crate::fixed_point_graph::FixedPointAnalysisPlan,
seed_bits: &[u32],
max_iterations: u32,
result: &mut Vec<u32>,
) -> Result<(), String> {
crate::slice::slice_closure_plan_borrowed_into_result_with_scratch_via(
self.dispatch,
plan,
seed_bits,
max_iterations,
&mut self.scratch,
result,
)
}
}