Add zip_mut_with layour benches
@@ -370,3 +370,23 @@ fn iter_axis_chunks_5_iter_sum(bench: &mut Bencher) {
.sum::<f32>()
});
}
+
+pub fn zip_mut_with(data: &Array3<f32>, out: &mut Array3<f32>) {
+ out.zip_mut_with(&data, |o, &i| {
+ *o = i;
+ });
+}
+
+#[bench]
+fn zip_mut_with_cc(b: &mut Bencher) {
+ let data: Array3<f32> = Array3::zeros((ISZ, ISZ, ISZ));
+ let mut out = Array3::zeros(data.dim());
+ b.iter(|| black_box(zip_mut_with(&data, &mut out)));
+}
+
+#[bench]
+fn zip_mut_with_ff(b: &mut Bencher) {
+ let data: Array3<f32> = Array3::zeros((ISZ, ISZ, ISZ).f());
+ let mut out = Array3::zeros(data.dim().f());
+ b.iter(|| black_box(zip_mut_with(&data, &mut out)));
+}
