Skip to content

Commit 744298f

Browse files
committed
stash
1 parent aff88e4 commit 744298f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

starky/src/fft_p.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::constant::{get_max_workers, MAX_OPS_PER_THREAD, MIN_OPS_PER_THREAD, S
33
use crate::fft_worker::{fft_block, interpolate_prepare_block};
44
use crate::helper::log2_any;
55
use crate::traits::FieldExtension;
6+
use crate::utils::parallells::parallelize;
67
use core::cmp::min;
78
use lazy_static::lazy_static;
89
use rayon::prelude::*;
@@ -95,11 +96,13 @@ pub fn bit_reverse<F: FieldExtension>(
9596
let n = 1 << nbits;
9697
let ris = BRs(0, n, nbits); // move it outside the loop. obtain it from cache.
9798

98-
// todo remove the double loop, and parallel
99-
for i in 0..n {
100-
for k in 0..n_pols {
101-
buffdst[i * n_pols + k] = buffsrc[ris[i] * n_pols + k];
102-
}
99+
// todo parallel. Does the buffdst
100+
let len = n * n_pols;
101+
assert_eq!(len, buffdst.len()); // is ok?
102+
for j in 0..len {
103+
let i = j / n_pols;
104+
let k = j % n_pols;
105+
buffdst[j] = buffsrc[ris[i] * n_pols + k];
103106
}
104107
}
105108

0 commit comments

Comments
 (0)