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

Function BM_ArgumentFactory

tensorflow/stream_executor/lib/statusor_test.cc:549–560  ·  view source on GitHub ↗

Measure the time taken to call into the factory, providing an out-param for the result, evaluating the status result and the result pointer, and invoking the trivial function.

Source from the content-addressed store, hash-verified

547// out-param for the result, evaluating the status result and the
548// result pointer, and invoking the trivial function.
549void BM_ArgumentFactory(int iters) {
550 tensorflow::testing::StopTiming();
551 BenchmarkFactory<BenchmarkType> factory;
552 tensorflow::testing::StartTiming();
553 for (int i = 0; i != iters; ++i) {
554 BenchmarkType* result = nullptr;
555 Status status = factory.ArgumentFactory(&result);
556 if (status.ok() && result != nullptr) {
557 result->DoWork();
558 }
559 }
560}
561BENCHMARK(BM_ArgumentFactory);
562
563// Measure the time to use the StatusOr<T*> factory, evaluate the result,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected