diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fq_layer_dq_bias.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fq_layer_dq_bias.cpp index 149e3a4d9c6..acd24a1aaaf 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fq_layer_dq_bias.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fq_layer_dq_bias.cpp @@ -5,15 +5,11 @@ #include "ov_lpt_models/markup_bias.hpp" #include "ov_models/builders.hpp" #include "ov_models/utils/ov_helpers.hpp" -#include "shared_test_classes/base/layer_test_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" #include "test_utils/cpu_test_utils.hpp" #include "test_utils/fusing_test_utils.hpp" -using namespace ngraph; -using namespace ov::test; using namespace CPUTestUtils; -using namespace InferenceEngine; /* * This class tests the order in which biases and dequantization scales are fused to the target operation @@ -28,7 +24,9 @@ using namespace InferenceEngine; * Result */ -namespace SubgraphTestsDefinitions { +namespace ov { +namespace test { + using FQLayerDQBiasParams = std::tuple; class FQLayerDQBias : virtual public SubgraphBaseTest, @@ -73,7 +71,11 @@ protected: const auto shapes = layer_type == "MatMul" ? std::vector{input_shape, input_shape} : std::vector{input_shape}; init_input_shapes(shapes); - function = ngraph::builder::subgraph::MarkupBiasFunction::get(ov::element::f32, inputDynamicShapes[0], {}, layer_type, extra_multiply); + function = ngraph::builder::subgraph::MarkupBiasFunction::get(ov::element::f32, + inputDynamicShapes[0], + {}, + layer_type, + extra_multiply); } std::string node_type; @@ -85,10 +87,7 @@ TEST_P(FQLayerDQBias, smoke_CompareWithRefs) { } namespace { -const std::vector input_shapes_4D_static = { - {{}, {{1, 3, 1, 1}}}, - {{}, {{1, 3, 64, 64}}} -}; +const std::vector input_shapes_4D_static = {{{}, {{1, 3, 1, 1}}}, {{}, {{1, 3, 64, 64}}}}; const std::vector layer_types_4D_static = { "Convolution", @@ -97,15 +96,14 @@ const std::vector layer_types_4D_static = { "MatMul", }; -INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQBias_4D_static, FQLayerDQBias, +INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQBias_4D_static, + FQLayerDQBias, ::testing::Combine(::testing::ValuesIn(input_shapes_4D_static), ::testing::ValuesIn(layer_types_4D_static), ::testing::Values(false)), FQLayerDQBias::getTestCaseName); -const std::vector input_shapes_4D_dynamic = { - {{-1, 3, -1, -1}, {{1, 3, 64, 64}}} -}; +const std::vector input_shapes_4D_dynamic = {{{-1, 3, -1, -1}, {{1, 3, 64, 64}}}}; const std::vector layer_types_4D_dynamic = { "Convolution", @@ -113,30 +111,32 @@ const std::vector layer_types_4D_dynamic = { "MatMul", }; -INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQBias_4D_dynamic, FQLayerDQBias, +INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQBias_4D_dynamic, + FQLayerDQBias, ::testing::Combine(::testing::ValuesIn(input_shapes_4D_dynamic), ::testing::ValuesIn(layer_types_4D_dynamic), ::testing::Values(false)), FQLayerDQBias::getTestCaseName); -const std::vector input_shapes_2D = { - {{-1, 768}, {{1, 768}}} -}; +const std::vector input_shapes_2D = {{{-1, 768}, {{1, 768}}}}; const std::vector layer_types_2D = { "MatMulWithConstant", }; -INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQBias_2D, FQLayerDQBias, +INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQBias_2D, + FQLayerDQBias, ::testing::Combine(::testing::ValuesIn(input_shapes_2D), ::testing::ValuesIn(layer_types_2D), ::testing::Values(false)), FQLayerDQBias::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQExtraMultiplyAdd_2D, FQLayerDQBias, +INSTANTIATE_TEST_SUITE_P(smoke_FQLayerDQExtraMultiplyAdd_2D, + FQLayerDQBias, ::testing::Combine(::testing::ValuesIn(input_shapes_2D), ::testing::ValuesIn(layer_types_2D), ::testing::Values(false)), FQLayerDQBias::getTestCaseName); -} // namespace -} // namespace SubgraphTestsDefinitions +} // namespace +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_conv_fq_with_shared_constants.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_conv_fq_with_shared_constants.cpp index 68dc6230dbd..b861fee6300 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_conv_fq_with_shared_constants.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_conv_fq_with_shared_constants.cpp @@ -2,21 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "common_test_utils/node_builders/convolution.hpp" +#include "ov_models/builders.hpp" +#include "ov_models/utils/ov_helpers.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" #include "test_utils/cpu_test_utils.hpp" #include "test_utils/fusing_test_utils.hpp" -#include "shared_test_classes/base/ov_subgraph.hpp" -#include "shared_test_classes/base/layer_test_utils.hpp" -#include "ov_models/utils/ov_helpers.hpp" -#include "ov_models/builders.hpp" -using namespace ngraph; -using namespace ov::test; using namespace CPUTestUtils; -using namespace InferenceEngine; -namespace SubgraphTestsDefinitions { -class ConvAndFQWithSharedConstants : virtual public SubgraphBaseTest, - public CpuTestWithFusing { +namespace ov { +namespace test { +class ConvAndFQWithSharedConstants : virtual public SubgraphBaseTest, public CpuTestWithFusing { public: void SetUp() override { targetDevice = ov::test::utils::DEVICE_CPU; @@ -27,13 +24,19 @@ public: auto in_shapes = static_shapes_to_test_representation({input_static_shape}); init_input_shapes({in_shapes}); - ov::ParameterVector input_params {std::make_shared(precision, ov::Shape(input_static_shape))}; + ov::ParameterVector input_params{ + std::make_shared(precision, ov::Shape(input_static_shape))}; - auto shared_il = opset1::Constant::create(precision, {1, 1, 1, 1}, {0.f}); - auto shared_ih = opset1::Constant::create(precision, {1, 1, 1, 1}, {12.5f}); - auto shared_ol = opset1::Constant::create(precision, {1, 1, 1, 1}, {0.f}); - auto shared_oh = opset1::Constant::create(precision, {1, 1, 1, 1}, {12.5f}); - auto fq_before = std::make_shared(input_params[0], shared_il, shared_ih, shared_ol, shared_oh, 256); + auto shared_il = ov::op::v0::Constant::create(precision, {1, 1, 1, 1}, {0.f}); + auto shared_ih = ov::op::v0::Constant::create(precision, {1, 1, 1, 1}, {12.5f}); + auto shared_ol = ov::op::v0::Constant::create(precision, {1, 1, 1, 1}, {0.f}); + auto shared_oh = ov::op::v0::Constant::create(precision, {1, 1, 1, 1}, {12.5f}); + auto fq_before = std::make_shared(input_params[0], + shared_il, + shared_ih, + shared_ol, + shared_oh, + 256); std::shared_ptr conv; { @@ -44,18 +47,28 @@ public: const std::vector dilation = {1, 1}; const size_t numOutChannels = 16; const op::PadType paddingType = op::PadType::EXPLICIT; - conv = builder::makeConvolution(fq_before, precision, kernelSize, strides, padBegin, padEnd, dilation, paddingType, numOutChannels); + conv = ov::test::utils::make_convolution(fq_before, + precision, + kernelSize, + strides, + padBegin, + padEnd, + dilation, + paddingType, + numOutChannels); } - auto fq_after = std::make_shared(conv, shared_il, shared_ih, shared_ol, shared_oh, 256); + auto fq_after = + std::make_shared(conv, shared_il, shared_ih, shared_ol, shared_oh, 256); function = makeNgraphFunction(precision, input_params, fq_after, "ConvFQWithSharedContants"); } }; namespace { - TEST_F(ConvAndFQWithSharedConstants, smoke_ConvAndFQWithSharedConstants_CPU) { - run(); - CheckPluginRelatedResults(compiledModel, "Convolution"); - } -} // namespace -} // namespace SubgraphTestsDefinitions +TEST_F(ConvAndFQWithSharedConstants, smoke_ConvAndFQWithSharedConstants_CPU) { + run(); + CheckPluginRelatedResults(compiledModel, "Convolution"); +} +} // namespace +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp index 580b400cdf7..61b362a2dee 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp @@ -2,23 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "shared_test_classes/base/layer_test_utils.hpp" -#include "shared_test_classes/base/ov_subgraph.hpp" -#include "ov_models/utils/ov_helpers.hpp" -#include "ov_models/builders.hpp" +#include "common_test_utils/ov_tensor_utils.hpp" + #include "ngraph/runtime/aligned_buffer.hpp" -#include +#include "ov_models/builders.hpp" +#include "ov_models/utils/ov_helpers.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" -using namespace ov::test; - -namespace SubgraphTestsDefinitions { +namespace ov { +namespace test { class FuseNon0OuputPort : public SubgraphBaseTest { void SetUp() override { const ov::Shape x_shape = {1, 10}; const ov::Shape y_shape = {1}; const ov::Shape z_shape = {1}; - ngraph::ParameterVector params(3); + ov::ParameterVector params(3); targetStaticShapes = {{x_shape, y_shape, z_shape}}; targetDevice = ov::test::utils::DEVICE_CPU; params[0] = std::make_shared(ov::element::f32, x_shape); @@ -27,14 +26,14 @@ class FuseNon0OuputPort : public SubgraphBaseTest { // make a sub function const auto cond = ov::op::v0::Constant::create(ov::element::boolean, {1}, {true}); - ngraph::ParameterVector sub_params(3); + ov::ParameterVector sub_params(3); sub_params[0] = std::make_shared(ov::element::f32, x_shape); sub_params[1] = std::make_shared(ov::element::i32, y_shape); sub_params[2] = std::make_shared(ov::element::boolean, y_shape); - ngraph::ResultVector sub_results(3); - sub_results[0] = std::make_shared(sub_params[0]); - sub_results[1] = std::make_shared(sub_params[1]); - sub_results[2] = std::make_shared(sub_params[2]); + ov::ResultVector sub_results(3); + sub_results[0] = std::make_shared(sub_params[0]); + sub_results[1] = std::make_shared(sub_params[1]); + sub_results[2] = std::make_shared(sub_params[2]); const auto sub_model = std::make_shared(sub_results, sub_params); // loop ops @@ -61,4 +60,5 @@ TEST_F(FuseNon0OuputPort, smoke_FuseNon0OuputPort) { run(); } -} // namespace SubgraphTestsDefinitions +} // namespace test +} // namespace ov