Calibrate the amount of time spent just calling DoWork, since each of our tests will do this, we can subtract this out of benchmark results.
| 516 | // Calibrate the amount of time spent just calling DoWork, since each of our |
| 517 | // tests will do this, we can subtract this out of benchmark results. |
| 518 | void BM_CalibrateWorkLoop(int iters) { |
| 519 | tensorflow::testing::StopTiming(); |
| 520 | BenchmarkFactory<BenchmarkType> factory; |
| 521 | BenchmarkType* result = factory.TrivialFactory(); |
| 522 | tensorflow::testing::StartTiming(); |
| 523 | for (int i = 0; i != iters; ++i) { |
| 524 | if (result != nullptr) { |
| 525 | result->DoWork(); |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | BENCHMARK(BM_CalibrateWorkLoop); |
| 530 | |
| 531 | // Measure the time taken to call into the factory, return the value, |
nothing calls this directly
no test coverage detected