@@ -9,7 +9,6 @@ use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAss
99use core:: { array, slice} ;
1010
1111use num_bigint:: BigUint ;
12- use rayon:: { current_num_threads, prelude:: * } ;
1312use serde:: Serialize ;
1413use serde:: de:: DeserializeOwned ;
1514use utils:: { flatten_to_base, iter_array_chunks_padded} ;
@@ -1020,24 +1019,21 @@ impl<F: Field> BoundedPowers<F> {
10201019 let mut points_packed = F :: Packing :: zero_vec ( num_packed) ;
10211020
10221021 // Split computation evenly among threads
1023- let num_threads = current_num_threads ( ) . max ( 1 ) ;
1022+ let num_threads = parallel :: num_threads ( ) . max ( 1 ) ;
10241023 let chunk_size = num_packed. div_ceil ( num_threads) ;
10251024
10261025 // Precompute base for each chunk.
10271026 let base = self . iter . base ;
10281027 let chunk_base = base. exp_u64 ( ( chunk_size * width) as u64 ) ;
10291028 let shift = self . iter . current ;
10301029
1031- points_packed
1032- . par_chunks_mut ( chunk_size)
1033- . enumerate ( )
1034- . for_each ( |( chunk_idx, chunk_slice) | {
1035- // First power in this chunk
1036- let chunk_start = shift * chunk_base. exp_u64 ( chunk_idx as u64 ) ;
1030+ parallel:: par_chunks_mut ( & mut points_packed, chunk_size, |chunk_idx, chunk_slice| {
1031+ // First power in this chunk
1032+ let chunk_start = shift * chunk_base. exp_u64 ( chunk_idx as u64 ) ;
10371033
1038- // Fill the chunk with packed powers.
1039- F :: Packing :: packed_shifted_powers ( base, chunk_start) . fill ( chunk_slice) ;
1040- } ) ;
1034+ // Fill the chunk with packed powers.
1035+ F :: Packing :: packed_shifted_powers ( base, chunk_start) . fill ( chunk_slice) ;
1036+ } ) ;
10411037
10421038 // return the number of requested points, discarding the unused packed powers
10431039 // SAFETY: size_of::<F::Packing> always divides size_of::<F::Packing>.
0 commit comments