Skip to content

Commit

Permalink
Merge pull request openvinotoolkit#12 from tiger100256-hu/bell/ov_2.0
Browse files Browse the repository at this point in the history
add test case
  • Loading branch information
tiger100256-hu authored Feb 8, 2022
2 parents 94887ef + 3228103 commit fa81a30
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ TEST_P(OVClassBasicTestP, smoke_SetConfigHeteroNoThrow) {

TEST(OVClassBasicTest, smoke_SetConfigAutoNoThrows) {
ov::Core ie = createCoreWithTemplate();

// priority config test
ov::hint::Priority value;
OV_ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::hint::model_priority(ov::hint::Priority::LOW)));
OV_ASSERT_NO_THROW(value = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::hint::model_priority));
Expand All @@ -310,6 +312,36 @@ TEST(OVClassBasicTest, smoke_SetConfigAutoNoThrows) {
OV_ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::hint::model_priority(ov::hint::Priority::HIGH)));
OV_ASSERT_NO_THROW(value = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::hint::model_priority));
EXPECT_EQ(value, ov::hint::Priority::HIGH);

// profiling test
bool flag;
const bool enableFlag = true;
OV_ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::enable_profiling(enableFlag)));
OV_ASSERT_NO_THROW(flag = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::enable_profiling));
ASSERT_EQ(enableFlag, flag);

// batching test
bool batching;
OV_ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::allow_auto_batching(enableFlag)));
OV_ASSERT_NO_THROW(batching = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::allow_auto_batching));
ASSERT_EQ(enableFlag, batching);

// perf hint test
ov::hint::PerformanceMode mode;
uint32_t num_requests;
OV_ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT)));
OV_ASSERT_NO_THROW(mode = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::hint::performance_mode));
ASSERT_EQ(ov::hint::PerformanceMode::THROUGHPUT, mode);
ASSERT_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, {{ov::hint::performance_mode.name(), "ABC"}}), ov::Exception);
ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::hint::num_requests(8)));
ASSERT_NO_THROW(num_requests = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::hint::num_requests));
ASSERT_EQ(8, num_requests);

std::string deviceName = CommonTestUtils::DEVICE_CPU;
std::string devicePriority;
OV_ASSERT_NO_THROW(ie.set_property(CommonTestUtils::DEVICE_AUTO, ov::device::priorities(deviceName)));
OV_ASSERT_NO_THROW(devicePriority = ie.get_property(CommonTestUtils::DEVICE_AUTO, ov::device::priorities));
ASSERT_EQ(deviceName, devicePriority);
}

TEST_P(OVClassSpecificDeviceTestSetConfig, SetConfigSpecificDeviceNoThrow) {
Expand Down

0 comments on commit fa81a30

Please sign in to comment.