diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/subgraph/manager.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/subgraph/manager.cpp index 18575c7ec40..5c0c28cbcdc 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/subgraph/manager.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/subgraph/manager.cpp @@ -11,11 +11,12 @@ using namespace ov::tools::subgraph_dumper; bool ExtractorsManager::match(const std::shared_ptr &model, const std::shared_ptr &ref) { - for (const auto &it : m_extractors) { - if (it.second->match(model, ref)) { + // `match` is not virtual method in base `SubgraphExtractor` class + // we can use function from any `extractor` to avoid of cycle + if (!m_extractors.empty()) { + if (m_extractors.begin()->second->match(model, ref)) { return true; } - return false; } return false; } @@ -25,8 +26,10 @@ ExtractorsManager::is_subgraph(const std::shared_ptr &model, const std::shared_ptr &ref_model, const std::map &in_info, const std::map &in_info_ref) { - for (const auto &it : m_extractors) { - auto extractor_res = it.second->is_subgraph(model, ref_model); + if (!m_extractors.empty()) { + // `is_subgraph` is not virtual method in base `SubgraphExtractor` class + // we can use function from any `extractor` to avoid of cycle + auto extractor_res = m_extractors.begin()->second->is_subgraph(model, ref_model); if (std::get<0>(extractor_res)) { std::map graph_in_info, subgraph_in_info; if (std::get<1>(extractor_res) == model && std::get<2>(extractor_res) == ref_model) { @@ -40,13 +43,13 @@ ExtractorsManager::is_subgraph(const std::shared_ptr &model, } try { subgraph_in_info = align_input_info(std::get<2>(extractor_res), std::get<1>(extractor_res), subgraph_in_info, graph_in_info); - } catch(...) { + } catch(std::exception) { return { false, nullptr, nullptr, {}, {} }; } return { true, std::get<1>(extractor_res), std::get<2>(extractor_res), graph_in_info, subgraph_in_info }; } - return { false, nullptr, nullptr, {}, {} }; } + return { false, nullptr, nullptr, {}, {} }; } bool ExtractorsManager::match(const std::shared_ptr &model, @@ -57,7 +60,7 @@ bool ExtractorsManager::match(const std::shared_ptr &model, try { in_info = align_input_info(model, ref, in_info, in_info_ref); return true; - } catch (...) { + } catch (std::exception) { return false; } } diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/model.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/model.cpp index 25d7f4e520a..6717961ea1b 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/model.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/model.cpp @@ -52,8 +52,7 @@ find_models(const std::vector &dirs, const std::string& regexp) { } else { continue; } - } catch (...) { - // } catch (std::exception& e) { + } catch (std::exception) { not_read_model.emplace_back(model_file); // std::cout << "[ ERROR ] Impossible to read model: " << model_file << std::endl << "Exception: " << e.what(); } @@ -101,13 +100,11 @@ std::map> cache_models( cache_status[ModelCacheStatus::LARGE_MODELS_INCLUDED].push_back(model); } cache->update_cache(function, model, extract_body, from_cache); - } catch (...) { - // } catch (std::exception &e) { + } catch (std::exception) { // std::cout << "[ ERROR ] Model processing failed with exception:" << std::endl << e.what() << std::endl; model_status = ModelCacheStatus::NOT_FULLY_CACHED; } - } catch (...) { - // } catch (std::exception &e) { + } catch (std::exception) { model_status = ModelCacheStatus::NOT_READ; // std::cout << "[ ERROR ] Model reading failed with exception:" << std::endl << e.what() << std::endl; }