Skip to content

Commit

Permalink
[tools/onert_run] Introduce compile and cpath arguments (#12537)
Browse files Browse the repository at this point in the history
This commit introduces compile and cpath arguments for codegen.

ONE-DCO-1.0-Signed-off-by: Jiyoung Yun <[email protected]>
  • Loading branch information
jyoungyun authored Jan 26, 2024
1 parent cbfceb2 commit e3eba64
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/tools/onert_run/src/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,15 @@ void Args::Initialize(void)
("qpath", po::value<std::string>()->default_value("")->notifier([&](const auto &v) { _quantized_model_path = v; }),
"Path to export quantized model.\n"
"If it is not set, the quantized model will be exported to the same directory of the original model/package with q8/q16 suffix.")
("compile,c", po::value<std::string>()->default_value("")->notifier([&](const auto &v) { _compile = v; }),
"Target backend name to compile model\n"
"The target string will be used to find a backend library.\n"
"This string should be in the following format:\n"
"{backend extension} + '-gen'.\n"
"For detailed description, please see the description of nnfw_compile()")
("cpath", po::value<std::string>()->default_value("")->notifier([&](const auto &v) { _compiled_model_path = v; }),
"Path to export compiled model.\n"
"If it is not set, the compiled model will be exported to the same directory of the original model/package with target backend extension.")
;
// clang-format on

Expand Down
4 changes: 4 additions & 0 deletions tests/tools/onert_run/src/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class Args
const int getVerboseLevel(void) const { return _verbose_level; }
const std::string &getQuantize(void) const { return _quantize; }
const std::string &getQuantizedModelPath(void) const { return _quantized_model_path; }
const std::string &getCompile(void) const { return _compile; }
const std::string &getCompiledModelPath(void) const { return _compiled_model_path; }

private:
void Initialize();
Expand Down Expand Up @@ -105,6 +107,8 @@ class Args
bool _use_single_model = false;
std::string _quantize;
std::string _quantized_model_path;
std::string _compile;
std::string _compiled_model_path;
};

} // end of namespace onert_run
Expand Down

0 comments on commit e3eba64

Please sign in to comment.