MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_CalibrateWorkLoop

Function BM_CalibrateWorkLoop

tensorflow/stream_executor/lib/statusor_test.cc:518–528  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
518void 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}
529BENCHMARK(BM_CalibrateWorkLoop);
530
531// Measure the time taken to call into the factory, return the value,

Callers

nothing calls this directly

Calls 3

StopTimingFunction · 0.85
StartTimingFunction · 0.85
DoWorkMethod · 0.80

Tested by

no test coverage detected