Hoist loop invariant code in `benchmark_runner.cc` for readability.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
auto sess = std::make_shared<nnfw::tflite::NNAPISession>(interp.release());
+ auto get_iteration_count = [](const BMPhase &phase) {
+ switch (phase)
+ {
+ case Warmup:
+ return 1; // Allow configuration
+ case Stable:
+ return 3;
+ default:
+ break;
+ }
+
+ throw std::runtime_error{"Error!"};
+ };
+
// Iteration!
for (auto phase : {Warmup, Stable})
{
- auto get_iteration_count = [](const BMPhase &phase) {
- switch (phase)
- {
- case Warmup:
- return 1; // Allow configuration
- case Stable:
- return 3;
- default:
- break;
- }
-
- throw std::runtime_error{"Error!"};
- };
-
uint32_t iteration_count = get_iteration_count(phase);
for (uint32_t n = 0; n < iteration_count; ++n)