Skip to content

Commit aeb75d4

Browse files
committed
chorre(ci): fix clippy lints
1 parent 47e02d3 commit aeb75d4

File tree

3 files changed

+21
-33
lines changed

3 files changed

+21
-33
lines changed

src/ordered.rs

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ fn measure_n_runs(
6868
stack: PodStack,
6969
) -> Duration {
7070
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);
7272
let [fwd, _] = get_fn_ptr(algo, n);
7373

7474
use std::time::Instant;
7575
let now = Instant::now();
7676

7777
for _ in 0..n_runs {
78-
fwd(buf, &mut scratch, twiddles, twiddles_init);
78+
fwd(buf, scratch, twiddles, twiddles_init);
7979
}
8080

8181
now.elapsed()
@@ -112,7 +112,7 @@ pub(crate) fn measure_fastest(
112112
let (twiddles, stack) = stack.make_aligned_with::<c64, _>(2 * n, align, f);
113113
let twiddles_init = &twiddles[..n];
114114
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);
116116

117117
{
118118
// initialize scratch to load it in the cpu cache
@@ -142,14 +142,8 @@ pub(crate) fn measure_fastest(
142142
let mut n_runs: u128 = 1;
143143

144144
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());
153147

154148
if duration < MIN_DURATION {
155149
n_runs *= 2;
@@ -164,14 +158,8 @@ pub(crate) fn measure_fastest(
164158
*avg = if n_runs <= init_n_runs {
165159
approx_duration
166160
} 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());
175163
duration_div_f64(duration, n_runs as f64)
176164
};
177165
}
@@ -346,9 +334,9 @@ impl Plan {
346334
/// ```
347335
pub fn fwd(&self, buf: &mut [c64], stack: PodStack) {
348336
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);
350338
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)
352340
}
353341

354342
/// Performs an inverse FFT in place, using the provided stack as scratch space.
@@ -372,9 +360,9 @@ impl Plan {
372360
/// ```
373361
pub fn inv(&self, buf: &mut [c64], stack: PodStack) {
374362
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);
376364
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)
378366
}
379367
}
380368

src/unordered.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ fn measure_fastest(
602602
let (w, stack) = stack
603603
.rb_mut()
604604
.make_aligned_with::<c64, _>(n + base_n, align, f);
605-
let (mut scratch, stack) = stack.make_aligned_with::<c64, _>(base_n, align, f);
606-
let (mut z, _) = stack.make_aligned_with::<c64, _>(n, align, f);
605+
let (scratch, stack) = stack.make_aligned_with::<c64, _>(base_n, align, f);
606+
let (z, _) = stack.make_aligned_with::<c64, _>(n, align, f);
607607

608608
let n_runs = min_bench_duration_per_algo.as_secs_f64()
609609
/ (duration.as_secs_f64() * (n / base_n) as f64);
@@ -614,11 +614,11 @@ fn measure_fastest(
614614
let now = Instant::now();
615615
for _ in 0..n_runs {
616616
fwd_depth(
617-
&mut z,
618-
&w,
617+
z,
618+
w,
619619
base_fn,
620620
base_n,
621-
&mut scratch,
621+
scratch,
622622
fwd_process_x2,
623623
fwd_process_x4,
624624
fwd_process_x8,
@@ -824,13 +824,13 @@ impl Plan {
824824
/// ```
825825
pub fn fwd(&self, buf: &mut [c64], stack: PodStack) {
826826
assert_eq!(self.fft_size(), buf.len());
827-
let (mut scratch, _) = stack.make_aligned_raw::<c64>(self.algo().1, CACHELINE_ALIGN);
827+
let (scratch, _) = stack.make_aligned_raw::<c64>(self.algo().1, CACHELINE_ALIGN);
828828
fwd_depth(
829829
buf,
830830
&self.twiddles,
831831
self.base_fn_fwd,
832832
self.base_n,
833-
&mut scratch,
833+
scratch,
834834
self.fwd_process_x2,
835835
self.fwd_process_x4,
836836
self.fwd_process_x8,
@@ -925,13 +925,13 @@ impl Plan {
925925
/// ```
926926
pub fn inv(&self, buf: &mut [c64], stack: PodStack) {
927927
assert_eq!(self.fft_size(), buf.len());
928-
let (mut scratch, _) = stack.make_aligned_raw::<c64>(self.algo().1, CACHELINE_ALIGN);
928+
let (scratch, _) = stack.make_aligned_raw::<c64>(self.algo().1, CACHELINE_ALIGN);
929929
inv_depth(
930930
buf,
931931
&self.twiddles_inv,
932932
self.base_fn_inv,
933933
self.base_n,
934-
&mut scratch,
934+
scratch,
935935
self.inv_process_x2,
936936
self.inv_process_x4,
937937
self.inv_process_x8,

toolchain.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2024-02-08
1+
nightly-2024-07-18

0 commit comments

Comments
 (0)