Add multi-thread bdd eval

This commit is contained in:
Pro7ech
2025-11-12 11:02:37 +01:00
parent 6924ffd94a
commit 1423de1c46
22 changed files with 336 additions and 273 deletions

View File

@@ -30,12 +30,24 @@ pub trait TakeSlice {
impl<BE: Backend> Scratch<BE>
where
Self: TakeSlice + ScratchFromBytes<BE>,
Self: TakeSlice + ScratchAvailable + ScratchFromBytes<BE>,
{
pub fn split_at_mut(&mut self, len: usize) -> (&mut Scratch<BE>, &mut Self) {
let (take_slice, rem_slice) = self.take_slice(len);
(Self::from_bytes(take_slice), rem_slice)
}
pub fn split_mut(&mut self, n: usize, len: usize) -> (Vec<&mut Scratch<BE>>, &mut Self) {
assert!(self.available() >= n * len);
let mut scratches: Vec<&mut Scratch<BE>> = Vec::with_capacity(n);
let mut scratch: &mut Scratch<BE> = self;
for _ in 0..n {
let (tmp, scratch_new) = scratch.split_at_mut(len);
scratch = scratch_new;
scratches.push(tmp);
}
(scratches, scratch)
}
}
impl<B: Backend> ScratchTakeBasic for Scratch<B> where Self: TakeSlice + ScratchFromBytes<B> {}