@@ -37,8 +37,10 @@ TEST_P(InferencePrecisionTests, smoke_canSetInferencePrecisionAndInfer) {
37
37
static const std::vector<params> test_params = {
38
38
{ov::element::f16, ov::element::f32},
39
39
{ov::element::f16, ov::element::f16},
40
+ {ov::element::f16, ov::element::undefined},
40
41
{ov::element::f32, ov::element::f32},
41
42
{ov::element::f32, ov::element::f16},
43
+ {ov::element::f32, ov::element::undefined},
42
44
};
43
45
44
46
INSTANTIATE_TEST_SUITE_P (smoke_GPU_BehaviorTests, InferencePrecisionTests, ::testing::ValuesIn(test_params), InferencePrecisionTests::getTestCaseName);
@@ -48,7 +50,6 @@ TEST(InferencePrecisionTests, CantSetInvalidInferencePrecision) {
48
50
49
51
ASSERT_NO_THROW (core.get_property (ov::test::utils::DEVICE_GPU, ov::hint::inference_precision));
50
52
ASSERT_ANY_THROW (core.set_property (ov::test::utils::DEVICE_GPU, ov::hint::inference_precision (ov::element::bf16)));
51
- ASSERT_ANY_THROW (core.set_property (ov::test::utils::DEVICE_GPU, ov::hint::inference_precision (ov::element::undefined)));
52
53
}
53
54
54
55
TEST (ExecutionModeTest, SetCompileGetInferPrecisionAndExecMode) {
@@ -62,10 +63,26 @@ TEST(ExecutionModeTest, SetCompileGetInferPrecisionAndExecMode) {
62
63
ASSERT_EQ (ov::element::f32, compiled_model.get_property (ov::hint::inference_precision));
63
64
}
64
65
66
+ {
67
+ /* ov::hint::inference_precision has higher priority than ov::hint::execution_mode */
68
+ auto compiled_model = core.compile_model (model, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision (ov::element::f16),
69
+ ov::hint::execution_mode (ov::hint::ExecutionMode::ACCURACY));
70
+ ASSERT_EQ (ov::hint::ExecutionMode::ACCURACY, compiled_model.get_property (ov::hint::execution_mode));
71
+ ASSERT_EQ (ov::element::f16, compiled_model.get_property (ov::hint::inference_precision));
72
+ }
73
+
74
+ {
75
+ /* ov::hint::inference_precision has higher priority than ov::hint::execution_mode */
76
+ auto compiled_model = core.compile_model (model, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision (ov::element::undefined),
77
+ ov::hint::execution_mode (ov::hint::ExecutionMode::PERFORMANCE));
78
+ ASSERT_EQ (ov::hint::ExecutionMode::PERFORMANCE, compiled_model.get_property (ov::hint::execution_mode));
79
+ ASSERT_EQ (ov::element::undefined, compiled_model.get_property (ov::hint::inference_precision));
80
+ }
81
+
65
82
{
66
83
auto compiled_model = core.compile_model (model, ov::test::utils::DEVICE_GPU, ov::hint::execution_mode (ov::hint::ExecutionMode::ACCURACY));
67
84
ASSERT_EQ (ov::hint::ExecutionMode::ACCURACY, compiled_model.get_property (ov::hint::execution_mode));
68
- ASSERT_EQ (ov::element::f32 , compiled_model.get_property (ov::hint::inference_precision));
85
+ ASSERT_EQ (ov::element::undefined , compiled_model.get_property (ov::hint::inference_precision));
69
86
}
70
87
71
88
{
0 commit comments