mod dispatch;
#[cfg(test)]
mod reference;
#[cfg(test)]
mod tests;
use crate::graph::dispatch_bridge::{CachedProgram, ProgramCache};
use vyre_primitives::graph::toposort::ToposortCsrStaticInputKey;
pub use dispatch::{
topo_order_csr_via, topo_order_csr_via_with_scratch, topo_order_csr_via_with_scratch_into,
};
#[cfg(test)]
pub use reference::{reference_all_reachable, reference_reachable_set, reference_topo_order};
#[derive(Debug, Default)]
pub struct ToposortGpuScratch {
inputs: Vec<Vec<u8>>,
program_cache: ProgramCache<u32, CachedToposortProgram>,
static_input_key: Option<ToposortCsrStaticInputKey>,
}
type CachedToposortProgram = CachedProgram;
impl ToposortGpuScratch {
#[cfg(test)]
fn program_builds(&self) -> usize {
self.program_cache.builds()
}
}