[tflite_benchmark] Show min/max (#1680)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 14 Jun 2018 11:08:43 +0000 (20:08 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 14 Jun 2018 11:08:43 +0000 (20:08 +0900)
This commit revises tflite_benchmakr to show min/max when benchmark
finishes.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
tools/tflite_benchmark/src/tflite_benchmark.cc

index 1ce214d..627500f 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <boost/accumulators/accumulators.hpp>
 #include <boost/accumulators/statistics/stats.hpp>
+#include <boost/accumulators/statistics/min.hpp>
+#include <boost/accumulators/statistics/max.hpp>
 #include <boost/accumulators/statistics/mean.hpp>
 
 #include <iostream>
@@ -215,7 +217,7 @@ int main(const int argc, char **argv)
 
   using namespace boost::accumulators;
 
-  accumulator_set<double, stats<tag::mean>> acc;
+  accumulator_set<double, stats<tag::mean, tag::min, tag::max>> acc;
 
   for (uint32_t n = 0; n < count.value(); ++n)
   {
@@ -236,6 +238,8 @@ int main(const int argc, char **argv)
   }
 
   std::cout << "--------" << std::endl;
+  std::cout << "Min: " << min(acc) << "ms" << std::endl;
+  std::cout << "Max: " << max(acc) << "ms" << std::endl;
   std::cout << "Mean: " << mean(acc) << "ms" << std::endl;
 
   return 0;