|
| 1 | +// Copyright (C) 2018-2023 Intel Corporation |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | +// |
| 4 | + |
| 5 | +#include "behavior/ov_plugin/hetero_synthetic.hpp" |
| 6 | + |
| 7 | +#include <vector> |
| 8 | + |
| 9 | +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" |
| 10 | +#include "common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp" |
| 11 | + |
| 12 | +namespace { |
| 13 | +using ov::test::behavior::OVHeteroSyntheticTest; |
| 14 | +using ov::test::behavior::PluginParameter; |
| 15 | + |
| 16 | +// this tests load plugin by library name: this is not available during static linkage |
| 17 | +#ifndef OPENVINO_STATIC_LIBRARY |
| 18 | + |
| 19 | +INSTANTIATE_TEST_SUITE_P(smoke_manyTargetInputs, |
| 20 | + OVHeteroSyntheticTest, |
| 21 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{ |
| 22 | + {"TEMPLATE0", "openvino_template_plugin"}, |
| 23 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 24 | + ::testing::ValuesIn(OVHeteroSyntheticTest::withMajorNodesFunctions( |
| 25 | + [] { |
| 26 | + return ov::test::utils::make_conv_pool2_relu2(); |
| 27 | + }, |
| 28 | + {"Conv_1"}, |
| 29 | + true))), |
| 30 | + OVHeteroSyntheticTest::getTestCaseName); |
| 31 | + |
| 32 | +INSTANTIATE_TEST_SUITE_P(smoke_SingleMajorNode, |
| 33 | + OVHeteroSyntheticTest, |
| 34 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{ |
| 35 | + {"TEMPLATE0", "openvino_template_plugin"}, |
| 36 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 37 | + ::testing::ValuesIn(OVHeteroSyntheticTest::_singleMajorNodeFunctions)), |
| 38 | + OVHeteroSyntheticTest::getTestCaseName); |
| 39 | + |
| 40 | +INSTANTIATE_TEST_SUITE_P(nightly_RandomMajorNodes, |
| 41 | + OVHeteroSyntheticTest, |
| 42 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{ |
| 43 | + {"TEMPLATE0", "openvino_template_plugin"}, |
| 44 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 45 | + ::testing::ValuesIn(OVHeteroSyntheticTest::_randomMajorNodeFunctions)), |
| 46 | + OVHeteroSyntheticTest::getTestCaseName); |
| 47 | + |
| 48 | +static std::vector<std::function<std::shared_ptr<ov::Model>()>> dynamicBuilders = { |
| 49 | + [] { |
| 50 | + return ov::test::utils::make_conv_pool_relu_non_zero(); |
| 51 | + }, |
| 52 | +}; |
| 53 | + |
| 54 | +INSTANTIATE_TEST_SUITE_P( |
| 55 | + smoke_NonZeroMajorNode_dynamic, |
| 56 | + OVHeteroSyntheticTest, |
| 57 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{{"TEMPLATE0", "openvino_template_plugin"}, |
| 58 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 59 | + ::testing::ValuesIn(OVHeteroSyntheticTest::withMajorNodesFunctions(dynamicBuilders.front(), |
| 60 | + {"nonZero_1"}))), |
| 61 | + OVHeteroSyntheticTest::getTestCaseName); |
| 62 | + |
| 63 | +INSTANTIATE_TEST_SUITE_P( |
| 64 | + smoke_NonZeroMajorNode_dynamic_batch, |
| 65 | + OVHeteroSyntheticTest, |
| 66 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{{"TEMPLATE0", "openvino_template_plugin"}, |
| 67 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 68 | + ::testing::ValuesIn(OVHeteroSyntheticTest::withMajorNodesFunctions(dynamicBuilders.front(), |
| 69 | + {"nonZero_1"}, |
| 70 | + true))), |
| 71 | + OVHeteroSyntheticTest::getTestCaseName); |
| 72 | + |
| 73 | +INSTANTIATE_TEST_SUITE_P( |
| 74 | + smoke_SingleMajorNode_dynamic, |
| 75 | + OVHeteroSyntheticTest, |
| 76 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{{"TEMPLATE0", "openvino_template_plugin"}, |
| 77 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 78 | + ::testing::ValuesIn(OVHeteroSyntheticTest::singleMajorNodeFunctions(dynamicBuilders))), |
| 79 | + OVHeteroSyntheticTest::getTestCaseName); |
| 80 | + |
| 81 | +INSTANTIATE_TEST_SUITE_P( |
| 82 | + nightly_RandomMajorNodes_dynamic, |
| 83 | + OVHeteroSyntheticTest, |
| 84 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{{"TEMPLATE0", "openvino_template_plugin"}, |
| 85 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 86 | + ::testing::ValuesIn(OVHeteroSyntheticTest::randomMajorNodeFunctions(dynamicBuilders))), |
| 87 | + OVHeteroSyntheticTest::getTestCaseName); |
| 88 | + |
| 89 | +INSTANTIATE_TEST_SUITE_P( |
| 90 | + smoke_SingleMajorNode_dynamic_batch, |
| 91 | + OVHeteroSyntheticTest, |
| 92 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{{"TEMPLATE0", "openvino_template_plugin"}, |
| 93 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 94 | + ::testing::ValuesIn(OVHeteroSyntheticTest::singleMajorNodeFunctions(dynamicBuilders, true))), |
| 95 | + OVHeteroSyntheticTest::getTestCaseName); |
| 96 | + |
| 97 | +INSTANTIATE_TEST_SUITE_P( |
| 98 | + nightly_RandomMajorNodes_dynamic_batch, |
| 99 | + OVHeteroSyntheticTest, |
| 100 | + ::testing::Combine(::testing::Values(std::vector<PluginParameter>{{"TEMPLATE0", "openvino_template_plugin"}, |
| 101 | + {"TEMPLATE1", "openvino_template_plugin"}}), |
| 102 | + ::testing::ValuesIn(OVHeteroSyntheticTest::randomMajorNodeFunctions(dynamicBuilders, true))), |
| 103 | + OVHeteroSyntheticTest::getTestCaseName); |
| 104 | + |
| 105 | +#endif // !OPENVINO_STATIC_LIBRARY |
| 106 | + |
| 107 | +} // namespace |
0 commit comments