| 280 | |
| 281 | template <int R, int W, int H> |
| 282 | __attribute__((noinline)) static void run_benchmark(const char *label, int iters) { |
| 283 | constexpr int N = W * H; |
| 284 | static CRGB px[N]; // static to avoid stack overflow with ASAN |
| 285 | |
| 286 | auto t = bench( |
| 287 | [&]() { |
| 288 | fill_test_data(px, N); |
| 289 | gfx::Canvas<CRGB> c(fl::span<CRGB>(px, N), W, H); |
| 290 | gfx::blurGaussian<R, R>(c); |
| 291 | }, |
| 292 | iters); |
| 293 | |
| 294 | char buf[80]; |
| 295 | fl::snprintf(buf, sizeof(buf), " %s: %d ns/iter", label, |
| 296 | static_cast<int>(t)); |
| 297 | fl::println(buf); |
| 298 | } |
| 299 | |
| 300 | template <int R, int W, int H> |
| 301 | __attribute__((noinline)) static void run_benchmark_blur_only(const char *label, int iters) { |
nothing calls this directly
no test coverage detected