use crate::fixed_point_scratch::FixedPointScratch;
mod ifds;
mod live;
mod points_to;
mod reaching;
mod slice;
#[cfg(test)]
mod tests;
pub use crate::graph_layout::CsrGraph;
#[derive(Clone, Debug, PartialEq)]
pub struct FixedPointBatch<'a, F> {
dispatch: &'a F,
scratch: FixedPointScratch,
ifds_prepare_scratch: crate::ifds_gpu::IfdsPrepareScratch,
ifds_scratch: crate::ifds_gpu::IfdsSolveScratch,
}
impl<'a, F> FixedPointBatch<'a, F>
where
F: Fn(&vyre::ir::Program, &[&[u8]], Option<[u32; 3]>, &mut Vec<Vec<u8>>) -> Result<(), String>,
{
#[must_use]
pub fn new(dispatch: &'a F) -> Self {
Self {
dispatch,
scratch: FixedPointScratch::default(),
ifds_prepare_scratch: crate::ifds_gpu::IfdsPrepareScratch::default(),
ifds_scratch: crate::ifds_gpu::IfdsSolveScratch::default(),
}
}
#[must_use]
pub fn scratch(&self) -> &FixedPointScratch {
&self.scratch
}
#[must_use]
pub fn frontier_density(&self) -> crate::fixed_point_scratch::FrontierDensityTelemetry {
self.scratch.frontier_density()
}
#[must_use]
pub fn recommended_frontier_execution_mode(
&self,
) -> crate::fixed_point_scratch::FrontierExecutionMode {
self.scratch.frontier_density().recommended_execution_mode()
}
pub fn execution_plan_for_prepared_graph(
&self,
graph: &crate::fixed_point_graph::FixedPointForwardGraph,
) -> Result<crate::fixed_point_execution_plan::FixedPointExecutionPlan, String> {
crate::fixed_point_execution_plan::plan_prepared_graph(graph, self.frontier_density())
}
pub fn clear(&mut self) {
self.scratch.clear();
self.ifds_prepare_scratch.clear();
self.ifds_scratch.clear();
}
}