From 615c2a6c30689732d586c466d731e3fba73fd33b Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Wed, 24 Jun 2020 16:10:39 +0300 Subject: [PATCH] [IE TESTS] CoreThreadingTestsWithIterations.smoke_LoadNetworkAccuracy disabled & small refactoring of CoreThreadingTests (#1103) --- .../behavior/core_threading_tests.cpp | 18 +++++----- .../shared_tests_instances/skip_tests_config.cpp | 3 ++ .../behavior/core_threading_tests.cpp | 9 ++--- .../behavior/core_threading_tests.cpp | 11 +++--- .../include/behavior/core_threading_tests.hpp | 40 +++++++++++++++++++++- 5 files changed, 62 insertions(+), 19 deletions(-) diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp index 2b831ab..dd283c4 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp @@ -7,26 +7,26 @@ namespace { const Params params[] = { - std::tuple { CommonTestUtils::DEVICE_CPU, { { CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) } } }, - std::tuple { CommonTestUtils::DEVICE_HETERO, { { "TARGET_FALLBACK", "CPU" } } }, - std::tuple { CommonTestUtils::DEVICE_MULTI, { { MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , "CPU" } } } + std::tuple{ CommonTestUtils::DEVICE_CPU, {{ CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}}, + std::tuple{ CommonTestUtils::DEVICE_HETERO, {{ "TARGET_FALLBACK", CommonTestUtils::DEVICE_CPU }}}, + std::tuple{ CommonTestUtils::DEVICE_MULTI, {{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU }}}, }; const Params paramsStreams[] = { - std::tuple { "CPU", { { CONFIG_KEY(CPU_THROUGHPUT_STREAMS), CONFIG_VALUE(CPU_THROUGHPUT_AUTO) } } } + std::tuple{ CommonTestUtils::DEVICE_CPU, {{ CONFIG_KEY(CPU_THROUGHPUT_STREAMS), CONFIG_VALUE(CPU_THROUGHPUT_AUTO) }}}, }; - - } // namespace -INSTANTIATE_TEST_CASE_P(CPU, CoreThreadingTests, testing::ValuesIn(params)); +INSTANTIATE_TEST_CASE_P(CPU, CoreThreadingTests, testing::ValuesIn(params), CoreThreadingTests::getTestCaseName); INSTANTIATE_TEST_CASE_P(CPU, CoreThreadingTestsWithIterations, testing::Combine(testing::ValuesIn(params), testing::Values(4), - testing::Values(50))); + testing::Values(50)), + CoreThreadingTestsWithIterations::getTestCaseName); INSTANTIATE_TEST_CASE_P(CPU_Streams, CoreThreadingTestsWithIterations, testing::Combine(testing::ValuesIn(paramsStreams), testing::Values(4), - testing::Values(10))); + testing::Values(10)), + CoreThreadingTestsWithIterations::getTestCaseName); diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp index 4bdd219..ad59299 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp @@ -33,5 +33,8 @@ std::vector disabledTestPatterns() { R"(.*Reduce.*axes=\(0\.3\)_type=Prod.*)", // TODO: Issue 34055 R"(.*RangeLayerTest.*)", +#if (defined(_WIN32) || defined(_WIN64)) + R"(.*(CoreThreadingTestsWithIterations).*(smoke_LoadNetworkAccuracy).*(targetDevice=HETERO).*)", +#endif }; } \ No newline at end of file diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/behavior/core_threading_tests.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/behavior/core_threading_tests.cpp index 69748a0..2f9d708 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/behavior/core_threading_tests.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/behavior/core_threading_tests.cpp @@ -11,8 +11,8 @@ using namespace InferenceEngine::gpu; namespace { Params params[] = { - std::tuple { CommonTestUtils::DEVICE_GPU, { { CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) } } }, - std::tuple { CommonTestUtils::DEVICE_GPU, { { CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(NO) } } }, + std::tuple{ CommonTestUtils::DEVICE_GPU, { { CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}}, + std::tuple{ CommonTestUtils::DEVICE_GPU, { { CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(NO) }}}, }; } // namespace @@ -47,9 +47,10 @@ TEST_P(CoreThreadingTestsWithIterations, smoke_LoadNetwork_RemoteContext) { }, numIterations, numThreads); } -INSTANTIATE_TEST_CASE_P(GPU, CoreThreadingTests, testing::ValuesIn(params)); +INSTANTIATE_TEST_CASE_P(GPU, CoreThreadingTests, testing::ValuesIn(params), CoreThreadingTests::getTestCaseName); INSTANTIATE_TEST_CASE_P(GPU, CoreThreadingTestsWithIterations, testing::Combine(testing::ValuesIn(params), testing::Values(4), - testing::Values(20))); + testing::Values(20)), + CoreThreadingTestsWithIterations::getTestCaseName); diff --git a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/behavior/core_threading_tests.cpp b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/behavior/core_threading_tests.cpp index fd694f5..579146c 100644 --- a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/behavior/core_threading_tests.cpp +++ b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/behavior/core_threading_tests.cpp @@ -7,16 +7,17 @@ namespace { Params params[] = { - std::tuple { "MYRIAD", { { CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) } } }, - std::tuple { "HETERO", { { "TARGET_FALLBACK", "MYRIAD" } } }, - std::tuple { "MULTI", { { MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , "MYRIAD" } } } + std::tuple{ CommonTestUtils::DEVICE_MYRIAD, {{ CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}}, + std::tuple{ CommonTestUtils::DEVICE_HETERO, {{ "TARGET_FALLBACK", CommonTestUtils::DEVICE_MYRIAD }}}, + std::tuple{ CommonTestUtils::DEVICE_MULTI, {{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES), CommonTestUtils::DEVICE_MYRIAD }}}, }; } // namespace -INSTANTIATE_TEST_CASE_P(MYRIAD, CoreThreadingTests, testing::ValuesIn(params)); +INSTANTIATE_TEST_CASE_P(MYRIAD, CoreThreadingTests, testing::ValuesIn(params), CoreThreadingTests::getTestCaseName); INSTANTIATE_TEST_CASE_P(DISABLED_MYRIAD, CoreThreadingTestsWithIterations, testing::Combine(testing::ValuesIn(params), testing::Values(2), - testing::Values(2))); + testing::Values(2)), + CoreThreadingTestsWithIterations::getTestCaseName); diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/core_threading_tests.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/core_threading_tests.hpp index 063eba8..035dd59 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/core_threading_tests.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/core_threading_tests.hpp @@ -24,6 +24,7 @@ #include #include #include +#include using Device = std::string; using Config = std::map; @@ -82,8 +83,24 @@ class CoreThreadingTests : public CoreThreadingTestsBase, public ::testing::TestWithParam { public: void SetUp() override { + SKIP_IF_CURRENT_TEST_IS_DISABLED() std::tie(deviceName, config) = GetParam(); } + + static std::string getTestCaseName(testing::TestParamInfo obj) { + unsigned int numThreads, numIterations; + std::string deviceName; + Config config; + std::tie(deviceName, config) = obj.param; + char separator('_'); + std::ostringstream result; + result << "targetDevice=" << deviceName << separator; + result << "config="; + for (auto& confItem : config) { + result << confItem.first << ":" << confItem.second << separator; + } + return result.str(); + } }; // tested function: GetVersions, UnregisterPlugin @@ -159,16 +176,37 @@ TEST_P(CoreThreadingTests, smoke_QueryNetwork) { using Threads = unsigned int; using Iterations = unsigned int; +using CoreThreadingParams = std::tuple; -class CoreThreadingTestsWithIterations : public ::testing::TestWithParam >, +class CoreThreadingTestsWithIterations : public ::testing::TestWithParam, public CoreThreadingTestsBase { public: void SetUp() override { + SKIP_IF_CURRENT_TEST_IS_DISABLED() std::tie(deviceName, config) = std::get<0>(GetParam()); numThreads = std::get<1>(GetParam()); numIterations = std::get<2>(GetParam()); } + static std::string getTestCaseName(testing::TestParamInfo> obj) { + unsigned int numThreads, numIterations; + std::string deviceName; + Config config; + std::tie(deviceName, config) = std::get<0>(obj.param); + numThreads = std::get<1>(obj.param); + numIterations = std::get<2>(obj.param); + char separator('_'); + std::ostringstream result; + result << "targetDevice=" << deviceName << separator; + result << "config="; + for (auto& confItem : config) { + result << confItem.first << ":" << confItem.second << separator; + } + result << "numThreads=" << numThreads << separator; + result << "numIter=" << numIterations; + return result.str(); + } + unsigned int numIterations; unsigned int numThreads; }; -- 2.7.4