[GPU] Fixed default device id (#7155)

This commit is contained in:
Vladimir Paramuzov
2021-08-30 18:47:57 +03:00
committed by GitHub
parent 4a9ac22787
commit b235f5e452
3 changed files with 26 additions and 1 deletions
@@ -30,7 +30,7 @@ struct Config {
tuningConfig(),
graph_dumps_dir(""),
sources_dumps_dir(""),
device_id(""),
device_id("0"),
kernels_cache_dir(""),
n_threads(std::max(static_cast<unsigned int>(1), std::thread::hardware_concurrency())),
enable_loop_unrolling(true) {
@@ -97,6 +97,13 @@ namespace {
::testing::ValuesIn(conf)),
CorrectConfigAPITests::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, DefaultValuesConfigTests,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(conf)),
CorrectConfigAPITests::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(smoke_GPU_BehaviorTests, CorrectConfigAPITests,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
@@ -133,6 +133,24 @@ namespace BehaviorTestsDefinitions {
ASSERT_EQ(std::find(supportedOptions.cbegin(), supportedOptions.cend(), key), supportedOptions.cend());
}
using DefaultValuesConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(DefaultValuesConfigTests, CanSetDefaultValueBackToPlugin) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
InferenceEngine::CNNNetwork cnnNet(function);
InferenceEngine::Parameter metric;
ASSERT_NO_THROW(metric = ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
std::vector<std::string> keys = metric;
for (auto& key : keys) {
InferenceEngine::Parameter configValue;
ASSERT_NO_THROW(configValue = ie->GetConfig(targetDevice, key));
ASSERT_NO_THROW(ie->SetConfig({{ key, configValue.as<std::string>()}}, targetDevice));
}
}
using IncorrectConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(IncorrectConfigTests, SetConfigWithIncorrectKey) {