Skip to content

Commit

Permalink
Fix benches
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner314 committed May 1, 2019
1 parent 4f5f4a3 commit d319e2f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion benches/bench1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ fn add_2d_zip_alloc(bench: &mut test::Bencher)
bench.iter(|| {
unsafe {
let mut c = Array::uninitialized(a.dim());
azip!(a, b, mut c in { *c = a + b });
azip!((&a in &a, &b in &b, c in &mut c) *c = a + b);
c
}
});
Expand Down
4 changes: 2 additions & 2 deletions benches/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn chunk2x2_iter_sum(bench: &mut Bencher)
let chunksz = (2, 2);
let mut sum = Array::zeros(a.exact_chunks(chunksz).raw_dim());
bench.iter(|| {
azip!(ref a (a.exact_chunks(chunksz)), mut sum in {
azip!((a in a.exact_chunks(chunksz), sum in &mut sum) {
*sum = a.iter().sum::<f32>();
});
});
Expand All @@ -27,7 +27,7 @@ fn chunk2x2_sum(bench: &mut Bencher)
let chunksz = (2, 2);
let mut sum = Array::zeros(a.exact_chunks(chunksz).raw_dim());
bench.iter(|| {
azip!(ref a (a.exact_chunks(chunksz)), mut sum in {
azip!((a in a.exact_chunks(chunksz), sum in &mut sum) {
*sum = a.sum();
});
});
Expand Down
4 changes: 2 additions & 2 deletions benches/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn sum_3_azip(bench: &mut Bencher)
let c = vec![1; ZIPSZ];
bench.iter(|| {
let mut s = 0;
azip!(a, b, c in {
azip!((&a in &a, &b in &b, &c in &c) {
s += a + b + c;
});
s
Expand All @@ -185,7 +185,7 @@ fn vector_sum_3_azip(bench: &mut Bencher)
let b = vec![1.; ZIPSZ];
let mut c = vec![1.; ZIPSZ];
bench.iter(|| {
azip!(a, b, mut c in {
azip!((&a in &a, &b in &b, c in &mut c) {
*c += a + b;
});
});
Expand Down
2 changes: 1 addition & 1 deletion benches/par_rayon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn add(bench: &mut Bencher)
let c = Array2::<f64>::zeros((ADDN, ADDN));
let d = Array2::<f64>::zeros((ADDN, ADDN));
bench.iter(|| {
azip!(mut a, b, c, d in {
azip!((a in &mut a, &b in &b, &c in &c, &d in &d) {
*a += b.exp() + c.exp() + d.exp();
});
});
Expand Down

0 comments on commit d319e2f

Please sign in to comment.