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

Function BM_StatusOrFactory

tensorflow/stream_executor/lib/statusor_test.cc:565–575  ·  view source on GitHub ↗

Measure the time to use the StatusOr factory, evaluate the result, and invoke the trivial function.

Source from the content-addressed store, hash-verified

563// Measure the time to use the StatusOr<T*> factory, evaluate the result,
564// and invoke the trivial function.
565void BM_StatusOrFactory(int iters) {
566 tensorflow::testing::StopTiming();
567 BenchmarkFactory<BenchmarkType> factory;
568 tensorflow::testing::StartTiming();
569 for (int i = 0; i != iters; ++i) {
570 StatusOr<BenchmarkType*> result = factory.StatusOrFactory();
571 if (result.ok()) {
572 result.ValueOrDie()->DoWork();
573 }
574 }
575}
576BENCHMARK(BM_StatusOrFactory);
577
578// Measure the time taken to call into the factory, providing an

Callers

nothing calls this directly

Calls 4

StopTimingFunction · 0.85
StartTimingFunction · 0.85
DoWorkMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected