File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
examples/qualcomm/executor_runner Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -568,13 +568,40 @@ int main(int argc, char** argv) {
568568 ET_LOG (
569569 Info,
570570 " Input list not provided. Inputs prepared with default values set." );
571+
572+ // Run the method
571573 Error status = method->execute ();
572574 ET_CHECK_MSG (
573575 status == Error::Ok,
574576 " Execution of method %s failed with status 0x%" PRIx32,
575577 method_name,
576578 (int )status);
577579 ET_LOG (Info, " Model executed successfully." );
580+
581+ // Warm up
582+ ET_LOG (Info, " Perform %d inferences for warming up" , FLAGS_warm_up);
583+ for (int i = 0 ; i < FLAGS_warm_up; ++i) {
584+ status = method->execute ();
585+ }
586+
587+ // Inference with designated iterations
588+ auto before_exec = std::chrono::high_resolution_clock::now ();
589+ for (int i = 0 ; i < FLAGS_iteration; ++i) {
590+ status = method->execute ();
591+ }
592+ auto after_exec = std::chrono::high_resolution_clock::now ();
593+ double interval_infs =
594+ std::chrono::duration_cast<std::chrono::microseconds>(
595+ after_exec - before_exec)
596+ .count () /
597+ 1000.0 ;
598+
599+ ET_LOG (
600+ Info,
601+ " %d inferences took %f ms, avg %f ms" ,
602+ FLAGS_iteration,
603+ interval_infs,
604+ interval_infs / (float )FLAGS_iteration);
578605 }
579606
580607 // Dump the etdump data containing profiling/debugging data to the specified
You can’t perform that action at this time.
0 commit comments