diff options
Diffstat (limited to 'tests/tools/nnpackage_run/src/args.cc')
-rw-r--r-- | tests/tools/nnpackage_run/src/args.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/tools/nnpackage_run/src/args.cc b/tests/tools/nnpackage_run/src/args.cc index 2233a5eaa..24bf0c137 100644 --- a/tests/tools/nnpackage_run/src/args.cc +++ b/tests/tools/nnpackage_run/src/args.cc @@ -17,7 +17,6 @@ #include "args.h" #include <iostream> -#include <boost/filesystem.hpp> namespace nnpkg_run { @@ -31,11 +30,12 @@ Args::Args(const int argc, char **argv) noexcept void Args::Initialize(void) { // General options - po::options_description general("General options"); + po::options_description general("General options", 100); // clang-format off general.add_options() - ("help,h", "Display available options") + ("help,h", "Print available options") + ("version", "Print version and exit immediately") ("nnpackage", po::value<std::string>()->required()) ("dump,d", po::value<std::string>()->default_value(""), "Output filename") ("load,l", po::value<std::string>()->default_value(""), "Input filename") @@ -43,7 +43,11 @@ void Args::Initialize(void) ("warmup_runs,w", po::value<int>()->default_value(0), "The number of warmup runs") ("gpumem_poll,g", po::value<bool>()->default_value(false), "Check gpu memory polling separately") ("mem_poll,m", po::value<bool>()->default_value(false), "Check memory polling") - ("write_report,p", po::value<bool>()->default_value(false), "Write report") + ("write_report,p", po::value<bool>()->default_value(false), + "Write report\n" + "{exec}-{nnpkg}-{backend}.csv will be generated.\n" + "e.g. nnpackage_run-UNIT_Add_000-acl_cl.csv.\n" + "{nnpkg} name may be changed to realpath if you use symbolic-link.") ; // clang-format on @@ -77,6 +81,12 @@ void Args::Parse(const int argc, char **argv) exit(0); } + if (vm.count("version")) + { + _print_version = true; + return; + } + po::notify(vm); if (vm.count("dump")) @@ -103,7 +113,7 @@ void Args::Parse(const int argc, char **argv) } else { - if (!boost::filesystem::exists(_package_filename)) + if (access(_package_filename.c_str(), F_OK) == -1) { std::cerr << "nnpackage not found: " << _package_filename << "\n"; } |