diff options
author | 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com> | 2019-09-04 20:05:11 +0900 |
---|---|---|
committer | GitHub Enterprise <noreply-CODE@samsung.com> | 2019-09-04 20:05:11 +0900 |
commit | cb892eab328fff15f4cb9e2c0869f8c16efc9c44 (patch) | |
tree | bd5c361c6c8da9fccd6fd85ae6c00b6ec2555323 /tests | |
parent | 7e1433c2092c5ed3be340c26b9164b54561c4f30 (diff) | |
download | nnfw-cb892eab328fff15f4cb9e2c0869f8c16efc9c44.tar.gz nnfw-cb892eab328fff15f4cb9e2c0869f8c16efc9c44.tar.bz2 nnfw-cb892eab328fff15f4cb9e2c0869f8c16efc9c44.zip |
Remove unused env variable utility (#7140)
Unify environment variable utility
Remove unused environment variable utility functions
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tools/tflite_benchmark/src/tflite_benchmark.cc | 10 | ||||
-rw-r--r-- | tests/tools/tflite_run/src/tflite_run.cc | 7 |
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/tools/tflite_benchmark/src/tflite_benchmark.cc b/tests/tools/tflite_benchmark/src/tflite_benchmark.cc index 54c97c435..634b149e9 100644 --- a/tests/tools/tflite_benchmark/src/tflite_benchmark.cc +++ b/tests/tools/tflite_benchmark/src/tflite_benchmark.cc @@ -34,7 +34,7 @@ #include <iostream> #include <thread> -#include "misc/environment.h" +#include "misc/EnvVar.h" #include "misc/benchmark.h" using namespace tflite; @@ -70,9 +70,9 @@ int main(const int argc, char **argv) const auto filename = argv[1]; - const bool use_nnapi = nnfw::misc::get_env_bool("USE_NNAPI"); - const auto thread_count = nnfw::misc::get_env_int("THREAD", -1); - const auto pause = nnfw::misc::get_env_int("PAUSE", 0); + const bool use_nnapi = nnfw::misc::EnvVar("USE_NNAPI").asBool(false); + const auto thread_count = nnfw::misc::EnvVar("THREAD").asInt(-1); + const auto pause = nnfw::misc::EnvVar("PAUSE").asInt(0); std::cout << "Num threads: " << thread_count << std::endl; if (use_nnapi) @@ -215,7 +215,7 @@ int main(const int argc, char **argv) // // Measure // - const auto cnt = nnfw::misc::get_env_int("COUNT", 1); + const auto cnt = nnfw::misc::EnvVar("COUNT").asInt(1); using namespace boost::accumulators; diff --git a/tests/tools/tflite_run/src/tflite_run.cc b/tests/tools/tflite_run/src/tflite_run.cc index c067f8beb..deed12856 100644 --- a/tests/tools/tflite_run/src/tflite_run.cc +++ b/tests/tools/tflite_run/src/tflite_run.cc @@ -21,7 +21,7 @@ #include "tensor_dumper.h" #include "tensor_loader.h" #include "misc/benchmark.h" -#include "misc/environment.h" +#include "misc/EnvVar.h" #include "misc/fp32.h" #include "tflite/Diff.h" #include "tflite/Assert.h" @@ -73,7 +73,7 @@ int main(const int argc, char **argv) TFLITE_ENSURE(builder(&interpreter)) - interpreter->SetNumThreads(nnfw::misc::get_env_int("THREAD", -1)); + interpreter->SetNumThreads(nnfw::misc::EnvVar("THREAD").asInt(-1)); }; } catch (const std::exception &e) @@ -266,8 +266,7 @@ int main(const int argc, char **argv) // TODO Code duplication (copied from RandomTestRunner) - int tolerance = 1; - nnfw::misc::env::IntAccessor("TOLERANCE").access(tolerance); + int tolerance = nnfw::misc::EnvVar("TOLERANCE").asInt(1); auto equals = [tolerance](float lhs, float rhs) { // NOTE Hybrid approach |