diff --git a/.github/workflows/linux_conditional_compilation.yml b/.github/workflows/linux_conditional_compilation.yml index dc63843d5ce452..b8567d57a6a6cd 100644 --- a/.github/workflows/linux_conditional_compilation.yml +++ b/.github/workflows/linux_conditional_compilation.yml @@ -124,7 +124,7 @@ jobs: -DENABLE_CPPLINT=OFF \ -DENABLE_NCC_STYLE=OFF \ -DENABLE_INTEL_GNA=OFF \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ -DENABLE_PROFILING_ITT=ON \ -DSELECTIVE_BUILD=COLLECT \ -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \ diff --git a/.github/workflows/linux_riscv.yml b/.github/workflows/linux_riscv.yml index 3899b454054464..927b10ea80120c 100644 --- a/.github/workflows/linux_riscv.yml +++ b/.github/workflows/linux_riscv.yml @@ -85,7 +85,6 @@ jobs: python3 -m venv ${OPENVINO_BUILD_DIR}/env source ${OPENVINO_BUILD_DIR}/env/bin/activate - python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/requirements.txt python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/src/compatibility/openvino/requirements-dev.txt python3 -m pip install conan @@ -151,9 +150,7 @@ jobs: -DPYTHON_MODULE_EXTENSION=$(riscv64-linux-gnu-python3-config --extension-suffix) \ -DPYBIND11_PYTHON_EXECUTABLE_LAST=${OPENVINO_BUILD_DIR}/env/bin/python3.10 \ -DENABLE_TESTS=ON \ - -DTHREADING=SEQ \ -DENABLE_PYTHON_PACKAGING=ON \ - -DENABLE_SYSTEM_TBB=ON \ -DENABLE_SYSTEM_PROTOBUF=ON \ -DENABLE_SYSTEM_SNAPPY=ON \ -DENABLE_SYSTEM_PUGIXML=ON \ diff --git a/cmake/features.cmake b/cmake/features.cmake index 7b11a8a968f1a7..01a219e0aaf6a4 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -73,7 +73,14 @@ ie_dependent_option (ENABLE_PKGCONFIG_GEN "Enable openvino.pc pkg-config file ge # # "OneDNN library based on OMP or TBB or Sequential implementation: TBB|OMP|SEQ" -set(THREADING "TBB" CACHE STRING "Threading") +if(RISCV64) + # oneDNN does not support non-SEQ for RISC-V architecture + set(THREADING_DEFAULT "SEQ") +else() + set(THREADING_DEFAULT "TBB") +endif() + +set(THREADING "${THREADING_DEFAULT}" CACHE STRING "Threading") set_property(CACHE THREADING PROPERTY STRINGS "TBB" "TBB_AUTO" "OMP" "SEQ") list (APPEND IE_OPTIONS THREADING) if (NOT THREADING STREQUAL "TBB" AND diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index ea3448522dea90..038895b1c07429 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -214,7 +214,9 @@ macro(ie_add_sample) find_package(Threads REQUIRED) find_package(OpenVINO REQUIRED COMPONENTS Runtime) - if(c_sample) + + # Conan does not generate openvino::runtime::c target + if(c_sample AND TARGET openvino::runtime::c) set(ov_link_libraries openvino::runtime::c) else() set(ov_link_libraries openvino::runtime) diff --git a/samples/cpp/benchmark_app/main.cpp b/samples/cpp/benchmark_app/main.cpp index 2bda41ca8b880c..d8b5f14bfa419a 100644 --- a/samples/cpp/benchmark_app/main.cpp +++ b/samples/cpp/benchmark_app/main.cpp @@ -19,9 +19,6 @@ # define WAS_OV_LIBRARY_DEFINED #endif -#include "gna/gna_config.hpp" -#include "gpu/gpu_config.hpp" - #ifdef WAS_OV_LIBRARY_DEFINED # undef IN_OV_COMPONENT # undef WAS_OV_LIBRARY_DEFINED @@ -314,11 +311,11 @@ int main(int argc, char* argv[]) { // Override config if command line parameter is specified if (!config.count("GPU")) config["GPU"] = {}; - config["GPU"][CONFIG_KEY(CONFIG_FILE)] = FLAGS_c; + config["GPU"]["CONFIG_FILE"] = FLAGS_c; } - if (config.count("GPU") && config.at("GPU").count(CONFIG_KEY(CONFIG_FILE))) { - auto ext = config.at("GPU").at(CONFIG_KEY(CONFIG_FILE)).as(); - core.set_property("GPU", {{CONFIG_KEY(CONFIG_FILE), ext}}); + if (config.count("GPU") && config.at("GPU").count("CONFIG_FILE")) { + auto ext = config.at("GPU").at("CONFIG_FILE").as(); + core.set_property("GPU", {{"CONFIG_FILE", ext}}); slog::info << "GPU extensions are loaded: " << ext << slog::endl; } OPENVINO_SUPPRESS_DEPRECATED_END @@ -846,9 +843,8 @@ int main(int argc, char* argv[]) { slog::info << " " << item.first << ": " << slog::endl; for (auto& item2 : item.second.as()) { OPENVINO_SUPPRESS_DEPRECATED_START - if (item2.first == ov::supported_properties || - item2.first == METRIC_KEY(SUPPORTED_CONFIG_KEYS) || - item2.first == METRIC_KEY(SUPPORTED_METRICS)) + if (item2.first == ov::supported_properties || item2.first == "SUPPORTED_CONFIG_KEYS)" || + item2.first == "SUPPORTED_METRICS") continue; OPENVINO_SUPPRESS_DEPRECATED_END slog::info << " " << item2.first << ": " << item2.second.as() << slog::endl; diff --git a/samples/cpp/benchmark_app/remote_tensors_filling.hpp b/samples/cpp/benchmark_app/remote_tensors_filling.hpp index b495b0a7704e9c..dbfee53905dd0d 100644 --- a/samples/cpp/benchmark_app/remote_tensors_filling.hpp +++ b/samples/cpp/benchmark_app/remote_tensors_filling.hpp @@ -6,7 +6,7 @@ #if defined(HAVE_GPU_DEVICE_MEM_SUPPORT) # define HAVE_DEVICE_MEM_SUPPORT -# include +# include "openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp" #endif #include "utils.hpp" diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/conv_eltwise_fusion.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/conv_eltwise_fusion.cpp index 490d6dc70fa130..2e23919cfd6c4c 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/conv_eltwise_fusion.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/conv_eltwise_fusion.cpp @@ -2,183 +2,195 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "subgraph_tests/conv_eltwise_fusion.hpp" + #include -#include "subgraph_tests/conv_eltwise_fusion.hpp" #include "common_test_utils/test_constants.hpp" using namespace SubgraphTestsDefinitions; namespace { - const std::vector types{ngraph::element::f32, ngraph::element::f16}; - const std::vector eltwise_types{ngraph::opset4::Multiply::get_type_info_static(), - /* ngraph::opset4::Add::get_type_info_static() */}; - - INSTANTIATE_TEST_SUITE_P(smoke_Convolution_1D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values(std::tuple{ngraph::opset4::Convolution::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 8, 64}), - ::testing::Values(ngraph::Shape{64, 8, 1}), - ::testing::Values(ngraph::Shape{64, 1}), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution_1D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values(std::tuple{ngraph::opset4::GroupConvolution::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 12, 5}), - ::testing::Values(ngraph::Shape{4, 5, 3, 2}), - ::testing::Values(ngraph::Shape{20, 1}), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData_1D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Combine( - ::testing::Values(ngraph::opset4::ConvolutionBackpropData::get_type_info_static()), - ::testing::ValuesIn(std::vector{2, 3})), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 12, 64}), - ::testing::Values(ngraph::Shape{12, 20, 1}), - ::testing::Values(ngraph::Shape{20, 1}), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolutionBackpropData_1D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Combine( - ::testing::Values(ngraph::opset4::GroupConvolutionBackpropData::get_type_info_static()), - ::testing::ValuesIn(std::vector{2, 3})), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 12, 64}), - ::testing::Values(ngraph::Shape{4, 3, 5, 1}), - ::testing::Values(ngraph::Shape{1, 20, 1}), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - const std::vector const_shapes_2d{ - {}, - {1, 1}, - {1, 1, 1}, - {20, 1, 1}, - {1, 1, 1, 1} - }; - - INSTANTIATE_TEST_SUITE_P(smoke_Convolution_2D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values(std::tuple{ngraph::opset4::Convolution::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 3, 64, 64}), - ::testing::Values(ngraph::Shape{20, 3, 1, 1}), - ::testing::ValuesIn(const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution_2D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values(std::tuple{ngraph::opset4::GroupConvolution::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 12, 64, 64}), - ::testing::Values(ngraph::Shape{4, 5, 3, 1, 2}), - ::testing::ValuesIn(const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData_2D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Combine( - ::testing::Values(ngraph::opset4::ConvolutionBackpropData::get_type_info_static()), - ::testing::ValuesIn(std::vector{2, 3})), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 3, 64, 64}), - ::testing::Values(ngraph::Shape{3, 20, 3, 3}), - ::testing::ValuesIn(const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolutionBackpropData_2D, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Combine( - ::testing::Values(ngraph::opset4::GroupConvolutionBackpropData::get_type_info_static()), - ::testing::ValuesIn(std::vector{2, 3})), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(false), - ::testing::Values(ngraph::Shape{1, 12, 64, 64}), - ::testing::Values(ngraph::Shape{4, 3, 5, 1, 1}), - ::testing::ValuesIn(const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - const std::vector neg_const_shapes_2d{ - {1, 1, 1, 1, 1}, /* Broadcast output */ - {3}, {3, 1}, {3, 1, 1, 1} - }; - - INSTANTIATE_TEST_SUITE_P(smoke_Convolution_2D_Negative, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values(std::tuple{ngraph::opset4::Convolution::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(true), - ::testing::Values(ngraph::Shape{1, 3, 3, 3}), - ::testing::Values(ngraph::Shape{3, 3, 1, 1}), - ::testing::ValuesIn(neg_const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution_2D_Negative, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values( - std::tuple{ngraph::opset4::GroupConvolution::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(true), - ::testing::Values(ngraph::Shape{1, 12, 3, 3}), - ::testing::Values(ngraph::Shape{4, 5, 3, 1, 1}), - ::testing::ValuesIn(neg_const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData_2D_Negative, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values( - std::tuple{ngraph::opset4::ConvolutionBackpropData::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(true), - ::testing::Values(ngraph::Shape{1, 12, 3, 3}), - ::testing::Values(ngraph::Shape{12, 3, 1, 1}), - ::testing::ValuesIn(neg_const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolutionBackpropData_2D_Negative, ConvEltwiseFusion, - ::testing::Combine( - ::testing::Values( - std::tuple{ngraph::opset4::GroupConvolutionBackpropData::get_type_info_static(), 2}), - ::testing::ValuesIn(eltwise_types), - ::testing::Values(true), - ::testing::Values(ngraph::Shape{1, 12, 3, 3}), - ::testing::Values(ngraph::Shape{4, 3, 5, 1, 1}), - ::testing::ValuesIn(neg_const_shapes_2d), - ::testing::ValuesIn(types), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ConvEltwiseFusion::getTestCaseName); +const std::vector types{ov::element::f32, ov::element::f16}; +const std::vector eltwise_types{ov::op::v1::Multiply::get_type_info_static(), + /* ov::opset4::Add::get_type_info_static() */}; + +INSTANTIATE_TEST_SUITE_P(smoke_Convolution_1D, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::Convolution::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 8, 64}), + ::testing::Values(ov::Shape{64, 8, 1}), + ::testing::Values(ov::Shape{64, 1}), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution_1D, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::GroupConvolution::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 12, 5}), + ::testing::Values(ov::Shape{4, 5, 3, 2}), + ::testing::Values(ov::Shape{20, 1}), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_ConvolutionBackpropData_1D, + ConvEltwiseFusion, + ::testing::Combine( + ::testing::Combine(::testing::Values(ov::op::v1::ConvolutionBackpropData::get_type_info_static()), + ::testing::ValuesIn(std::vector{2, 3})), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 12, 64}), + ::testing::Values(ov::Shape{12, 20, 1}), + ::testing::Values(ov::Shape{20, 1}), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_GroupConvolutionBackpropData_1D, + ConvEltwiseFusion, + ::testing::Combine( + ::testing::Combine(::testing::Values(ov::op::v1::GroupConvolutionBackpropData::get_type_info_static()), + ::testing::ValuesIn(std::vector{2, 3})), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 12, 64}), + ::testing::Values(ov::Shape{4, 3, 5, 1}), + ::testing::Values(ov::Shape{1, 20, 1}), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +const std::vector const_shapes_2d{{}, {1, 1}, {1, 1, 1}, {20, 1, 1}, {1, 1, 1, 1}}; + +INSTANTIATE_TEST_SUITE_P(smoke_Convolution_2D, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::Convolution::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 3, 64, 64}), + ::testing::Values(ov::Shape{20, 3, 1, 1}), + ::testing::ValuesIn(const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution_2D, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::GroupConvolution::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 12, 64, 64}), + ::testing::Values(ov::Shape{4, 5, 3, 1, 2}), + ::testing::ValuesIn(const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_ConvolutionBackpropData_2D, + ConvEltwiseFusion, + ::testing::Combine( + ::testing::Combine(::testing::Values(ov::op::v1::ConvolutionBackpropData::get_type_info_static()), + ::testing::ValuesIn(std::vector{2, 3})), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 3, 64, 64}), + ::testing::Values(ov::Shape{3, 20, 3, 3}), + ::testing::ValuesIn(const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_GroupConvolutionBackpropData_2D, + ConvEltwiseFusion, + ::testing::Combine( + ::testing::Combine(::testing::Values(ov::op::v1::GroupConvolutionBackpropData::get_type_info_static()), + ::testing::ValuesIn(std::vector{2, 3})), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(false), + ::testing::Values(ov::Shape{1, 12, 64, 64}), + ::testing::Values(ov::Shape{4, 3, 5, 1, 1}), + ::testing::ValuesIn(const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +const std::vector neg_const_shapes_2d{{1, 1, 1, 1, 1}, /* Broadcast output */ + {3}, + {3, 1}, + {3, 1, 1, 1}}; + +INSTANTIATE_TEST_SUITE_P(smoke_Convolution_2D_Negative, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::Convolution::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(true), + ::testing::Values(ov::Shape{1, 3, 3, 3}), + ::testing::Values(ov::Shape{3, 3, 1, 1}), + ::testing::ValuesIn(neg_const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution_2D_Negative, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::GroupConvolution::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(true), + ::testing::Values(ov::Shape{1, 12, 3, 3}), + ::testing::Values(ov::Shape{4, 5, 3, 1, 1}), + ::testing::ValuesIn(neg_const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData_2D_Negative, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::ConvolutionBackpropData::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(true), + ::testing::Values(ov::Shape{1, 12, 3, 3}), + ::testing::Values(ov::Shape{12, 3, 1, 1}), + ::testing::ValuesIn(neg_const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolutionBackpropData_2D_Negative, + ConvEltwiseFusion, + ::testing::Combine(::testing::Values(std::tuple{ + ov::op::v1::GroupConvolutionBackpropData::get_type_info_static(), + 2}), + ::testing::ValuesIn(eltwise_types), + ::testing::Values(true), + ::testing::Values(ov::Shape{1, 12, 3, 3}), + ::testing::Values(ov::Shape{4, 3, 5, 1, 1}), + ::testing::ValuesIn(neg_const_shapes_2d), + ::testing::ValuesIn(types), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ConvEltwiseFusion::getTestCaseName); } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp index 300ab2016d0e37..7f25b2ef54ef44 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp @@ -3,28 +3,31 @@ // #include "subgraph_tests/parameter_result.hpp" + #include "common_test_utils/test_constants.hpp" using namespace SubgraphTestsDefinitions; +using namespace ov::test; namespace { -INSTANTIATE_TEST_SUITE_P(smoke_Check, ParameterResultSubgraphTestLegacyApi, - ::testing::Combine( - ::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {}}), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ParameterResultSubgraphTestBase::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Check, + ParameterResultSubgraphTestLegacyApi, + ::testing::Combine(::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {}}), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ParameterResultSubgraphTestBase::getTestCaseName); const std::vector inputShapes = { - ov::test::InputShape{{1, 3, 10, 10}, {{ 1, 3, 10, 10}, { 1, 3, 10, 10}}}, - ov::test::InputShape{{-1, -1, -1, -1}, {{ 1, 3, 10, 10}, { 2, 5, 3, 10}, { 1, 3, 10, 10}, { 1, 3, 10, 10}}}, - ov::test::InputShape{{{1, 10}, {1, 10}, {1, 10}, {1, 10}}, {{ 1, 3, 10, 10}, { 2, 5, 3, 10}, { 1, 3, 10, 10}, { 1, 3, 10, 10}}}, + ov::test::InputShape{{1, 3, 10, 10}, {{1, 3, 10, 10}, {1, 3, 10, 10}}}, + ov::test::InputShape{{-1, -1, -1, -1}, {{1, 3, 10, 10}, {2, 5, 3, 10}, {1, 3, 10, 10}, {1, 3, 10, 10}}}, + ov::test::InputShape{{{1, 10}, {1, 10}, {1, 10}, {1, 10}}, + {{1, 3, 10, 10}, {2, 5, 3, 10}, {1, 3, 10, 10}, {1, 3, 10, 10}}}, }; -INSTANTIATE_TEST_SUITE_P(smoke_Check, ParameterResultSubgraphTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ParameterResultSubgraphTestBase::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Check, + ParameterResultSubgraphTest, + ::testing::Combine(::testing::ValuesIn(inputShapes), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ParameterResultSubgraphTestBase::getTestCaseName); } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp index f9a0cedbfdceeb..b8379e24fbf093 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp @@ -2,14 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // -#include - #include "shared_test_classes/subgraph/preprocess.hpp" -using namespace SubgraphTestsDefinitions; +#include + +using namespace ov::test; -INSTANTIATE_TEST_SUITE_P(smoke_PrePostProcess, PrePostProcessTest, - ::testing::Combine( - ::testing::ValuesIn(ov::builder::preprocess::generic_preprocess_functions()), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - PrePostProcessTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P( + smoke_PrePostProcess, + PrePostProcessTest, + ::testing::Combine(::testing::ValuesIn(ov::builder::preprocess::generic_preprocess_functions()), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + PrePostProcessTest::getTestCaseName); diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/simple_if.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/simple_if.cpp index b9fbc6435e28ac..1abec579d595c9 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/simple_if.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/simple_if.cpp @@ -4,121 +4,81 @@ #include "shared_test_classes/subgraph/simple_if.hpp" -using namespace SubgraphTestsDefinitions; +using namespace ov::test; namespace { std::vector> inputShapes = { - { - {{}, {{5, 7}}}, - {{}, {{5, 7}}}, - }, - { - {{}, {{30, 20, 10}}}, - {{}, {{30, 20, 10}}} - }, - { - { - {-1, -1, -1}, - {{10, 20, 5}, {10, 0, 5}, {1, 5, 5}} - }, - { - {-1, -1, -1}, - {{10, 20, 5}, {10, 0, 5}, {1, 1, 5}} - } - }, - { - { - {-1, 5, -1}, - {{10, 5, 10}, {2, 5, 5}, {1, 5, 5}} - }, - { - {-1, 5, -1}, - {{1, 5, 1}, {2, 5, 5}, {5, 5, 5}} - } - }, - { - { - {{1, 10}, {1, 10}, {1, 10}}, - {{2, 5, 10}, {2, 5, 1}, {1, 5, 5}} - }, - { - {{1, 10}, {1, 10}, {1, 10}}, - {{2, 5, 10}, {2, 1, 5}, {5, 5, 5}} - } - }, + { + {{}, {{5, 7}}}, + {{}, {{5, 7}}}, + }, + {{{}, {{30, 20, 10}}}, {{}, {{30, 20, 10}}}}, + {{{-1, -1, -1}, {{10, 20, 5}, {10, 0, 5}, {1, 5, 5}}}, {{-1, -1, -1}, {{10, 20, 5}, {10, 0, 5}, {1, 1, 5}}}}, + {{{-1, 5, -1}, {{10, 5, 10}, {2, 5, 5}, {1, 5, 5}}}, {{-1, 5, -1}, {{1, 5, 1}, {2, 5, 5}, {5, 5, 5}}}}, + {{{{1, 10}, {1, 10}, {1, 10}}, {{2, 5, 10}, {2, 5, 1}, {1, 5, 5}}}, + {{{1, 10}, {1, 10}, {1, 10}}, {{2, 5, 10}, {2, 1, 5}, {5, 5, 5}}}}, }; -const std::vector inTypes = { - ov::test::ElementType::f32, - ov::test::ElementType::bf16, - ov::test::ElementType::i8 -}; +const std::vector inTypes = {ov::test::ElementType::f32, + ov::test::ElementType::bf16, + ov::test::ElementType::i8}; std::vector conditions = {true, false}; -INSTANTIATE_TEST_SUITE_P(smoke_If, SimpleIfTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes), - ::testing::ValuesIn(inTypes), - ::testing::ValuesIn(conditions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - SimpleIfTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_If, + SimpleIfTest, + ::testing::Combine(::testing::ValuesIn(inputShapes), + ::testing::ValuesIn(inTypes), + ::testing::ValuesIn(conditions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + SimpleIfTest::getTestCaseName); TEST_P(SimpleIfTest, CompareWithRefs) { run(); }; -INSTANTIATE_TEST_SUITE_P(smoke_If, SimpleIf2OutTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes), - ::testing::ValuesIn(inTypes), - ::testing::ValuesIn(conditions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - SimpleIf2OutTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_If, + SimpleIf2OutTest, + ::testing::Combine(::testing::ValuesIn(inputShapes), + ::testing::ValuesIn(inTypes), + ::testing::ValuesIn(conditions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + SimpleIf2OutTest::getTestCaseName); TEST_P(SimpleIf2OutTest, CompareWithRefs) { run(); }; -INSTANTIATE_TEST_SUITE_P(smoke_If, SimpleIfNotConstConditionTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes), - ::testing::ValuesIn(inTypes), - ::testing::ValuesIn(conditions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - SimpleIfNotConstConditionTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_If, + SimpleIfNotConstConditionTest, + ::testing::Combine(::testing::ValuesIn(inputShapes), + ::testing::ValuesIn(inTypes), + ::testing::ValuesIn(conditions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + SimpleIfNotConstConditionTest::getTestCaseName); TEST_P(SimpleIfNotConstConditionTest, CompareWithRefs) { run(); }; std::vector> inputShapes_2 = { - { - { - {-1, -1, -1}, - {{10, 20, 5}, {10, 20, 5}, {1, 5, 5}} - }, - }, - { - { - {-1, 5, -1}, - {{10, 5, 10}, {2, 5, 5}, {1, 5, 5}} - }, - }, - { - { - {{0, 10}, {0, 10}, {0, 10}}, - {{2, 5, 10}, {2, 5, 1}, {2, 5, 0}, {1, 5, 5}} - }, - }, + { + {{-1, -1, -1}, {{10, 20, 5}, {10, 20, 5}, {1, 5, 5}}}, + }, + { + {{-1, 5, -1}, {{10, 5, 10}, {2, 5, 5}, {1, 5, 5}}}, + }, + { + {{{0, 10}, {0, 10}, {0, 10}}, {{2, 5, 10}, {2, 5, 1}, {2, 5, 0}, {1, 5, 5}}}, + }, }; -INSTANTIATE_TEST_SUITE_P(smoke_If, SimpleIfNotConstConditionAndInternalDynamismTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes_2), - ::testing::ValuesIn(inTypes), - ::testing::ValuesIn(conditions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), +INSTANTIATE_TEST_SUITE_P(smoke_If, + SimpleIfNotConstConditionAndInternalDynamismTest, + ::testing::Combine(::testing::ValuesIn(inputShapes_2), + ::testing::ValuesIn(inTypes), + ::testing::ValuesIn(conditions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), SimpleIfNotConstConditionTest::getTestCaseName); TEST_P(SimpleIfNotConstConditionAndInternalDynamismTest, CompareWithRefs) { @@ -126,51 +86,43 @@ TEST_P(SimpleIfNotConstConditionAndInternalDynamismTest, CompareWithRefs) { }; std::vector> inputShapes_3 = { - { - { - {-1, 2, -1}, - {{1, 2, 0}, {2, 2, 5}} - }, - }, - { - { - {{0, 10}, {0, 10}, {0, 10}}, - {{2, 5, 10}, {2, 0, 0}} - }, - }, + { + {{-1, 2, -1}, {{1, 2, 0}, {2, 2, 5}}}, + }, + { + {{{0, 10}, {0, 10}, {0, 10}}, {{2, 5, 10}, {2, 0, 0}}}, + }, }; -INSTANTIATE_TEST_SUITE_P(smoke_If, SimpleIfNotConstConditionAndDimsIncreaseTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes_3), - ::testing::ValuesIn(inTypes), - ::testing::ValuesIn(conditions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), +INSTANTIATE_TEST_SUITE_P(smoke_If, + SimpleIfNotConstConditionAndDimsIncreaseTest, + ::testing::Combine(::testing::ValuesIn(inputShapes_3), + ::testing::ValuesIn(inTypes), + ::testing::ValuesIn(conditions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), SimpleIfNotConstConditionTest::getTestCaseName); TEST_P(SimpleIfNotConstConditionAndDimsIncreaseTest, CompareWithRefs) { run(); }; -// the axis of split in test suit "SimpleIfNotConstConditionUnusedOutputPortsTest" is hardcoded as 1, so shape[axis] should be static +// the axis of split in test suit "SimpleIfNotConstConditionUnusedOutputPortsTest" is hardcoded as 1, so shape[axis] +// should be static std::vector> inputShapes_4 = { - { - {{}, {{5, 7}}}, - }, - { - { - {-1, 5, -1}, - {{10, 5, 10}, {2, 5, 5}, {1, 5, 5}} - }, - }, + { + {{}, {{5, 7}}}, + }, + { + {{-1, 5, -1}, {{10, 5, 10}, {2, 5, 5}, {1, 5, 5}}}, + }, }; -INSTANTIATE_TEST_SUITE_P(smoke_If, SimpleIfNotConstConditionUnusedOutputPortsTest, - ::testing::Combine( - ::testing::ValuesIn(inputShapes_4), - ::testing::ValuesIn(inTypes), - ::testing::ValuesIn(conditions), - ::testing::Values(ov::test::utils::DEVICE_CPU)), +INSTANTIATE_TEST_SUITE_P(smoke_If, + SimpleIfNotConstConditionUnusedOutputPortsTest, + ::testing::Combine(::testing::ValuesIn(inputShapes_4), + ::testing::ValuesIn(inTypes), + ::testing::ValuesIn(conditions), + ::testing::Values(ov::test::utils::DEVICE_CPU)), SimpleIfNotConstConditionUnusedOutputPortsTest::getTestCaseName); TEST_P(SimpleIfNotConstConditionUnusedOutputPortsTest, CompareWithRefs) { diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/split_concat_memory.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/split_concat_memory.cpp index 4949f983169ab9..11c8faab0902ff 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/split_concat_memory.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/subgraph_tests/split_concat_memory.cpp @@ -2,21 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include - #include "subgraph_tests/split_concat_memory.hpp" -using namespace ov::test::subgraph; +#include + +using namespace ov::test; namespace { const std::vector netPrecisions = { - ov::element::f32, - ov::element::i32, - ov::element::f16, - ov::element::i16, - ov::element::u8, - ov::element::i8, + ov::element::f32, + ov::element::i32, + ov::element::f16, + ov::element::i16, + ov::element::u8, + ov::element::i8, }; const std::vector shapes = { @@ -26,11 +26,11 @@ const std::vector shapes = { {3, 8}, }; -INSTANTIATE_TEST_SUITE_P(smoke_CPU, SplitConcatMemory, - ::testing::Combine( - ::testing::ValuesIn(shapes), - ::testing::ValuesIn(netPrecisions), - ::testing::Values(1), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - SplitConcatMemory::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_CPU, + SplitConcatMemory, + ::testing::Combine(::testing::ValuesIn(shapes), + ::testing::ValuesIn(netPrecisions), + ::testing::Values(1), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + SplitConcatMemory::getTestCaseName); } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/param_result_custom_blob.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/param_result_custom_blob.cpp index 11eaffd501ee1c..b762671a66d610 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/param_result_custom_blob.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/param_result_custom_blob.cpp @@ -2,16 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "shared_test_classes/subgraph/parameter_result.hpp" #include "common_test_utils/test_constants.hpp" +#include "shared_test_classes/subgraph/parameter_result.hpp" using namespace SubgraphTestsDefinitions; +using namespace ov::test; using namespace InferenceEngine; namespace CPULayerTestsDefinitions { class ParameterResultCustomBlobTest : public ParameterResultSubgraphTestLegacyApi { - protected: +protected: void Infer() override { constexpr size_t inferIterations = 10lu; @@ -25,7 +26,7 @@ class ParameterResultCustomBlobTest : public ParameterResultSubgraphTestLegacyAp std::string inputName = cnnNetwork.getInputsInfo().begin()->first; std::vector customInpData(elementsCount); - auto inpBlobData = inputBlob->buffer().as(); + auto inpBlobData = inputBlob->buffer().as(); std::copy(inpBlobData, inpBlobData + elementsCount, customInpData.begin()); auto& tensorDesc = inputsInfo->getTensorDesc(); @@ -38,7 +39,7 @@ class ParameterResultCustomBlobTest : public ParameterResultSubgraphTestLegacyAp } } void Validate() override { - //Do nothing. We call Validate() in the Infer() method + // Do nothing. We call Validate() in the Infer() method } }; @@ -51,12 +52,12 @@ TEST_P(ParameterResultCustomBlobTest, CompareWithRefs) { Run(); } namespace { - INSTANTIATE_TEST_SUITE_P(smoke_Check_Custom_Blob, ParameterResultCustomBlobTest, - ::testing::Combine( - ::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {{}}}), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ParameterResultSubgraphTestBase::getTestCaseName); -} // namespace +INSTANTIATE_TEST_SUITE_P(smoke_Check_Custom_Blob, + ParameterResultCustomBlobTest, + ::testing::Combine(::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {{}}}), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ParameterResultSubgraphTestBase::getTestCaseName); +} // namespace class ParameterResultSameBlobTest : public ParameterResultSubgraphTestLegacyApi { protected: @@ -69,7 +70,7 @@ class ParameterResultSameBlobTest : public ParameterResultSubgraphTestLegacyApi } } void Validate() override { - //Do nothing. We call Validate() in the Infer() method + // Do nothing. We call Validate() in the Infer() method } }; @@ -77,10 +78,10 @@ TEST_P(ParameterResultSameBlobTest, CompareWithRefs) { Run(); } namespace { - INSTANTIATE_TEST_SUITE_P(smoke_Check_Same_Blob, ParameterResultSameBlobTest, - ::testing::Combine( - ::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {{}}}), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ParameterResultSubgraphTestBase::getTestCaseName); -} // namespace -} // namespace CPULayerTestsDefinitions +INSTANTIATE_TEST_SUITE_P(smoke_Check_Same_Blob, + ParameterResultSameBlobTest, + ::testing::Combine(::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {{}}}), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ParameterResultSubgraphTestBase::getTestCaseName); +} // namespace +} // namespace CPULayerTestsDefinitions diff --git a/src/plugins/intel_gna/src/frontend/quantization.cpp b/src/plugins/intel_gna/src/frontend/quantization.cpp index 4bcadfec5f7eb4..deb8663801a651 100644 --- a/src/plugins/intel_gna/src/frontend/quantization.cpp +++ b/src/plugins/intel_gna/src/frontend/quantization.cpp @@ -93,7 +93,6 @@ void QuantizeWeights(const QuantizationData& data, auto output_low = 0.0f; auto output_high = 0.0f; uint32_t levels = 1; - float valueAcc = 0.0f; const auto min_values_size = data.weights_quant_params.GetMinValues().size(); if (min_values_size > 0) { @@ -121,7 +120,6 @@ void QuantizeWeights(const QuantizationData& data, float scaled_row_max = 0; for (size_t col = 0; col < data.num_columns; col++) { float value = ptr_float_weights[row * data.num_columns + col] * data.scale_factor; - valueAcc += value; if (fabs(value) > scaled_row_max) { scaled_row_max = fabs(value); } diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp index a93153fba88752..c417dc6ce04a2c 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/parameter_result.cpp @@ -2,25 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "subgraph_tests/parameter_result.hpp" + #include -#include "subgraph_tests/parameter_result.hpp" #include "common_test_utils/test_constants.hpp" using namespace SubgraphTestsDefinitions; +using namespace ov::test; namespace { -INSTANTIATE_TEST_SUITE_P(smoke_Check, ParameterResultSubgraphTestLegacyApi, - ::testing::Combine( - ::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {}}), - ::testing::Values(ov::test::utils::DEVICE_GPU)), - ParameterResultSubgraphTestBase::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Check, ParameterResultSubgraphTest, - ::testing::Combine( - ::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {{1, 3, 10, 10}}}), - ::testing::Values(ov::test::utils::DEVICE_GPU)), - ParameterResultSubgraphTestBase::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Check, + ParameterResultSubgraphTestLegacyApi, + ::testing::Combine(::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {}}), + ::testing::Values(ov::test::utils::DEVICE_GPU)), + ParameterResultSubgraphTestBase::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Check, + ParameterResultSubgraphTest, + ::testing::Combine(::testing::Values(ov::test::InputShape{{1, 3, 10, 10}, {{1, 3, 10, 10}}}), + ::testing::Values(ov::test::utils::DEVICE_GPU)), + ParameterResultSubgraphTestBase::getTestCaseName); } // namespace diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp index ec5545e57c7523..32ecadf49663b4 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/subgraph_tests/preprocess.cpp @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include - #include "shared_test_classes/subgraph/preprocess.hpp" -using namespace SubgraphTestsDefinitions; +#include + +using namespace ov::test; namespace { @@ -28,7 +28,7 @@ inline std::vector GPU_smoke_preprocess_functions() { preprocess_func(resize_nearest, "resize_nearest", 0.01f), preprocess_func(resize_linear_nhwc, "resize_linear_nhwc", 0.01f), preprocess_func(resize_cubic, "resize_cubic", 0.01f), - preprocess_func(resize_dynamic, "resize_dynamic", 0.01f, { ov::Shape {1, 3, 123, 123} }), + preprocess_func(resize_dynamic, "resize_dynamic", 0.01f, {ov::Shape{1, 3, 123, 123}}), preprocess_func(crop_basic, "crop_basic", 0.000001f), preprocess_func(crop_negative, "crop_negative", 0.000001f), preprocess_func(convert_layout_by_dims, "convert_layout_by_dims", 0.01f), @@ -43,10 +43,10 @@ inline std::vector GPU_smoke_preprocess_functions() { }; } -INSTANTIATE_TEST_SUITE_P(smoke_PrePostProcess_GPU, PrePostProcessTest, - ::testing::Combine( - ::testing::ValuesIn(GPU_smoke_preprocess_functions()), - ::testing::Values(ov::test::utils::DEVICE_GPU)), +INSTANTIATE_TEST_SUITE_P(smoke_PrePostProcess_GPU, + PrePostProcessTest, + ::testing::Combine(::testing::ValuesIn(GPU_smoke_preprocess_functions()), + ::testing::Values(ov::test::utils::DEVICE_GPU)), PrePostProcessTest::getTestCaseName); } // namespace diff --git a/src/tests/functional/plugin/shared/include/subgraph_tests/conv_eltwise_fusion.hpp b/src/tests/functional/plugin/shared/include/subgraph_tests/conv_eltwise_fusion.hpp index 9d14fb3ab7149d..f41991680ab4f6 100644 --- a/src/tests/functional/plugin/shared/include/subgraph_tests/conv_eltwise_fusion.hpp +++ b/src/tests/functional/plugin/shared/include/subgraph_tests/conv_eltwise_fusion.hpp @@ -11,4 +11,5 @@ namespace SubgraphTestsDefinitions { TEST_P(ConvEltwiseFusion, CompareWithRefs) { Run(); } -} // namespace SubgraphTestsDefinitions + +} // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/plugin/shared/include/subgraph_tests/parameter_result.hpp b/src/tests/functional/plugin/shared/include/subgraph_tests/parameter_result.hpp index a4f5baedd820c0..40123974846ea3 100644 --- a/src/tests/functional/plugin/shared/include/subgraph_tests/parameter_result.hpp +++ b/src/tests/functional/plugin/shared/include/subgraph_tests/parameter_result.hpp @@ -12,8 +12,14 @@ TEST_P(ParameterResultSubgraphTestLegacyApi, CompareWithRefs) { Run(); } +} // namespace SubgraphTestsDefinitions + +namespace ov { +namespace test { + TEST_P(ParameterResultSubgraphTest, CompareWithRefs) { run(); } -} // namespace SubgraphTestsDefinitions +} // namespace test +} // namespace ov diff --git a/src/tests/functional/plugin/shared/include/subgraph_tests/split_concat_memory.hpp b/src/tests/functional/plugin/shared/include/subgraph_tests/split_concat_memory.hpp index c703bb4d139c5b..4545efdc75f683 100644 --- a/src/tests/functional/plugin/shared/include/subgraph_tests/split_concat_memory.hpp +++ b/src/tests/functional/plugin/shared/include/subgraph_tests/split_concat_memory.hpp @@ -4,12 +4,11 @@ #pragma once -#include "shared_test_classes/subgraph/split_concat_memory.hpp" #include "common_test_utils/data_utils.hpp" +#include "shared_test_classes/subgraph/split_concat_memory.hpp" namespace ov { namespace test { -namespace subgraph { TEST_P(SplitConcatMemory, cyclicBufferCorrectness) { /* @@ -28,7 +27,7 @@ TEST_P(SplitConcatMemory, cyclicBufferCorrectness) { auto o_tensor = inferRequest.get_tensor(*function->outputs().begin()); auto output_tensor_ref = ov::Tensor(o_tensor.get_element_type(), o_tensor.get_shape()); - auto fill_by_quarter = [this] (ov::Tensor& tensor, std::vector vals) { + auto fill_by_quarter = [this](ov::Tensor& tensor, std::vector vals) { OPENVINO_ASSERT(vals.size() == 4); auto quarter_blocked_shape = tensor.get_shape(); @@ -38,7 +37,7 @@ TEST_P(SplitConcatMemory, cyclicBufferCorrectness) { quarter_blocked_shape.insert(quarter_blocked_shape.begin() + axis, vals.size()); OPENVINO_ASSERT(ov::shape_size(quarter_blocked_shape) == tensor.get_size()); - auto quarter_blocked_view = ov::Tensor(tensor.get_element_type(), quarter_blocked_shape, tensor.data()); + auto quarter_blocked_view = ov::Tensor(tensor.get_element_type(), quarter_blocked_shape, tensor.data()); ov::test::utils::fill_data_with_broadcast(quarter_blocked_view, axis, vals); }; @@ -63,7 +62,6 @@ TEST_P(SplitConcatMemory, cyclicBufferCorrectness) { compare({output_tensor_ref}, {o_tensor}); } -} // namespace subgraph } // namespace test } // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/conv_eltwise_fusion.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/conv_eltwise_fusion.hpp index 2e96d162821a39..d3dea8eb01b080 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/conv_eltwise_fusion.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/conv_eltwise_fusion.hpp @@ -4,37 +4,35 @@ #pragma once -#include #include +#include #include -#include "shared_test_classes/base/layer_test_utils.hpp" + #include "ov_models/builders.hpp" -#include -#include +#include "shared_test_classes/base/layer_test_utils.hpp" namespace SubgraphTestsDefinitions { -typedef std::tuple< - std::tuple< - ngraph::NodeTypeInfo, // Convolution type - size_t // Number of inputs - >, - ngraph::NodeTypeInfo, // Eltwise type - bool, // Is the test negative or not - ngraph::Shape, // Input shape - ngraph::Shape, // Weights shape - ngraph::Shape, // Const shape - ngraph::element::Type, // Network precision - std::string // Device name - > ConvEltwiseFusionParams; - -class ConvEltwiseFusion - : public testing::WithParamInterface, - virtual public LayerTestsUtils::LayerTestsCommon { +typedef std::tuple, + ov::NodeTypeInfo, // Eltwise type + bool, // Is the test negative or not + ov::Shape, // Input shape + ov::Shape, // Weights shape + ov::Shape, // Const shape + ov::element::Type, // Network precision + std::string // Device name + > + ConvEltwiseFusionParams; + +class ConvEltwiseFusion : public testing::WithParamInterface, + virtual public LayerTestsUtils::LayerTestsCommon { public: - static std::string getTestCaseName(const testing::TestParamInfo &obj); + static std::string getTestCaseName(const testing::TestParamInfo& obj); protected: void SetUp() override; }; -} // namespace SubgraphTestsDefinitions + +} // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/parameter_result.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/parameter_result.hpp index 7156036c6c05a1..5384d369b7b725 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/parameter_result.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/parameter_result.hpp @@ -4,35 +4,40 @@ #pragma once -#include +#include #include +#include #include -#include #include "shared_test_classes/base/layer_test_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" -#include "ov_models/builders.hpp" -namespace SubgraphTestsDefinitions { +namespace ov { +namespace test { -using parameterResultParams = std::tuple; // Device name +using parameterResultParams = std::tuple; // Device name class ParameterResultSubgraphTestBase : public testing::WithParamInterface { - public: - static std::string getTestCaseName(const testing::TestParamInfo& obj); - protected: - std::shared_ptr createModel(const ov::PartialShape& shape); +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj); + +protected: + std::shared_ptr createModel(const ov::PartialShape& shape); }; -class ParameterResultSubgraphTestLegacyApi : public ParameterResultSubgraphTestBase, - virtual public LayerTestsUtils::LayerTestsCommon { +class ParameterResultSubgraphTest : public ParameterResultSubgraphTestBase, virtual public ov::test::SubgraphBaseTest { protected: void SetUp() override; }; -class ParameterResultSubgraphTest : public ParameterResultSubgraphTestBase, - virtual public ov::test::SubgraphBaseTest { +} // namespace test +} // namespace ov + +namespace SubgraphTestsDefinitions { + +class ParameterResultSubgraphTestLegacyApi : public ov::test::ParameterResultSubgraphTestBase, + virtual public LayerTestsUtils::LayerTestsCommon { protected: void SetUp() override; }; diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp index dcc713ff27be8e..59a242990c5e2c 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/preprocess.hpp @@ -4,29 +4,37 @@ #pragma once -#include +#include #include +#include #include -#include -#include "shared_test_classes/base/ov_subgraph.hpp" #include "ov_models/builders.hpp" #include "ov_models/preprocess/preprocess_builders.hpp" #include "ov_models/utils/ov_helpers.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" -namespace SubgraphTestsDefinitions { +namespace ov { +namespace test { -using preprocessParamsTuple = std::tuple< - ov::builder::preprocess::preprocess_func, // Function with preprocessing - std::string>; // Device name +using preprocessParamsTuple = std::tuple; // Device name class PrePostProcessTest : public testing::WithParamInterface, virtual public ov::test::SubgraphBaseTest { public: - static std::string getTestCaseName(const testing::TestParamInfo &obj); + static std::string getTestCaseName(const testing::TestParamInfo& obj); protected: void SetUp() override; }; +} // namespace test +} // namespace ov + +namespace SubgraphTestsDefinitions { + +using ov::test::PrePostProcessTest; +using ov::test::preprocessParamsTuple; + } // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/simple_if.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/simple_if.hpp index d44a84941488a1..89c5ab59c34536 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/simple_if.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/simple_if.hpp @@ -4,30 +4,30 @@ #pragma once -#include #include +#include #include -#include "shared_test_classes/base/ov_subgraph.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" -namespace SubgraphTestsDefinitions { +namespace ov { +namespace test { -using SimpleIfParamsTuple = typename std::tuple< - std::vector, // Input shapes - ov::test::ElementType, // Network precision - bool, // If condition - std::string // Device name ->; +using SimpleIfParamsTuple = typename std::tuple, // Input shapes + ov::test::ElementType, // Network precision + bool, // If condition + std::string // Device name + >; -class SimpleIfTest: - public testing::WithParamInterface, - virtual public ov::test::SubgraphBaseTest { +class SimpleIfTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { public: - static std::string getTestCaseName(const testing::TestParamInfo &obj); + static std::string getTestCaseName(const testing::TestParamInfo& obj); + protected: void SetUp() override; - void compare(const std::vector &expected, const std::vector &actual) override; + void compare(const std::vector& expected, const std::vector& actual) override; size_t inferNum = 0; }; @@ -55,12 +55,12 @@ class SimpleIfNotConstConditionAndInternalDynamismTest : public SimpleIfNotConst class SimpleIfNotConstConditionAndDimsIncreaseTest : public SimpleIfNotConstConditionTest { protected: void SetUp() override; - void compare(const std::vector &expected, const std::vector &actual) override; + void compare(const std::vector& expected, const std::vector& actual) override; }; class SimpleIfNotConstConditionUnusedOutputPortsTest : public SimpleIfNotConstConditionTest { protected: void SetUp() override; }; - -} // namespace SubgraphTestsDefinitions +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_concat_memory.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_concat_memory.hpp index 32c25ab6d3975e..68d99304bf2ffb 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_concat_memory.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_concat_memory.hpp @@ -10,14 +10,12 @@ namespace ov { namespace test { -namespace subgraph { -using SplitConcatMemoryParamsTuple = typename std::tuple< - ov::Shape, // input shapes - ov::element::Type, // precision - int, // axis of split - std::string // device name ->; +using SplitConcatMemoryParamsTuple = typename std::tuple; class SplitConcatMemory : public testing::WithParamInterface, virtual public ov::test::SubgraphBaseTest { @@ -29,6 +27,5 @@ class SplitConcatMemory : public testing::WithParamInterface -// #include - namespace SubgraphTestsDefinitions { -std::string ConvEltwiseFusion::getTestCaseName(const testing::TestParamInfo &obj) { +std::string ConvEltwiseFusion::getTestCaseName(const testing::TestParamInfo& obj) { std::tuple conv_params; NodeTypeInfo conv_type, eltwise_type; bool negative; Shape input_shape, weights_shape, const_shape; element::Type precision; std::string targetName; - std::tie(conv_params, eltwise_type, negative, input_shape, weights_shape, const_shape, precision, targetName) = obj.param; + std::tie(conv_params, eltwise_type, negative, input_shape, weights_shape, const_shape, precision, targetName) = + obj.param; size_t num_inputs; std::tie(conv_type, num_inputs) = conv_params; std::ostringstream results; @@ -46,7 +46,8 @@ void ConvEltwiseFusion::SetUp() { Shape input_shape, weights_shape, const_shape; element::Type precision; size_t num_inputs; - std::tie(conv_params, eltwise_type, negative, input_shape, weights_shape, const_shape, precision, targetDevice) = this->GetParam(); + std::tie(conv_params, eltwise_type, negative, input_shape, weights_shape, const_shape, precision, targetDevice) = + this->GetParam(); std::tie(conv_type, num_inputs) = conv_params; pass::Manager manager; @@ -56,8 +57,12 @@ void ConvEltwiseFusion::SetUp() { Shape strides(spatial_dims, 1); std::vector pad_begin(spatial_dims, 0), pad_end(spatial_dims, 0); - auto weights = ngraph::builder::makeConstant(precision, weights_shape, std::vector(shape_size(weights_shape), 2)); - auto eltwise_const = ngraph::builder::makeConstant(precision, const_shape, std::vector(shape_size(const_shape), 3)); + auto weights = ngraph::builder::makeConstant(precision, + weights_shape, + std::vector(shape_size(weights_shape), 2)); + auto eltwise_const = ngraph::builder::makeConstant(precision, + const_shape, + std::vector(shape_size(const_shape), 3)); std::shared_ptr conv; if (conv_type == opset11::Convolution::get_type_info_static()) { conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); @@ -65,19 +70,45 @@ void ConvEltwiseFusion::SetUp() { conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); } else if (conv_type == opset11::ConvolutionBackpropData::get_type_info_static()) { if (num_inputs == 3) { - auto output_shape = std::make_shared(element::u64, Shape{spatial_dims}, - std::vector(input_shape.begin() + 2, input_shape.end())); - conv = std::make_shared(param, weights, output_shape, strides, pad_begin, pad_end, strides); + auto output_shape = std::make_shared( + element::u64, + Shape{spatial_dims}, + std::vector(input_shape.begin() + 2, input_shape.end())); + conv = std::make_shared(param, + weights, + output_shape, + strides, + pad_begin, + pad_end, + strides); } else { - conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); + conv = std::make_shared(param, + weights, + strides, + pad_begin, + pad_end, + strides); } } else if (conv_type == opset11::GroupConvolutionBackpropData::get_type_info_static()) { if (num_inputs == 3) { - auto output_shape = std::make_shared(element::u64, Shape{spatial_dims}, - std::vector(input_shape.begin() + 2, input_shape.end())); - conv = std::make_shared(param, weights, output_shape, strides, pad_begin, pad_end, strides); + auto output_shape = std::make_shared( + element::u64, + Shape{spatial_dims}, + std::vector(input_shape.begin() + 2, input_shape.end())); + conv = std::make_shared(param, + weights, + output_shape, + strides, + pad_begin, + pad_end, + strides); } else { - conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); + conv = std::make_shared(param, + weights, + strides, + pad_begin, + pad_end, + strides); } } else { OPENVINO_THROW("Unsupported type"); @@ -111,7 +142,9 @@ void ConvEltwiseFusion::SetUp() { Shape strides(spatial_dims, 1); std::vector pad_begin(spatial_dims, 0), pad_end(spatial_dims, 0); - auto weights = ngraph::builder::makeConstant(precision, weights_shape, std::vector(shape_size(weights_shape), 6)); + auto weights = ngraph::builder::makeConstant(precision, + weights_shape, + std::vector(shape_size(weights_shape), 6)); std::shared_ptr conv; if (conv_type == opset11::Convolution::get_type_info_static()) { conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); @@ -119,19 +152,45 @@ void ConvEltwiseFusion::SetUp() { conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); } else if (conv_type == opset11::ConvolutionBackpropData::get_type_info_static()) { if (num_inputs == 3) { - auto output_shape = std::make_shared(element::u64, Shape{spatial_dims}, - std::vector(input_shape.begin() + 2, input_shape.end())); - conv = std::make_shared(param, weights, output_shape, strides, pad_begin, pad_end, strides); + auto output_shape = std::make_shared( + element::u64, + Shape{spatial_dims}, + std::vector(input_shape.begin() + 2, input_shape.end())); + conv = std::make_shared(param, + weights, + output_shape, + strides, + pad_begin, + pad_end, + strides); } else { - conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); + conv = std::make_shared(param, + weights, + strides, + pad_begin, + pad_end, + strides); } } else if (conv_type == opset11::GroupConvolutionBackpropData::get_type_info_static()) { if (num_inputs == 3) { - auto output_shape = std::make_shared(element::u64, Shape{spatial_dims}, - std::vector(input_shape.begin() + 2, input_shape.end())); - conv = std::make_shared(param, weights, output_shape, strides, pad_begin, pad_end, strides); + auto output_shape = std::make_shared( + element::u64, + Shape{spatial_dims}, + std::vector(input_shape.begin() + 2, input_shape.end())); + conv = std::make_shared(param, + weights, + output_shape, + strides, + pad_begin, + pad_end, + strides); } else { - conv = std::make_shared(param, weights, strides, pad_begin, pad_end, strides); + conv = std::make_shared(param, + weights, + strides, + pad_begin, + pad_end, + strides); } } @@ -146,4 +205,4 @@ void ConvEltwiseFusion::SetUp() { auto res = compare_functions(cloned_function, function_ref); ASSERT_TRUE(res.first) << res.second; } -} // namespace SubgraphTestsDefinitions +} // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/src/subgraph/parameter_result.cpp b/src/tests/functional/shared_test_classes/src/subgraph/parameter_result.cpp index 26dd81d5e61b9d..e11bc877cd4605 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/parameter_result.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/parameter_result.cpp @@ -4,7 +4,8 @@ #include "shared_test_classes/subgraph/parameter_result.hpp" -namespace SubgraphTestsDefinitions { +namespace ov { +namespace test { std::string ParameterResultSubgraphTestBase::getTestCaseName(const testing::TestParamInfo& obj) { ov::test::InputShape inShape; @@ -29,20 +30,24 @@ std::shared_ptr ParameterResultSubgraphTestBase::createModel(const ov return model; } -void ParameterResultSubgraphTestLegacyApi::SetUp() { +void ParameterResultSubgraphTest::SetUp() { ov::test::InputShape inShape; std::tie(inShape, targetDevice) = this->GetParam(); - IE_ASSERT(inShape.first.is_static()); + init_input_shapes({inShape}); function = createModel(inShape.first); } -void ParameterResultSubgraphTest::SetUp() { +} // namespace test +} // namespace ov + +namespace SubgraphTestsDefinitions { +void ParameterResultSubgraphTestLegacyApi::SetUp() { ov::test::InputShape inShape; std::tie(inShape, targetDevice) = this->GetParam(); - init_input_shapes({inShape}); + OPENVINO_ASSERT(inShape.first.is_static()); function = createModel(inShape.first); } diff --git a/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp b/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp index a340c349584070..df1b09d999b48e 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/preprocess.cpp @@ -3,16 +3,18 @@ // #include "shared_test_classes/subgraph/preprocess.hpp" -#include "ov_models/preprocess/preprocess_builders.hpp" + #include "openvino/core/preprocess/pre_post_process.hpp" +#include "ov_models/preprocess/preprocess_builders.hpp" using namespace ov; using namespace ov::preprocess; using namespace ov::builder::preprocess; -namespace SubgraphTestsDefinitions { -std::string PrePostProcessTest::getTestCaseName( - const testing::TestParamInfo &obj) { +namespace ov { +namespace test { + +std::string PrePostProcessTest::getTestCaseName(const testing::TestParamInfo& obj) { std::string targetName; preprocess_func func; @@ -29,7 +31,7 @@ void PrePostProcessTest::SetUp() { std::tie(func, targetDevice) = GetParam(); function = func.m_function(); rel_threshold = func.m_accuracy; - functionRefs = ngraph::clone_function(*function); + functionRefs = function->clone(); abs_threshold = func.m_accuracy; if (func.m_shapes.empty()) { for (const auto& input : function->inputs()) { @@ -43,4 +45,5 @@ TEST_P(PrePostProcessTest, CompareWithRefs) { run(); } -} // namespace SubgraphTestsDefinitions +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/subgraph/simple_if.cpp b/src/tests/functional/shared_test_classes/src/subgraph/simple_if.cpp index 1f81363b54b7c0..3c408c0bff048f 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/simple_if.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/simple_if.cpp @@ -3,11 +3,14 @@ // #include "shared_test_classes/subgraph/simple_if.hpp" + +#include "common_test_utils/ov_tensor_utils.hpp" #include "ov_models/builders.hpp" -#include -namespace SubgraphTestsDefinitions { -std::string SimpleIfTest::getTestCaseName(const testing::TestParamInfo &obj) { +namespace ov { +namespace test { + +std::string SimpleIfTest::getTestCaseName(const testing::TestParamInfo& obj) { std::vector shapes; ov::test::ElementType inType; bool condition; @@ -19,7 +22,7 @@ std::string SimpleIfTest::getTestCaseName(const testing::TestParamInfo &expected, const std::vector &actual) { +void SimpleIfTest::compare(const std::vector& expected, const std::vector& actual) { // in bodies there aren't nodes that work with dimension 0. So we shouldn't call SubgraphBaseTest::compare bool hasZero = false; for (auto shape : targetStaticShapes[inferNum]) { - hasZero = hasZero || std::any_of(shape.begin(), shape.end(), [](size_t dim) { return dim == 0; }); + hasZero = hasZero || std::any_of(shape.begin(), shape.end(), [](size_t dim) { + return dim == 0; + }); } if (!hasZero) { SubgraphBaseTest::compare(expected, actual); @@ -112,7 +117,8 @@ void SimpleIf2OutTest::SetUp() { auto ifRes1 = ifOp->set_output(res1, res3); auto ifRes2 = ifOp->set_output(res2, res4); - ov::ResultVector results{std::make_shared(ifRes1), std::make_shared(ifRes2)}; + ov::ResultVector results{std::make_shared(ifRes1), + std::make_shared(ifRes2)}; function = std::make_shared(results, params, "simpleIf2Out"); } @@ -122,7 +128,7 @@ void SimpleIfNotConstConditionTest::SetUp() { std::tie(shapes, inType, condition, targetDevice) = this->GetParam(); init_input_shapes(shapes); - for (auto &target : targetStaticShapes) + for (auto& target : targetStaticShapes) target.emplace_back(ov::Shape{}); ov::ParameterVector params; for (auto&& shape : inputDynamicShapes) { @@ -152,11 +158,12 @@ void SimpleIfNotConstConditionTest::SetUp() { auto ifRes1 = ifOp->set_output(res1, res3); auto ifRes2 = ifOp->set_output(res2, res4); - ov::ResultVector results{std::make_shared(ifRes1), std::make_shared(ifRes2)}; + ov::ResultVector results{std::make_shared(ifRes1), + std::make_shared(ifRes2)}; function = std::make_shared(results, params, "SimpleIfNotConstConditionTest"); } -void SimpleIfNotConstConditionTest::generate_inputs(const std::vector& targetInputStaticShapes) { +void SimpleIfNotConstConditionTest::generate_inputs(const std::vector& targetInputStaticShapes) { inputs.clear(); const auto& funcInputs = function->inputs(); for (size_t i = 0; i < funcInputs.size(); ++i) { @@ -165,10 +172,13 @@ void SimpleIfNotConstConditionTest::generate_inputs(const std::vector(); + auto* dataPtr = tensor.data(); dataPtr[0] = condition; } else { - tensor = ov::test::utils::create_and_fill_tensor(funcInput.get_element_type(), targetInputStaticShapes[i], 10, -5); + tensor = ov::test::utils::create_and_fill_tensor(funcInput.get_element_type(), + targetInputStaticShapes[i], + 10, + -5); } inputs.insert({funcInput.get_node_shared_ptr(), tensor}); @@ -181,7 +191,7 @@ void SimpleIfNotConstConditionAndInternalDynamismTest::SetUp() { std::tie(shapes, inType, condition, targetDevice) = this->GetParam(); init_input_shapes(shapes); - for (auto &target : targetStaticShapes) + for (auto& target : targetStaticShapes) target.emplace_back(ov::Shape{}); ov::ParameterVector params; for (auto&& shape : inputDynamicShapes) { @@ -200,7 +210,7 @@ void SimpleIfNotConstConditionAndInternalDynamismTest::SetUp() { auto thenBody = std::make_shared(ov::OutputVector{thenRes_0, thenRes_1}, ov::ParameterVector{p1}); // else body - auto add_const = std::make_shared(inType, ov::Shape{}, std::vector{ 2 }); + auto add_const = std::make_shared(inType, ov::Shape{}, std::vector{2}); auto elseOp_0 = std::make_shared(p2, add_const); auto elseOp_1 = std::make_shared(elseOp_0, ov::element::i32); auto elseOp_2 = std::make_shared(elseOp_1, inType); @@ -215,7 +225,8 @@ void SimpleIfNotConstConditionAndInternalDynamismTest::SetUp() { auto ifRes_0 = ifOp->set_output(thenRes_0, elseRes_0); auto ifRes_1 = ifOp->set_output(thenRes_1, elseRes_1); - ov::ResultVector results{std::make_shared(ifRes_0), std::make_shared(ifRes_1)}; + ov::ResultVector results{std::make_shared(ifRes_0), + std::make_shared(ifRes_1)}; function = std::make_shared(results, params, "SimpleIfNotConstConditionAndInternalDynamismTest"); } @@ -225,7 +236,7 @@ void SimpleIfNotConstConditionAndDimsIncreaseTest::SetUp() { std::tie(shapes, inType, condition, targetDevice) = this->GetParam(); init_input_shapes(shapes); - for (auto &target : targetStaticShapes) + for (auto& target : targetStaticShapes) target.emplace_back(ov::Shape{}); ov::ParameterVector params; for (auto&& shape : inputDynamicShapes) { @@ -253,12 +264,16 @@ void SimpleIfNotConstConditionAndDimsIncreaseTest::SetUp() { auto ifRes = ifOp->set_output(thenRes, elseRes); function = std::make_shared(ov::ResultVector{std::make_shared(ifOp)}, - params, "SimpleIfNotConstConditionAndDimsIncreaseTest"); + params, + "SimpleIfNotConstConditionAndDimsIncreaseTest"); } -void SimpleIfNotConstConditionAndDimsIncreaseTest::compare(const std::vector &expected, const std::vector &actual) { +void SimpleIfNotConstConditionAndDimsIncreaseTest::compare(const std::vector& expected, + const std::vector& actual) { const auto shape = targetStaticShapes[inferNum++].front(); - if (!condition && std::any_of(shape.begin(), shape.end(), [](size_t dim) { return dim == 0; })) { + if (!condition && std::any_of(shape.begin(), shape.end(), [](size_t dim) { + return dim == 0; + })) { return; } @@ -271,7 +286,7 @@ void SimpleIfNotConstConditionUnusedOutputPortsTest::SetUp() { std::tie(shapes, inType, condition, targetDevice) = this->GetParam(); init_input_shapes(shapes); - for (auto &target : targetStaticShapes) + for (auto& target : targetStaticShapes) target.emplace_back(ov::Shape{}); ov::ParameterVector params; for (auto&& shape : inputDynamicShapes) { @@ -303,4 +318,5 @@ void SimpleIfNotConstConditionUnusedOutputPortsTest::SetUp() { function = std::make_shared(results, params, "SimpleIfNotConstConditionUnusedOutputPortsTest"); } -} // namespace SubgraphTestsDefinitions +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/subgraph/split_concat_memory.cpp b/src/tests/functional/shared_test_classes/src/subgraph/split_concat_memory.cpp index 75e59fec9ac73a..44eebdc55da21b 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/split_concat_memory.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/split_concat_memory.cpp @@ -6,7 +6,6 @@ namespace ov { namespace test { -namespace subgraph { std::string SplitConcatMemory::getTestCaseName(const testing::TestParamInfo& obj) { ov::element::Type netPrecision; @@ -47,46 +46,42 @@ void SplitConcatMemory::SetUp() { * __|___ __|___ * [_out1_] [_mem2_] */ - ngraph::Shape ng_share_14(shape_14); - ngraph::Shape ng_share_34(shape_34); + ov::Shape ng_share_14(shape_14); + ov::Shape ng_share_34(shape_34); auto input = std::make_shared(inType, ng_share_14); input->set_friendly_name("input"); auto& tensor = input->get_output_tensor(0); tensor.set_names({"input_t"}); - //input->output(0).set_names({"input"}); + // input->output(0).set_names({"input"}); auto mem_c = std::make_shared(inType, ng_share_34, 0); auto mem_r = std::make_shared(mem_c, "id"); - auto cnc = std::make_shared(ngraph::NodeVector{mem_r, input}, axis); + auto cnc = std::make_shared(ov::NodeVector{mem_r, input}, axis); - std::vector chunks_val {static_cast(ng_share_14[axis]), static_cast(ng_share_34[axis])}; - auto chunk_c = std::make_shared(::ngraph::element::i64, ngraph::Shape{chunks_val.size()}, chunks_val); - auto axis_c = std::make_shared(::ngraph::element::i64, ngraph::Shape{}, axis); + std::vector chunks_val{static_cast(ng_share_14[axis]), static_cast(ng_share_34[axis])}; + auto chunk_c = std::make_shared(::ov::element::i64, ov::Shape{chunks_val.size()}, chunks_val); + auto axis_c = std::make_shared(::ov::element::i64, ov::Shape{}, axis); auto spl = std::make_shared(cnc, axis_c, chunk_c); - auto one = std::make_shared(inType, ngraph::Shape{}, 1); - auto plus = std::make_shared(cnc, one, ngraph::op::AutoBroadcastType::NUMPY); + auto one = std::make_shared(inType, ov::Shape{}, 1); + auto plus = std::make_shared(cnc, one, ov::op::AutoBroadcastType::NUMPY); plus->set_friendly_name("plus_one"); auto& o_tensor = plus->get_output_tensor(0); o_tensor.set_names({"plus_one_t"}); - //input->output(0).set_names({"plus_one"}); + // input->output(0).set_names({"plus_one"}); auto mem_w = std::make_shared(spl->output(1), "id"); - // WA. Ngraph limitations. Assign should have control dependencies on read. + // WA. OpenVINO limitations. Assign should have control dependencies on read. // And someone should hold assign node. mem_w->add_control_dependency(mem_r); plus->add_control_dependency(mem_w); - function = std::make_shared( - ngraph::NodeVector {plus}, - ngraph::ParameterVector {input}, - "CyclicBuffer4"); + function = std::make_shared(ov::NodeVector{plus}, ov::ParameterVector{input}, "CyclicBuffer4"); } -} // namespace subgraph } // namespace test } // namespace ov