| @@ -220,14 +220,7 @@ static Status ParseOutputFp16NodesFormat(const string &is_output_fp16) { | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| void FindParserSo(const string &path, vector<string> &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<string> &file_list, string &caffe_parser_path) { | |||||
| // path, Change to absolute path | // path, Change to absolute path | ||||
| string real_path = RealPath(path.c_str()); | string real_path = RealPath(path.c_str()); | ||||
| if (real_path.empty()) { // plugin path does not exist | if (real_path.empty()) { // plugin path does not exist | ||||
| @@ -264,7 +257,7 @@ void FindParserSo(const string &path, vector<string> &file_list, | |||||
| continue; | continue; | ||||
| } | } | ||||
| FindParserSo(full_name, file_list, caffe_parser_path, recursive_depth + 1); | |||||
| FindParserSo(full_name, file_list, caffe_parser_path); | |||||
| } | } | ||||
| closedir(dir); | closedir(dir); | ||||
| return; | return; | ||||
| @@ -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 GetGroupName(ge::proto::ModelDef &model); | ||||
| GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector<string> &fileList, string &caffe_parser_path, | |||||
| uint32_t recursive_depth = 0); | |||||
| GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector<string> &fileList, string &caffe_parser_path); | |||||
| GE_FUNC_VISIBILITY Status DumpInfershapeJson(const ge::Graph &graph, const char *json_file); | GE_FUNC_VISIBILITY Status DumpInfershapeJson(const ge::Graph &graph, const char *json_file); | ||||
| @@ -48,13 +48,4 @@ TEST_F(UtestOmg, display_model_info_success) { | |||||
| attr_def->mutable_list()->add_i(4); | attr_def->mutable_list()->add_i(4); | ||||
| PrintModelInfo(&model_def, 1); | PrintModelInfo(&model_def, 1); | ||||
| } | } | ||||
| TEST_F(UtestOmg, find_parser_so) { | |||||
| string path = ""; | |||||
| vector<string> file_list = {}; | |||||
| string caffe_parser_path = ""; | |||||
| FindParserSo(path, file_list, caffe_parser_path); | |||||
| path = "/lib64"; | |||||
| FindParserSo(path, file_list, caffe_parser_path); | |||||
| } | |||||
| } // namespace ge | } // namespace ge | ||||