Simple benchmark that repeatedly runs the generated function.
| 71 | |
| 72 | // Simple benchmark that repeatedly runs the generated function. |
| 73 | void BM_NAME(int iters) { |
| 74 | testing::StopTiming(); |
| 75 | |
| 76 | Eigen::ThreadPool pool(port::MaxParallelism()); |
| 77 | Eigen::ThreadPoolDevice device(&pool, pool.NumThreads()); |
| 78 | |
| 79 | CPP_CLASS computation; |
| 80 | computation.set_thread_pool(&device); |
| 81 | zero_buffers(&computation); |
| 82 | |
| 83 | testing::StartTiming(); |
| 84 | while (--iters) { |
| 85 | computation.Run(); |
| 86 | } |
| 87 | testing::StopTiming(); |
| 88 | } |
| 89 | BENCHMARK(BM_NAME); |
| 90 | |
| 91 | } // namespace |
nothing calls this directly
no test coverage detected