@@ -68,14 +68,14 @@ fn measure_n_runs(
68
68
stack : PodStack ,
69
69
) -> Duration {
70
70
let n = buf. len ( ) ;
71
- let ( mut scratch, _) = stack. make_aligned_raw :: < c64 > ( n, CACHELINE_ALIGN ) ;
71
+ let ( scratch, _) = stack. make_aligned_raw :: < c64 > ( n, CACHELINE_ALIGN ) ;
72
72
let [ fwd, _] = get_fn_ptr ( algo, n) ;
73
73
74
74
use std:: time:: Instant ;
75
75
let now = Instant :: now ( ) ;
76
76
77
77
for _ in 0 ..n_runs {
78
- fwd ( buf, & mut scratch, twiddles, twiddles_init) ;
78
+ fwd ( buf, scratch, twiddles, twiddles_init) ;
79
79
}
80
80
81
81
now. elapsed ( )
@@ -112,7 +112,7 @@ pub(crate) fn measure_fastest(
112
112
let ( twiddles, stack) = stack. make_aligned_with :: < c64 , _ > ( 2 * n, align, f) ;
113
113
let twiddles_init = & twiddles[ ..n] ;
114
114
let twiddles = & twiddles[ n..] ;
115
- let ( mut buf, mut stack) = stack. make_aligned_with :: < c64 , _ > ( n, align, f) ;
115
+ let ( buf, mut stack) = stack. make_aligned_with :: < c64 , _ > ( n, align, f) ;
116
116
117
117
{
118
118
// initialize scratch to load it in the cpu cache
@@ -142,14 +142,8 @@ pub(crate) fn measure_fastest(
142
142
let mut n_runs: u128 = 1 ;
143
143
144
144
loop {
145
- let duration = measure_n_runs (
146
- n_runs,
147
- algo,
148
- & mut buf,
149
- twiddles_init,
150
- twiddles,
151
- stack. rb_mut ( ) ,
152
- ) ;
145
+ let duration =
146
+ measure_n_runs ( n_runs, algo, buf, twiddles_init, twiddles, stack. rb_mut ( ) ) ;
153
147
154
148
if duration < MIN_DURATION {
155
149
n_runs *= 2 ;
@@ -164,14 +158,8 @@ pub(crate) fn measure_fastest(
164
158
* avg = if n_runs <= init_n_runs {
165
159
approx_duration
166
160
} else {
167
- let duration = measure_n_runs (
168
- n_runs,
169
- algo,
170
- & mut buf,
171
- twiddles_init,
172
- twiddles,
173
- stack. rb_mut ( ) ,
174
- ) ;
161
+ let duration =
162
+ measure_n_runs ( n_runs, algo, buf, twiddles_init, twiddles, stack. rb_mut ( ) ) ;
175
163
duration_div_f64 ( duration, n_runs as f64 )
176
164
} ;
177
165
}
@@ -346,9 +334,9 @@ impl Plan {
346
334
/// ```
347
335
pub fn fwd ( & self , buf : & mut [ c64 ] , stack : PodStack ) {
348
336
let n = self . fft_size ( ) ;
349
- let ( mut scratch, _) = stack. make_aligned_raw :: < c64 > ( n, CACHELINE_ALIGN ) ;
337
+ let ( scratch, _) = stack. make_aligned_raw :: < c64 > ( n, CACHELINE_ALIGN ) ;
350
338
let ( w_init, w) = split_2 ( & self . twiddles ) ;
351
- ( self . fwd ) ( buf, & mut scratch, w_init, w)
339
+ ( self . fwd ) ( buf, scratch, w_init, w)
352
340
}
353
341
354
342
/// Performs an inverse FFT in place, using the provided stack as scratch space.
@@ -372,9 +360,9 @@ impl Plan {
372
360
/// ```
373
361
pub fn inv ( & self , buf : & mut [ c64 ] , stack : PodStack ) {
374
362
let n = self . fft_size ( ) ;
375
- let ( mut scratch, _) = stack. make_aligned_raw :: < c64 > ( n, CACHELINE_ALIGN ) ;
363
+ let ( scratch, _) = stack. make_aligned_raw :: < c64 > ( n, CACHELINE_ALIGN ) ;
376
364
let ( w_init, w) = split_2 ( & self . twiddles_inv ) ;
377
- ( self . inv ) ( buf, & mut scratch, w_init, w)
365
+ ( self . inv ) ( buf, scratch, w_init, w)
378
366
}
379
367
}
380
368
0 commit comments