From a793f4645d2c04543572de4d0bc84bf0a3689604 Mon Sep 17 00:00:00 2001 From: Jerry Ge Date: Tue, 11 Apr 2023 00:05:02 +0000 Subject: Add level checking to TOSA Ref model Signed-off-by: Jerry Ge Change-Id: I5689d7c6b902a319a68fa4628b59e0bcc23aeca4 --- reference_model/src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'reference_model/src/main.cpp') diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp index 0375a48..aad07cb 100644 --- a/reference_model/src/main.cpp +++ b/reference_model/src/main.cpp @@ -36,6 +36,7 @@ int initTestDesc(json& test_desc); int readInputTensors(SubgraphTraverser& gt, json test_desc); int writeFinalTensors(SubgraphTraverser& gt, json test_desc); int loadGraph(TosaSerializationHandler& tsh, json test_desc); +void parse_value(const std::string& text, tosa_level_t& value); int main(int argc, char** argv) { @@ -454,3 +455,15 @@ int initTestDesc(json& test_desc) return 0; } + +void parse_value(const std::string& text, tosa_level_t& value) +{ + + if (text == "NONE") + value = func_config_t::NONE; + else if (text == "EIGHTK") + value = func_config_t::EIGHTK; + else + throw cxxopts::argument_incorrect_type("TOSA_LEVEL"); + return; +} \ No newline at end of file -- cgit v1.2.1