Skip to content

Commit d319e2f

Browse files
committed
Fix benches
1 parent 4f5f4a3 commit d319e2f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

benches/bench1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ fn add_2d_zip_alloc(bench: &mut test::Bencher)
319319
bench.iter(|| {
320320
unsafe {
321321
let mut c = Array::uninitialized(a.dim());
322-
azip!(a, b, mut c in { *c = a + b });
322+
azip!((&a in &a, &b in &b, c in &mut c) *c = a + b);
323323
c
324324
}
325325
});

benches/chunks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn chunk2x2_iter_sum(bench: &mut Bencher)
1414
let chunksz = (2, 2);
1515
let mut sum = Array::zeros(a.exact_chunks(chunksz).raw_dim());
1616
bench.iter(|| {
17-
azip!(ref a (a.exact_chunks(chunksz)), mut sum in {
17+
azip!((a in a.exact_chunks(chunksz), sum in &mut sum) {
1818
*sum = a.iter().sum::<f32>();
1919
});
2020
});
@@ -27,7 +27,7 @@ fn chunk2x2_sum(bench: &mut Bencher)
2727
let chunksz = (2, 2);
2828
let mut sum = Array::zeros(a.exact_chunks(chunksz).raw_dim());
2929
bench.iter(|| {
30-
azip!(ref a (a.exact_chunks(chunksz)), mut sum in {
30+
azip!((a in a.exact_chunks(chunksz), sum in &mut sum) {
3131
*sum = a.sum();
3232
});
3333
});

benches/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn sum_3_azip(bench: &mut Bencher)
158158
let c = vec![1; ZIPSZ];
159159
bench.iter(|| {
160160
let mut s = 0;
161-
azip!(a, b, c in {
161+
azip!((&a in &a, &b in &b, &c in &c) {
162162
s += a + b + c;
163163
});
164164
s
@@ -185,7 +185,7 @@ fn vector_sum_3_azip(bench: &mut Bencher)
185185
let b = vec![1.; ZIPSZ];
186186
let mut c = vec![1.; ZIPSZ];
187187
bench.iter(|| {
188-
azip!(a, b, mut c in {
188+
azip!((&a in &a, &b in &b, c in &mut c) {
189189
*c += a + b;
190190
});
191191
});

benches/par_rayon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn add(bench: &mut Bencher)
135135
let c = Array2::<f64>::zeros((ADDN, ADDN));
136136
let d = Array2::<f64>::zeros((ADDN, ADDN));
137137
bench.iter(|| {
138-
azip!(mut a, b, c, d in {
138+
azip!((a in &mut a, &b in &b, &c in &c, &d in &d) {
139139
*a += b.exp() + c.exp() + d.exp();
140140
});
141141
});

0 commit comments

Comments
 (0)