Skip to content

Commit

Permalink
add miri ignore for benches
Browse files Browse the repository at this point in the history
  • Loading branch information
cospectrum committed Apr 27, 2024
1 parent 5618aa8 commit 8ba7732
Show file tree
Hide file tree
Showing 27 changed files with 69 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/binary_descriptors/brief.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ mod tests {
assert_eq!(local_pixel_average(&integral_image, 3, 3, 2), 117);
}

#[cfg_attr(miri, ignore)]
#[bench]
#[ignore]
fn bench_brief_random_test_pairs_1000_keypoints(b: &mut Bencher) {
Expand All @@ -345,6 +346,7 @@ mod tests {
})
}

#[cfg_attr(miri, ignore)]
#[bench]
#[ignore]
fn bench_brief_fixed_test_pairs_1000_keypoints(b: &mut Bencher) {
Expand Down
1 change: 1 addition & 0 deletions src/binary_descriptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pub fn match_binary_descriptors<'a, T: BinaryDescriptor>(
matches
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
10 changes: 10 additions & 0 deletions src/contrast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_adaptive_threshold(b: &mut Bencher) {
let image = gray_bench_image(200, 200);
Expand All @@ -374,6 +375,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_match_histogram(b: &mut Bencher) {
let target = GrayImage::from_pixel(200, 200, Luma([150]));
Expand All @@ -384,6 +386,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_match_histogram_mut(b: &mut Bencher) {
let target = GrayImage::from_pixel(200, 200, Luma([150]));
Expand Down Expand Up @@ -465,6 +468,7 @@ mod tests {
assert_eq!(level, 120);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_otsu_level(b: &mut Bencher) {
let image = gray_bench_image(200, 200);
Expand Down Expand Up @@ -508,6 +512,7 @@ mod tests {
assert_pixels_eq!(expected, actual);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_equalize_histogram(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand All @@ -517,6 +522,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_equalize_histogram_mut(b: &mut Bencher) {
let mut image = gray_bench_image(500, 500);
Expand All @@ -526,6 +532,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_threshold(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand All @@ -535,6 +542,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_threshold_mut(b: &mut Bencher) {
let mut image = gray_bench_image(500, 500);
Expand All @@ -544,6 +552,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_stretch_contrast(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand All @@ -553,6 +562,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_stretch_contrast_mut(b: &mut Bencher) {
let mut image = gray_bench_image(500, 500);
Expand Down
4 changes: 4 additions & 0 deletions src/corners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ mod tests {
);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_intensity_centroid(b: &mut Bencher) {
let image = gray_image!(
Expand All @@ -659,6 +660,7 @@ mod tests {
b.iter(|| black_box(intensity_centroid(&image, 3, 3, 3)));
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_oriented_fast_corner(b: &mut Bencher) {
let image = gray_image!(
Expand All @@ -673,6 +675,7 @@ mod tests {
b.iter(|| black_box(oriented_fast(&image, Some(0), 1, 0, Some(0xc0))));
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_oriented_fast_non_corner(b: &mut Bencher) {
let image = gray_image!(
Expand All @@ -687,6 +690,7 @@ mod tests {
b.iter(|| black_box(oriented_fast(&image, Some(255), 0, 0, Some(0xc0))));
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_is_corner_fast9_9_contiguous_lighter_pixels(b: &mut Bencher) {
let image = black_box(gray_image!(
Expand Down
1 change: 1 addition & 0 deletions src/distance_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/drawing/bezier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub fn draw_cubic_bezier_curve_mut<C>(
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use image::{GrayImage, Luma};
Expand Down
1 change: 1 addition & 0 deletions src/drawing/conics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/drawing/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ fn hysteresis(
out
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::canny;
Expand Down
1 change: 1 addition & 0 deletions src/filter/median.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ impl HistSet {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
12 changes: 12 additions & 0 deletions src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ mod tests {
use std::cmp::{max, min};
use test::{black_box, Bencher};

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_bilateral_filter(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand Down Expand Up @@ -609,6 +610,7 @@ mod tests {
assert_pixels_eq!(box_filter(&image, 1, 1), expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_box_filter(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand Down Expand Up @@ -655,6 +657,7 @@ mod tests {
assert_pixels_eq!(filtered, expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_separable_filter(b: &mut Bencher) {
let image = gray_bench_image(300, 300);
Expand Down Expand Up @@ -793,6 +796,7 @@ mod tests {
black_box(horizontal_filter(&image, &kernel));
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_horizontal_filter(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand Down Expand Up @@ -832,6 +836,7 @@ mod tests {
black_box(vertical_filter(&image, &kernel));
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_vertical_filter(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand Down Expand Up @@ -925,6 +930,7 @@ mod tests {
assert_pixels_eq!(filtered, expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_filter3x3_i32_filter(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand All @@ -951,6 +957,7 @@ mod tests {
blur(image, stdev)
}

#[cfg_attr(miri, ignore)]
#[bench]
#[ignore] // Gives a baseline performance using code from another library
fn bench_baseline_gaussian_stdev_1(b: &mut Bencher) {
Expand All @@ -961,6 +968,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
#[ignore] // Gives a baseline performance using code from another library
fn bench_baseline_gaussian_stdev_3(b: &mut Bencher) {
Expand All @@ -971,6 +979,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
#[ignore] // Gives a baseline performance using code from another library
fn bench_baseline_gaussian_stdev_10(b: &mut Bencher) {
Expand All @@ -981,6 +990,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_gaussian_f32_stdev_1(b: &mut Bencher) {
let image = rgb_bench_image(100, 100);
Expand All @@ -990,6 +1000,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_gaussian_f32_stdev_3(b: &mut Bencher) {
let image = rgb_bench_image(100, 100);
Expand All @@ -999,6 +1010,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_gaussian_f32_stdev_10(b: &mut Bencher) {
let image = rgb_bench_image(100, 100);
Expand Down
10 changes: 10 additions & 0 deletions src/geometric_transformations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ mod tests {
assert_pixels_eq!(rotated, expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_rotate_nearest(b: &mut Bencher) {
let image = GrayImage::from_pixel(200, 200, Luma([15u8]));
Expand All @@ -806,6 +807,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_rotate_bilinear(b: &mut Bencher) {
let image = GrayImage::from_pixel(200, 200, Luma([15u8]));
Expand All @@ -817,6 +819,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_rotate_bicubic(b: &mut Bencher) {
let image = GrayImage::from_pixel(200, 200, Luma([15u8]));
Expand Down Expand Up @@ -893,6 +896,7 @@ mod tests {
assert_pixels_eq!(translated, expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_translate(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand Down Expand Up @@ -966,6 +970,7 @@ mod tests {
assert_pixels_eq!(translated, expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_translate_projection(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand All @@ -977,6 +982,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_translate_with(b: &mut Bencher) {
let image = gray_bench_image(500, 500);
Expand Down Expand Up @@ -1048,6 +1054,7 @@ mod tests {
assert_pixels_eq!(translated_bicubic, expected);
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_affine_nearest(b: &mut Bencher) {
let image = GrayImage::from_pixel(200, 200, Luma([15u8]));
Expand All @@ -1065,6 +1072,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_affine_bilinear(b: &mut Bencher) {
let image = GrayImage::from_pixel(200, 200, Luma([15u8]));
Expand All @@ -1082,6 +1090,7 @@ mod tests {
});
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_affine_bicubic(b: &mut test::Bencher) {
let image = GrayImage::from_pixel(200, 200, Luma([15u8]));
Expand Down Expand Up @@ -1218,6 +1227,7 @@ mod tests {
p.unwrap();
}

#[cfg_attr(miri, ignore)]
#[bench]
fn bench_from_control_points(b: &mut Bencher) {
let from = [(0f32, 0.0), (50.0, 50.0), (50.0, 0.0), (0.0, 50.0)];
Expand Down
1 change: 1 addition & 0 deletions src/gradients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/haar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/hog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ mod tests {
}
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/hough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ mod tests {
test_detect_line!(detect_line_neg10_120, -10.0, 120);
}

#[cfg_attr(miri, ignore)]
#[cfg(test)]
mod benches {
use super::*;
Expand Down
Loading

0 comments on commit 8ba7732

Please sign in to comment.