tflite_benchmark: use get_env_bool instead of getenv (#1812)
authorVitaliy Cherepanov/AI Tools Lab /SRR/Engineer/삼성전자 <v.cherepanov@samsung.com>
Tue, 3 Jul 2018 23:54:33 +0000 (02:54 +0300)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 3 Jul 2018 23:54:33 +0000 (08:54 +0900)
* tflite_benchmark: use get_env_bool instead of getenv

Replace std::getenv by nnfw::util::get_env_bool for USE_NNAPI

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
* Update tflite_benchmark.cc

tools/tflite_benchmark/src/tflite_benchmark.cc

index cfe244e..5f25aea 100644 (file)
@@ -68,14 +68,9 @@ int main(const int argc, char **argv)
 
   const auto filename = argv[1];
 
-  bool use_nnapi = false;
+  const bool use_nnapi = nnfw::util::get_env_bool("USE_NNAPI");
   const auto thread_count = nnfw::util::get_env_int("THREAD", -1);
 
-  if (std::getenv("USE_NNAPI") != nullptr)
-  {
-    use_nnapi = true;
-  }
-
   std::cout << "Num threads: " << thread_count << std::endl;
   if (use_nnapi)
   {