Skip to content

Commit abc2899

Browse files
authored
Add test instantiations for template plugin (openvinotoolkit#22627)
### Details: - Add test instantiations for template plugin ### Tickets: - [CVS-130342](https://jira.devtools.intel.com/browse/CVS-130342)
1 parent d975257 commit abc2899

File tree

5 files changed

+161
-0
lines changed

5 files changed

+161
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (C) 2018-2023 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
5+
#include "behavior/ov_infer_request/memory_states.hpp"
6+
7+
namespace {
8+
using ov::test::behavior::memoryStateParams;
9+
using ov::test::behavior::OVInferRequestVariableStateTest;
10+
11+
std::vector<memoryStateParams> memoryStateTestCases = {memoryStateParams(OVInferRequestVariableStateTest::get_network(),
12+
{"c_1-3", "r_1-3"},
13+
ov::test::utils::DEVICE_TEMPLATE,
14+
{})};
15+
16+
INSTANTIATE_TEST_SUITE_P(smoke_Template_BehaviorTests,
17+
OVInferRequestVariableStateTest,
18+
::testing::ValuesIn(memoryStateTestCases),
19+
OVInferRequestVariableStateTest::getTestCaseName);
20+
} // namespace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (C) 2018-2023 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
5+
#include "behavior/ov_infer_request/properties_tests.hpp"
6+
7+
#include <vector>
8+
9+
namespace {
10+
using ov::test::behavior::InferRequestPropertiesTest;
11+
12+
const std::vector<ov::AnyMap> configs = {{}};
13+
14+
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
15+
InferRequestPropertiesTest,
16+
::testing::Combine(::testing::Values(1u),
17+
::testing::Values(ov::test::utils::DEVICE_TEMPLATE),
18+
::testing::ValuesIn(configs)),
19+
InferRequestPropertiesTest::getTestCaseName);
20+
21+
} // namespace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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

src/tests/functional/plugin/shared/include/behavior/ov_plugin/hetero_synthetic.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class OVHeteroSyntheticTest : public testing::WithParamInterface<OVHeteroSynthet
5555
static std::vector<FunctionParameter> randomMajorNodeFunctions(
5656
const std::vector<std::function<std::shared_ptr<ov::Model>()>>& builders, bool dynamic_batch = false, uint32_t seed = 0);
5757

58+
static std::vector<FunctionParameter> withMajorNodesFunctions(
59+
const std::function<std::shared_ptr<ov::Model>()>& builder,
60+
const std::unordered_set<std::string>& majorNodes,
61+
bool dynamic_batch = false);
62+
5863
static std::vector<FunctionParameter> _singleMajorNodeFunctions;
5964
static std::vector<FunctionParameter> _randomMajorNodeFunctions;
6065
};

src/tests/functional/plugin/shared/src/behavior/ov_plugin/hetero_synthetic.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ std::vector<FunctionParameter> OVHeteroSyntheticTest::randomMajorNodeFunctions(
184184
return results;
185185
}
186186

187+
std::vector<FunctionParameter> OVHeteroSyntheticTest::withMajorNodesFunctions(const std::function<std::shared_ptr<ov::Model>()>& builder,
188+
const std::unordered_set<std::string>& majorNodes,
189+
bool dynamic_batch) {
190+
auto function = builder();
191+
std::vector<FunctionParameter> result;
192+
result.push_back(FunctionParameter{majorNodes, function, dynamic_batch, 0});
193+
return result;
194+
}
187195

188196
std::vector<FunctionParameter> OVHeteroSyntheticTest::_singleMajorNodeFunctions
189197
= OVHeteroSyntheticTest::singleMajorNodeFunctions(builders);

0 commit comments

Comments
 (0)