From 8a1ec9739945e9292a6af47980370147d3931014 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 21:03:49 +0800 Subject: [PATCH] Fix st. --- ge/session/omg.cc | 11 ++--------- inc/framework/omg/omg.h | 3 +-- tests/ut/ge/session/omg_omg_unittest.cc | 9 --------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/ge/session/omg.cc b/ge/session/omg.cc index a2ee176f..f7f3def7 100755 --- a/ge/session/omg.cc +++ b/ge/session/omg.cc @@ -220,14 +220,7 @@ static Status ParseOutputFp16NodesFormat(const string &is_output_fp16) { return SUCCESS; } -void FindParserSo(const string &path, vector &file_list, - string &caffe_parser_path, uint32_t recursive_depth) { - static const uint32_t max_recursive_depth = 20; // For recursive depth protection - - if (recursive_depth >= max_recursive_depth) { - GELOGW("Recursive depth is become %u, Please check input!", recursive_depth); - return; - } +void FindParserSo(const string &path, vector &file_list, string &caffe_parser_path) { // path, Change to absolute path string real_path = RealPath(path.c_str()); if (real_path.empty()) { // plugin path does not exist @@ -264,7 +257,7 @@ void FindParserSo(const string &path, vector &file_list, continue; } - FindParserSo(full_name, file_list, caffe_parser_path, recursive_depth + 1); + FindParserSo(full_name, file_list, caffe_parser_path); } closedir(dir); return; diff --git a/inc/framework/omg/omg.h b/inc/framework/omg/omg.h index 1c39d203..a0cdb449 100644 --- a/inc/framework/omg/omg.h +++ b/inc/framework/omg/omg.h @@ -91,8 +91,7 @@ GE_FUNC_VISIBILITY Status ConvertFwkModelToJson(domi::FrameworkType framework, c GE_FUNC_VISIBILITY void GetGroupName(ge::proto::ModelDef &model); -GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector &fileList, string &caffe_parser_path, - uint32_t recursive_depth = 0); +GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector &fileList, string &caffe_parser_path); GE_FUNC_VISIBILITY Status DumpInfershapeJson(const ge::Graph &graph, const char *json_file); diff --git a/tests/ut/ge/session/omg_omg_unittest.cc b/tests/ut/ge/session/omg_omg_unittest.cc index 6176b7c0..334df319 100644 --- a/tests/ut/ge/session/omg_omg_unittest.cc +++ b/tests/ut/ge/session/omg_omg_unittest.cc @@ -48,13 +48,4 @@ TEST_F(UtestOmg, display_model_info_success) { attr_def->mutable_list()->add_i(4); PrintModelInfo(&model_def, 1); } - -TEST_F(UtestOmg, find_parser_so) { - string path = ""; - vector file_list = {}; - string caffe_parser_path = ""; - FindParserSo(path, file_list, caffe_parser_path); - path = "/lib64"; - FindParserSo(path, file_list, caffe_parser_path); -} } // namespace ge