Skip to content

Commit

Permalink
fri par domain iter (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohad-starkware authored Jan 14, 2025
1 parent 90b3e55 commit d05215c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/prover/src/core/backend/simd/quotients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ fn denominator_inverses(
) -> Vec<CM31Column> {
// We want a P to be on a line that passes through a point Pr + uPi in QM31^2, and its conjugate
// Pr - uPi. Thus, Pr - P is parallel to Pi. Or, (Pr - P).x * Pi.y - (Pr - P).y * Pi.x = 0.
let domain_points = CircleDomainBitRevIterator::new(domain).collect_vec();

#[cfg(not(feature = "parallel"))]
let iter = domain_points.into_iter();

#[cfg(feature = "parallel")]
let iter = domain_points.par_iter();

let flat_denominators: CM31Column = sample_batches
.iter()
.flat_map(|sample_batch| {
Expand All @@ -237,9 +245,9 @@ fn denominator_inverses(

// Line equation through pr +-u pi.
// (p-pr)*
CircleDomainBitRevIterator::new(domain)
iter.clone()
.map(|points| (prx - points.x) * piy - (pry - points.y) * pix)
.collect_vec()
.collect::<Vec<_>>()
})
.collect();

Expand Down

0 comments on commit d05215c

Please sign in to comment.