diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/comparison.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/comparison.cpp index 8534f1bce52..8977a88cca6 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/comparison.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/comparison.cpp @@ -2,18 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "single_layer_tests/comparison.hpp" - -#include - +#include "single_op_tests/comparison.hpp" #include "common_test_utils/test_constants.hpp" -using namespace LayerTestsDefinitions; -using namespace LayerTestsDefinitions::ComparisonParams; - namespace { +using ov::test::ComparisonLayerTest; -const std::map, std::vector>> inputShapes = { +std::map> input_shapes_combinations = { {{1}, {{1}, {17}, {1, 1}, {2, 18}, {1, 1, 2}, {2, 2, 3}, {1, 1, 2, 3}}}, {{5}, {{1}, {1, 1}, {2, 5}, {1, 1, 1}, {2, 2, 5}}}, {{2, 200}, {{1}, {200}, {1, 200}, {2, 200}, {2, 2, 200}}}, @@ -22,39 +17,52 @@ const std::map, std::vector>> inputShape {{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}}, }; -const std::vector inputsPrecisions = { - InferenceEngine::Precision::FP32, +auto input_shapes_pair_vector = ov::test::utils::combineParams(input_shapes_combinations); + +auto converter = [] (const std::vector>& shapes) { + std::vector> result; + for (const auto& shape : shapes) { + result.push_back({shape.first, shape.second}); + } + return result; }; -const std::vector comparisonOpTypes = { - ngraph::helpers::ComparisonTypes::EQUAL, - ngraph::helpers::ComparisonTypes::NOT_EQUAL, - ngraph::helpers::ComparisonTypes::GREATER, - ngraph::helpers::ComparisonTypes::GREATER_EQUAL, - ngraph::helpers::ComparisonTypes::LESS, - ngraph::helpers::ComparisonTypes::LESS_EQUAL, +auto input_shapes_static = converter(input_shapes_pair_vector); + +std::vector model_type = { + ov::element::f32, + ov::element::f16, + ov::element::i32, + ov::element::boolean, }; -const std::vector secondInputTypes = { - ngraph::helpers::InputLayerType::CONSTANT, - ngraph::helpers::InputLayerType::PARAMETER, +const std::vector comparisonOpTypes = { + ov::test::utils::ComparisonTypes::EQUAL, + ov::test::utils::ComparisonTypes::NOT_EQUAL, + ov::test::utils::ComparisonTypes::GREATER, + ov::test::utils::ComparisonTypes::GREATER_EQUAL, + ov::test::utils::ComparisonTypes::LESS, + ov::test::utils::ComparisonTypes::LESS_EQUAL, +}; + +const std::vector secondInputTypes = { + ov::test::utils::InputLayerType::CONSTANT, + ov::test::utils::InputLayerType::PARAMETER, }; const std::map additional_config = {}; INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, - ::testing::Combine(::testing::ValuesIn(ov::test::utils::combineParams(inputShapes)), - ::testing::ValuesIn(inputsPrecisions), + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_static)), ::testing::ValuesIn(comparisonOpTypes), ::testing::ValuesIn(secondInputTypes), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::ValuesIn(model_type), ::testing::Values(ov::test::utils::DEVICE_GPU), ::testing::Values(additional_config)), ComparisonLayerTest::getTestCaseName); -const std::vector inputShapesIsOps = { +const std::vector> inputShapesIsOps = { {{5}, {1}}, {{2, 2}, {1}}, {{2, 2, 2}, {1}}, @@ -63,20 +71,17 @@ const std::vector inputShapesIsOps = { {{2, 17, 3, 4, 8, 2}, {1}}, }; -const std::vector inputsPrecisionsIsOps = { - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::FP16, +std::vector comparisonOpTypesIs = { + ov::test::utils::ComparisonTypes::IS_FINITE, + ov::test::utils::ComparisonTypes::IS_NAN }; INSTANTIATE_TEST_SUITE_P(smoke_IsOp, ComparisonLayerTest, - ::testing::Combine(::testing::ValuesIn(inputShapesIsOps), - ::testing::ValuesIn(inputsPrecisionsIsOps), - ::testing::Values(ngraph::helpers::ComparisonTypes::IS_FINITE, - ngraph::helpers::ComparisonTypes::IS_NAN), - ::testing::Values(ngraph::helpers::InputLayerType::CONSTANT), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), - ::testing::Values(InferenceEngine::Precision::BOOL), + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapesIsOps)), + ::testing::ValuesIn(comparisonOpTypesIs), + ::testing::Values(ov::test::utils::InputLayerType::CONSTANT), + ::testing::Values(ov::element::f32), ::testing::Values(ov::test::utils::DEVICE_GPU), ::testing::Values(additional_config)), ComparisonLayerTest::getTestCaseName); diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/conversion.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/conversion.cpp index b0faddf52f0..04fe768d070 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/conversion.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/conversion.cpp @@ -4,34 +4,31 @@ #include -#include "single_layer_tests/conversion.hpp" +#include "single_op_tests/conversion.hpp" #include "common_test_utils/test_constants.hpp" -using namespace LayerTestsDefinitions; - namespace { -const std::vector conversionOpTypes = { - ngraph::helpers::ConversionTypes::CONVERT, - ngraph::helpers::ConversionTypes::CONVERT_LIKE, +using ov::test::ConversionLayerTest; +const std::vector conversionOpTypes = { + ov::test::utils::ConversionTypes::CONVERT, + ov::test::utils::ConversionTypes::CONVERT_LIKE, }; -const std::vector> inShape = {{1, 2, 3, 4}}; +const std::vector> inShape = {{{1, 2, 3, 4}}}; -const std::vector netPrecisions = { - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::FP16, - InferenceEngine::Precision::U8, - InferenceEngine::Precision::I8, +const std::vector netPrecisions = { + ov::element::f32, + ov::element::f16, + ov::element::u8, + ov::element::i8, }; INSTANTIATE_TEST_SUITE_P(smoke_NoReshape, ConversionLayerTest, ::testing::Combine( ::testing::ValuesIn(conversionOpTypes), - ::testing::Values(inShape), + ::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inShape)), ::testing::ValuesIn(netPrecisions), ::testing::ValuesIn(netPrecisions), - ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(ov::test::utils::DEVICE_GPU)), ConversionLayerTest::getTestCaseName); diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/convert_color_i420.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/convert_color_i420.cpp index 182043ee90c..225d7cb67c0 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/convert_color_i420.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/convert_color_i420.cpp @@ -4,42 +4,86 @@ #include -#include "single_layer_tests/convert_color_i420.hpp" +#include "single_op_tests/convert_color_i420.hpp" #include "common_test_utils/test_constants.hpp" -using namespace LayerTestsDefinitions; - namespace { +using ov::test::ConvertColorI420LayerTest; const std::vector inShapes_nhwc = { {1, 10, 10, 1} }; const std::vector inTypes = { - ov::element::u8, ov::element::f32 + ov::element::u8, + ov::element::f32 }; -INSTANTIATE_TEST_SUITE_P(smoke_TestsConvertColorI420, +auto generate_input_static_shapes = [] (const std::vector& original_shapes, bool single_plane) { + std::vector> result_shapes; + for (const auto& original_shape : original_shapes) { + std::vector one_result_shapes; + if (single_plane) { + auto shape = original_shape; + shape[1] = shape[1] * 3 / 2; + one_result_shapes.push_back(shape); + } else { + auto shape = original_shape; + one_result_shapes.push_back(shape); + auto uvShape = ov::Shape{shape[0], shape[1] / 2, shape[2] / 2, 1}; + one_result_shapes.push_back(uvShape); + one_result_shapes.push_back(uvShape); + } + result_shapes.push_back(one_result_shapes); + } + return result_shapes; +}; + +auto in_shapes_single_plane_static = generate_input_static_shapes(inShapes_nhwc, true); +auto in_shapes_three_planes_static = generate_input_static_shapes(inShapes_nhwc, false); + +INSTANTIATE_TEST_SUITE_P(smoke_TestsConvertColorI420SinglePlane, ConvertColorI420LayerTest, - ::testing::Combine(::testing::ValuesIn(inShapes_nhwc), + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation(in_shapes_single_plane_static)), ::testing::ValuesIn(inTypes), ::testing::Bool(), - ::testing::Bool(), + ::testing::Values(true), ::testing::Values(ov::test::utils::DEVICE_GPU)), ConvertColorI420LayerTest::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(smoke_TestsConvertColorI420_acc, - ConvertColorI420AccuracyTest, - ::testing::Combine(::testing::Values(ov::Shape{1, 16 * 6, 16, 1}), +INSTANTIATE_TEST_SUITE_P(smoke_TestsConvertColorI420ThreePlanes, + ConvertColorI420LayerTest, + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation(in_shapes_three_planes_static)), + ::testing::ValuesIn(inTypes), + ::testing::Bool(), + ::testing::Values(false), + ::testing::Values(ov::test::utils::DEVICE_GPU)), + ConvertColorI420LayerTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_TestsConvertColorI420SinglePlane_acc, + ConvertColorI420LayerTest, + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation( + generate_input_static_shapes({{1, 16 * 6, 16, 1}}, true))), ::testing::Values(ov::element::u8), ::testing::Bool(), + ::testing::Values(true), + ::testing::Values(ov::test::utils::DEVICE_GPU)), + ConvertColorI420LayerTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_TestsConvertColorI420ThreePlanes_acc, + ConvertColorI420LayerTest, + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation( + generate_input_static_shapes({{1, 16 * 6, 16, 1}}, false))), + ::testing::Values(ov::element::u8), ::testing::Bool(), + ::testing::Values(false), ::testing::Values(ov::test::utils::DEVICE_GPU)), ConvertColorI420LayerTest::getTestCaseName); INSTANTIATE_TEST_SUITE_P(nightly_TestsConvertColorI420_acc, - ConvertColorI420AccuracyTest, - ::testing::Combine(::testing::Values(ov::Shape{1, 256 * 256, 256, 1}), + ConvertColorI420LayerTest, + ::testing::Combine(::testing::ValuesIn(ov::test::static_shapes_to_test_representation( + generate_input_static_shapes({{1, 256 * 256, 256, 1}}, true))), ::testing::Values(ov::element::u8), ::testing::Values(false), ::testing::Values(true),