[IE TESTS] move BehaviorTestPlugin to the new IE tests infra & small refactoring for Behavior tests (#784)

* [ci-skip][IE TESTS] move beh_test_plugin

* [ci-skip][IE TESTS] move BehaviorHolderTest

* [ci-skip][IE TESTS] fix GNA layout test

* [ci-skip][IE TESTS] fix cmake

* [ci-skip][IE TESTS] fix lib in IEBehaviorTest

* [ci-skip][IE TESTS] separate layout and cpp_wrapers test and fix namespace

* [ci-skip][IE TESTS] fix holders test

* [ci-skip][IE TESTS] fix namespace

* [ci-skip][IE TESTS] fix codestyle

* [ci-skip][IE TESTS] fix test_plugin

* [ci-skip][IE TESTS] fix test_plugin v2

* [ci-skip][IE TESTS] disabled gpu instance for test_plugin

* [ci-skip][IE TESTS] fix
This commit is contained in:
Anton Zaytsev 2020-06-23 21:43:13 +03:00 committed by GitHub
parent 11d3bd1cb3
commit 34de464027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
145 changed files with 1607 additions and 3517 deletions

View File

@ -27,9 +27,6 @@ if(ENABLE_TESTS)
add_subdirectory(tests/functional)
endif()
if(ENABLE_BEH_TESTS)
add_subdirectory(tests_deprecated/behavior)
endif()
endif()
# [cmake:main]

View File

@ -6,8 +6,8 @@
#include "behavior/config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16

View File

@ -0,0 +1,27 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/cpp_holders.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::vector<int >> orders = {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0, 1, 2},
{0, 2, 1},
{1, 0, 2},
{1, 2, 0},
{2, 0, 1},
{2, 1, 0}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTest,
::testing::Combine(
::testing::Values("TEMPLATE"),
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
} // namespace

View File

@ -6,6 +6,7 @@
#include "behavior/exec_graph_info.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -5,6 +5,8 @@
#include <vector>
#include "behavior/infer_request.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_callback.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_input.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {

View File

@ -6,8 +6,8 @@
#include "behavior/infer_request_output.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16

View File

@ -0,0 +1,36 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/layout.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<InferenceEngine::Layout> Layout = {
InferenceEngine::Layout::NCHW,
InferenceEngine::Layout::CHW,
InferenceEngine::Layout::NC,
InferenceEngine::Layout::C
};
const std::vector<std::vector<size_t>> inputShapes = {
{ 1, 3, 16, 16 },
{ 3, 32, 16 },
{ 1, 3 },
{ 3 }
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, LayoutTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values("TEMPLATE"),
::testing::ValuesIn(configs),
::testing::ValuesIn(Layout),
::testing::ValuesIn(inputShapes)),
LayoutTest::getTestCaseName);
} // namespace

View File

@ -6,6 +6,7 @@
#include "behavior/set_preprocess.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -0,0 +1,39 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/test_plugin.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16
};
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values("TEMPLATE"),
::testing::ValuesIn(configs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values("TEMPLATE"),
::testing::ValuesIn(configs)),
BehaviorTestInput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values("TEMPLATE"),
::testing::ValuesIn(configs)),
BehaviorTestOutput::getTestCaseName);
} // namespace

View File

@ -0,0 +1,20 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/version.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values("TEMPLATE"),
::testing::ValuesIn(configs)),
VersionTest::getTestCaseName);
} // namespace

View File

@ -1,33 +0,0 @@
# Copyright (C) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
disable_deprecated_warnings()
set(TARGET_NAME TemplateBehaviorTests)
file(GLOB_RECURSE TEST_INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
file(GLOB_RECURSE TEST_SRC
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
list(APPEND DEPENDENCIES
templatePlugin)
source_group("src" FILES ${TEST_SRC})
source_group("include" FILES ${TEST_INCLUDE})
add_executable(${TARGET_NAME}
${TEST_SRC}
${TEST_INCLUDE})
target_link_libraries(${TARGET_NAME} PRIVATE IE::IEBehaviorSharedTests)
add_test(NAME ${TARGET_NAME}
COMMAND ${TARGET_NAME})
add_dependencies(${TARGET_NAME} ${DEPENDENCIES})
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})

View File

@ -1,19 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "holders_tests.hpp"
#include <vector>
INSTANTIATE_TEST_CASE_P(ReleaseOrderTests, CPP_HoldersTests, testing::Combine(testing::ValuesIn(std::vector<std::vector<int>> {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0, 1, 2},
{0, 2, 1},
{1, 0, 2},
{1, 2, 0},
{2, 0, 1},
{2, 1, 0},
}), testing::Values("TEMPLATE")));

View File

@ -1,93 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_layers.hpp"
conv_test_params deconv_test_cases[] = {
conv_test_params("TEMPLATE", conv_case),
};
conv_test_params conv_test_cases[] = {
conv_test_params("TEMPLATE", conv_dw_case),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, DeconvolutionLayerTest,
::testing::ValuesIn(deconv_test_cases),
getTestName<conv_test_params>);
INSTANTIATE_TEST_CASE_P(BehaviorTest, ConvolutionLayerTest,
::testing::ValuesIn(conv_test_cases),
getTestName<conv_test_params>);
pool_test_params roi_pool_test_cases[] = {
pool_test_params("TEMPLATE", "FP32", pool_case),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, ROIPoolingLayerTest,
::testing::ValuesIn(roi_pool_test_cases),
getTestName<pool_test_params>);
activ_test_params activ_test_cases[] = {
activ_test_params("TEMPLATE", "FP16", activation_case),
};
activ_test_params clamp_test_cases[] = {
activ_test_params("TEMPLATE", "FP16", clamp_case),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, ActivationLayerTest,
::testing::ValuesIn(activ_test_cases),
getTestName<activ_test_params>);
INSTANTIATE_TEST_CASE_P(BehaviorTest, ReLULayerTest,
::testing::Values(activ_test_params("TEMPLATE", "FP32", activation_case)),
getTestName<activ_test_params>);
INSTANTIATE_TEST_CASE_P(BehaviorTest, ClampLayerTest,
::testing::ValuesIn(clamp_test_cases),
getTestName<activ_test_params>);
norm_test_params norm_test_cases[] = {
norm_test_params("TEMPLATE", "FP32", norm_case),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, NormalizeLayerTest,
::testing::ValuesIn(norm_test_cases),
getTestName<norm_test_params>);
scale_test_params scale_test_cases[] = {
scale_test_params("TEMPLATE", "FP32", scale_case),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, ScalingLayerTest,
::testing::ValuesIn(scale_test_cases),
getTestName<scale_test_params>);
INSTANTIATE_TEST_CASE_P(BehaviorTest, ShapingLayerTest,
::testing::Values(shaping_test_params("TEMPLATE", "FP32", shape_case)),
getTestName<shaping_test_params>);
INSTANTIATE_TEST_CASE_P(BehaviorTest, ElementWiseLayerTest,
::testing::Values(element_test_params("TEMPLATE", "FP32", shape_case)),
getTestName<element_test_params>);
object_test_params object_test_cases[] = {
object_test_params("TEMPLATE", "FP32", object_case),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, ObjectDetectionLayerTest,
::testing::ValuesIn(object_test_cases),
getTestName<object_test_params>);
memory_test_params memory_test_cases[] = {
memory_test_params("TEMPLATE", "FP32", memory_case),
};
// FIXME
// #if (defined INSTANTIATE_TESTS)
// INSTANTIATE_TEST_CASE_P(BehaviorTest, MemoryLayerTest,
// ::testing::ValuesIn(memory_test_cases),
// getTestName<memory_test_params>);
// #endif

View File

@ -1,36 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_layout.hpp"
layout_test_params power_test_cases[] = {
layout_test_params("TEMPLATE", "FP16", Layout::NCHW, power_params({ { 1, 3, 16, 16 } }, 1, 2, 2)),
};
layout_test_params conv_test_cases_1[] = {
layout_test_params("TEMPLATE", "FP16", Layout::NCHW, power_params({ { 1, 3, 16, 16 } }, 1, 2, 2)),
};
layout_test_params power_neg_test_cases[] = {
// Graph Error Description: Error: Tensor size should not be 0.
layout_test_params("TEMPLATE", "FP16", Layout::NC, power_params({ { 1, 3 } }, 1, 2, 2)),
layout_test_params("TEMPLATE", "FP16", Layout::CHW, power_params({ { 3, 32, 16 } }, 1, 2, 2)),
};
layout_test_params conv_neg_test_cases[] = {
// LoadNetwork hangs if Network has 1 dims format: CVS-8508
layout_test_params("TEMPLATE", "FP16", Layout::C, power_params({ { 3 } }, 1, 2, 2)),
layout_test_params("TEMPLATE", "FP16", Layout::NC, power_params({ { 1, 3 } }, 1, 2, 2)),
layout_test_params("TEMPLATE", "FP16", Layout::CHW, power_params({ { 3, 32, 16 } }, 1, 2, 2)),
};
INSTANTIATE_TEST_CASE_P(BehaviorTest, LayoutTestCanLoadPower,
::testing::ValuesIn(power_test_cases), getTestName);
INSTANTIATE_TEST_CASE_P(BehaviorTest, LayoutTestCanLoadConv,
::testing::ValuesIn(conv_test_cases_1), getTestName);
INSTANTIATE_TEST_CASE_P(BehaviorTest, LayoutTestCanNotLoadPower,
::testing::ValuesIn(power_neg_test_cases), getTestName);
INSTANTIATE_TEST_CASE_P(BehaviorTest, LayoutTestCanNotLoadConv,
::testing::ValuesIn(conv_neg_test_cases), getTestName);

View File

@ -1,14 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_unsupported.hpp"
#include "template_test_data.hpp"
// INSTANTIATE_TEST_CASE_P(BehaviorTest, BehaviorPluginTestAllUnsupported, ValuesIn(allUnSupportedValues),
// getTestCaseName);
INSTANTIATE_TEST_CASE_P(BehaviorTest, BehaviorPluginTestTypeUnsupported, ValuesIn(typeUnSupportedValues),
getTestCaseName);
INSTANTIATE_TEST_CASE_P(BehaviorTest, BehaviorPluginTestBatchUnsupported, ValuesIn(batchUnSupportedValues),
getTestCaseName);

View File

@ -1,8 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_version.hpp"
#include "template_test_data.hpp"
INSTANTIATE_TEST_CASE_P(BehaviorTest, BehaviorPluginTestVersion, ValuesIn(add_element_into_array(supportedValues, BEH_HETERO)), getTestCaseName);

View File

@ -1,12 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin.h"
#include "behavior_test_plugins.hpp"
#include "template_test_data.hpp"
INSTANTIATE_TEST_CASE_P(BehaviorTest, BehaviorPluginTestInput, ValuesIn(allInputSupportedValues),
getTestCaseName);
INSTANTIATE_TEST_CASE_P(BehaviorTest, BehaviorPluginTestOutput, ValuesIn(allOutputSupportedValues),
getOutputTestCaseName);

View File

@ -1,71 +0,0 @@
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vector>
#include "behavior_test_plugin.h"
// correct params
#define BEH_HETERO BehTestParams("HETERO", \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP32.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP32.weights_blob, \
Precision::FP32)
#define BEH_TEMPLATE BehTestParams("TEMPLATE", \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP16.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP16.weights_blob, \
Precision::FP32)
// all parameters are unsupported - reversed
#define BEH_US_ALL_TEMPLATE BehTestParams("TEMPLATE", \
FuncTestUtils::TestModel::convReluNormPoolFcModelQ78.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelQ78.weights_blob, \
Precision::Q78)
const BehTestParams supportedValues[] = {
BEH_TEMPLATE,
};
const BehTestParams requestsSupportedValues[] = {
BEH_TEMPLATE,
};
const BehTestParams allInputSupportedValues[] = {
BEH_TEMPLATE,
BEH_TEMPLATE.withIn(Precision::FP16),
BEH_TEMPLATE.withIn(Precision::U8),
BEH_TEMPLATE.withIn(Precision::I16),
};
const BehTestParams allOutputSupportedValues[] = {
BEH_TEMPLATE,
BEH_TEMPLATE.withOut(Precision::FP16),
};
const BehTestParams typeUnSupportedValues[] = {
BEH_TEMPLATE.withIn(Precision::Q78),
BEH_TEMPLATE.withIn(Precision::U16),
BEH_TEMPLATE.withIn(Precision::I8),
BEH_TEMPLATE.withIn(Precision::I32),
};
const BehTestParams batchUnSupportedValues[] = {
BEH_TEMPLATE.withBatchSize(0),
};
const BehTestParams allUnSupportedValues[] = {
BEH_US_ALL_TEMPLATE,
};
const std::vector<BehTestParams> withCorrectConfValuesNetworkOnly = {
BEH_TEMPLATE.withConfig({ { KEY_DEVICE_ID, "0" } }),
};
const BehTestParams withIncorrectConfValues[] = {
BEH_TEMPLATE.withConfig({ { KEY_CPU_BIND_THREAD, "ON" } }),
};
const std::vector<BehTestParams> withCorrectConfValues = {
BEH_TEMPLATE.withConfig({}),
};

View File

@ -1,13 +0,0 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vector>
#include <string>
#include "functional_test_utils/skip_tests_config.hpp"
std::vector<std::string> disabledTestPatterns() {
return {
};
}

View File

@ -80,7 +80,7 @@ TEST_P(TaskExecutorTests, canRunMultipleTasksWithExceptionInside) {
}
}
// TODO: CVS-11695
// TODO: Issue-11695
TEST_P(TaskExecutorTests, canRunMultipleTasksFromMultipleThreads) {
auto taskExecutor = GetParam()();
std::atomic_int sharedVar = {0};
@ -140,7 +140,7 @@ TEST_P(TaskExecutorTests, executorNotReleasedUntilTasksAreDone) {
class ASyncTaskExecutorTests : public TaskExecutorTests {};
// TODO: CVS-11695
// TODO: Issue-11695
TEST_P(ASyncTaskExecutorTests, startAsyncIsNotBlockedByAnotherTask) {
std::mutex mutex_block_emulation;
std::condition_variable cv_block_emulation;

View File

@ -5,6 +5,8 @@
#include "multi-device/multi_device_config.hpp"
#include "behavior/config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -0,0 +1,27 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/cpp_holders.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::vector<int >> orders = {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0, 1, 2},
{0, 2, 1},
{1, 0, 2},
{1, 2, 0},
{2, 0, 1},
{2, 1, 0}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTest,
::testing::Combine(
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
} // namespace

View File

@ -5,6 +5,7 @@
#include "multi-device/multi_device_config.hpp"
#include "behavior/exec_graph_info.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,8 +6,9 @@
#include "behavior/infer_request.hpp"
#include "ie_plugin_config.hpp"
namespace {
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_callback.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,8 +6,8 @@
#include "behavior/infer_request_input.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,

View File

@ -6,8 +6,8 @@
#include "behavior/infer_request_output.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32
};

View File

@ -0,0 +1,36 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/layout.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<InferenceEngine::Layout> Layout = {
InferenceEngine::Layout::NCHW,
InferenceEngine::Layout::CHW,
InferenceEngine::Layout::NC,
InferenceEngine::Layout::C
};
const std::vector<std::vector<size_t>> inputShapes = {
{ 1, 3, 16, 16 },
{ 3, 32, 16 },
{ 1, 3 },
{ 3 }
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, LayoutTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(configs),
::testing::ValuesIn(Layout),
::testing::ValuesIn(inputShapes)),
LayoutTest::getTestCaseName);
} // namespace

View File

@ -0,0 +1,32 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "behavior/perf_counters.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> Multiconfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, PerfCountersTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(configs)),
PerfCountersTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, PerfCountersTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(Multiconfigs)),
PerfCountersTest::getTestCaseName);
} // namespace

View File

@ -7,6 +7,7 @@
#include "behavior/set_preprocess.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -0,0 +1,84 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "behavior/test_plugin.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::U8,
InferenceEngine::Precision::I16,
InferenceEngine::Precision::U16
};
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> MultiConfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU}}
};
const std::vector<std::map<std::string, std::string>> configsInput = {
{},
{{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_AUTO}}
};
const std::vector<std::map<std::string, std::string>> MultiConfigsInputOutput = {
{{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}},
{{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU},
{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_AUTO}}
};
const std::vector<std::map<std::string, std::string>> configsOutput = {
{},
{{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_AUTO}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(configsOutput)),
BehaviorTestOutput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigsInputOutput)),
BehaviorTestOutput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(configs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(configsInput)),
BehaviorTestInput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigsInputOutput)),
BehaviorTestInput::getTestCaseName);
} // namespace

View File

@ -0,0 +1,45 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "hetero/hetero_plugin_config.hpp"
#include "behavior/version.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> Multiconfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU}}
};
const std::vector<std::map<std::string, std::string>> Heteroconfigs = {
{{ HETERO_CONFIG_KEY(DUMP_GRAPH_DOT) , CommonTestUtils::DEVICE_CPU}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(configs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(Multiconfigs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Hetero_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_HETERO),
::testing::ValuesIn(Heteroconfigs)),
VersionTest::getTestCaseName);
} // namespace

View File

@ -12,7 +12,7 @@ namespace {
// Common params
const std::vector<InferenceEngine::Precision> inputPrecisions = {
InferenceEngine::Precision::FP32
// TODO: Fix CVS-27390
// TODO: Fix Issue-27390
// InferenceEngine::Precision::I16,
// InferenceEngine::Precision::U8
};

View File

@ -2,12 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "gna/gna_config.hpp"
#include "behavior/config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16

View File

@ -0,0 +1,27 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/cpp_holders.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::vector<int >> orders = {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0, 1, 2},
{0, 2, 1},
{1, 0, 2},
{1, 2, 0},
{2, 0, 1},
{2, 1, 0}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTest,
::testing::Combine(
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
} // namespace

View File

@ -3,6 +3,8 @@
//
#include "behavior/exec_graph_info.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -3,7 +3,8 @@
//
#include "behavior/infer_request.hpp"
#include "ie_plugin_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_callback.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -5,6 +5,7 @@
#include "gna/gna_config.hpp"
#include "behavior/infer_request_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -4,8 +4,8 @@
#include "behavior/infer_request_input.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::U8,
InferenceEngine::Precision::I16

View File

@ -4,8 +4,8 @@
#include "behavior/infer_request_output.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32
};

View File

@ -0,0 +1,34 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/layout.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{{"GNA_SCALE_FACTOR_0", "1638.4"}, {"GNA_SCALE_FACTOR_1", "1638.4"}}
};
const std::vector<InferenceEngine::Layout> Layout = {
InferenceEngine::Layout::NCHW,
InferenceEngine::Layout::CHW,
InferenceEngine::Layout::NC
};
const std::vector<std::vector<size_t>> inputShapes = {
{ 1, 3, 16, 16 },
{ 3, 32, 16 },
{ 1, 3 }
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, LayoutTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(configs),
::testing::ValuesIn(Layout),
::testing::ValuesIn(inputShapes)),
LayoutTest::getTestCaseName);
} // namespace

View File

@ -0,0 +1,40 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/test_plugin.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::U8,
InferenceEngine::Precision::I16
};
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(configs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(configs)),
BehaviorTestInput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(configs)),
BehaviorTestOutput::getTestCaseName);
} // namespace

View File

@ -0,0 +1,33 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "hetero/hetero_plugin_config.hpp"
#include "behavior/version.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> Heteroconfigs = {
{{ HETERO_CONFIG_KEY(DUMP_GRAPH_DOT) , CommonTestUtils::DEVICE_GNA}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(configs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Hetero_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_HETERO),
::testing::ValuesIn(Heteroconfigs)),
VersionTest::getTestCaseName);
} // namespace

View File

@ -6,6 +6,7 @@
#include "behavior/config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -0,0 +1,27 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/cpp_holders.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::vector<int >> orders = {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0, 1, 2},
{0, 2, 1},
{1, 0, 2},
{1, 2, 0},
{2, 0, 1},
{2, 1, 0}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTest,
::testing::Combine(
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
} // namespace

View File

@ -5,6 +5,7 @@
#include "multi-device/multi_device_config.hpp"
#include "behavior/exec_graph_info.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -7,6 +7,7 @@
#include "behavior/infer_request.hpp"
#include "ie_plugin_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_callback.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,

View File

@ -6,8 +6,8 @@
#include "behavior/infer_request_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_input.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_output.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32

View File

@ -0,0 +1,32 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/layout.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<InferenceEngine::Layout> Layout = {
InferenceEngine::Layout::NCHW,
InferenceEngine::Layout::NC,
};
const std::vector<std::vector<size_t>> inputShapes = {
{ 1, 3, 16, 16 },
{ 1, 3 },
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, LayoutTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(configs),
::testing::ValuesIn(Layout),
::testing::ValuesIn(inputShapes)),
LayoutTest::getTestCaseName);
} // namespace

View File

@ -0,0 +1,32 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "behavior/perf_counters.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> Multiconfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_GPU}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, PerfCountersTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(configs)),
PerfCountersTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, PerfCountersTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(Multiconfigs)),
PerfCountersTest::getTestCaseName);
} // namespace

View File

@ -6,6 +6,7 @@
#include <functional_test_utils/behavior_test_utils.hpp>
#include "behavior/set_preprocess.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
using PreprocessBehTest = BehaviorTestsUtils::BehaviorTestsBasic;

View File

@ -0,0 +1,85 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "behavior/test_plugin.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::U8,
InferenceEngine::Precision::I16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::FP16
};
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> MultiConfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_GPU}}
};
const std::vector<std::map<std::string, std::string>> configsInput = {
{},
{{InferenceEngine::PluginConfigParams::KEY_GPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::GPU_THROUGHPUT_AUTO}}
};
const std::vector<std::map<std::string, std::string>> MultiConfigsInputOutput = {
{{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_GPU}},
{{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_GPU},
{InferenceEngine::PluginConfigParams::KEY_GPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::GPU_THROUGHPUT_AUTO}}
};
const std::vector<std::map<std::string, std::string>> configsOutput = {
{},
{{InferenceEngine::PluginConfigParams::KEY_GPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::GPU_THROUGHPUT_AUTO}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(configsOutput)),
BehaviorTestOutput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigsInputOutput)),
BehaviorTestOutput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(configs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(configsInput)),
BehaviorTestInput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigsInputOutput)),
BehaviorTestInput::getTestCaseName);
} // namespace

View File

@ -0,0 +1,45 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "hetero/hetero_plugin_config.hpp"
#include "behavior/version.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> Multiconfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_GPU}}
};
const std::vector<std::map<std::string, std::string>> Heteroconfigs = {
{{ HETERO_CONFIG_KEY(DUMP_GRAPH_DOT) , CommonTestUtils::DEVICE_GPU}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(configs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(Multiconfigs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Hetero_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_HETERO),
::testing::ValuesIn(Heteroconfigs)),
VersionTest::getTestCaseName);
} // namespace

View File

@ -12,5 +12,7 @@ std::vector<std::string> disabledTestPatterns() {
// cldnn treats 1d constant as [1, f, 1, 1] tensor instead of [b, 1, 1, 1] which leads to fails of these tests
R"(.*(EltwiseLayerTest).*IS=\(.*\..*\..*\..*\..*\).*secondaryInputType=CONSTANT.*opType=SCALAR.*)",
R"(.*(EltwiseLayerTest).*IS=\(.*\).*secondaryInputType=CONSTANT.*)",
// Issues - 34059
".*BehaviorTests\\.pluginDoesNotChangeOriginalNetwork.*"
};
}

View File

@ -6,8 +6,8 @@
#include "vpu/vpu_plugin_config.hpp"
#include "behavior/config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16

View File

@ -0,0 +1,27 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/cpp_holders.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::vector<int >> orders = {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0, 1, 2},
{0, 2, 1},
{1, 0, 2},
{1, 2, 0},
{2, 0, 1},
{2, 1, 0}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTest,
::testing::Combine(
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
} // namespace

View File

@ -4,6 +4,7 @@
#include "behavior/exec_graph_info.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16

View File

@ -6,6 +6,8 @@
#include "behavior/infer_request.hpp"
#include "ie_plugin_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_callback.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16

View File

@ -6,6 +6,7 @@
#include "vpu/vpu_plugin_config.hpp"
#include "behavior/infer_request_config.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_input.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16,

View File

@ -6,6 +6,7 @@
#include "behavior/infer_request_output.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16,

View File

@ -0,0 +1,36 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/layout.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<InferenceEngine::Layout> Layout = {
InferenceEngine::Layout::NCHW,
InferenceEngine::Layout::CHW,
InferenceEngine::Layout::NC,
InferenceEngine::Layout::C
};
const std::vector<std::vector<size_t>> inputShapes = {
{ 1, 3, 16, 16 },
{ 3, 32, 16 },
{ 1, 3 },
{ 3 }
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, LayoutTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP16),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::ValuesIn(configs),
::testing::ValuesIn(Layout),
::testing::ValuesIn(inputShapes)),
LayoutTest::getTestCaseName);
} // namespace

View File

@ -6,6 +6,7 @@
#include <functional_test_utils/behavior_test_utils.hpp>
#include "behavior/set_preprocess.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
using PreprocessBehTest = BehaviorTestsUtils::BehaviorTestsBasic;
const std::vector<InferenceEngine::Precision> netPrecisions = {

View File

@ -0,0 +1,76 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "behavior/test_plugin.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::U8,
InferenceEngine::Precision::FP16
};
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> MultiConfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_MYRIAD}}
};
const std::vector<std::map<std::string, std::string>> MultiConfigsInputOutput = {
{{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_MYRIAD}}
};
const std::vector<InferenceEngine::Precision> netPrecision = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecision),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::ValuesIn(configs)),
BehaviorTestOutput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTestOutput,
::testing::Combine(
::testing::ValuesIn(netPrecision),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigsInputOutput)),
BehaviorTestOutput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::ValuesIn(configs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTests,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigs)),
BehaviorTests::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::ValuesIn(configs)),
BehaviorTestInput::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, BehaviorTestInput,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(MultiConfigsInputOutput)),
BehaviorTestInput::getTestCaseName);
} // namespace

View File

@ -0,0 +1,45 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "multi-device/multi_device_config.hpp"
#include "hetero/hetero_plugin_config.hpp"
#include "behavior/version.hpp"
using namespace BehaviorTestsDefinitions;
namespace {
const std::vector<std::map<std::string, std::string>> configs = {
{}
};
const std::vector<std::map<std::string, std::string>> Multiconfigs = {
{{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_MYRIAD}}
};
const std::vector<std::map<std::string, std::string>> Heteroconfigs = {
{{ HETERO_CONFIG_KEY(DUMP_GRAPH_DOT) , CommonTestUtils::DEVICE_MYRIAD}}
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::ValuesIn(configs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_MULTI),
::testing::ValuesIn(Multiconfigs)),
VersionTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Hetero_BehaviorTests, VersionTest,
::testing::Combine(
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_HETERO),
::testing::ValuesIn(Heteroconfigs)),
VersionTest::getTestCaseName);
} // namespace

View File

@ -28,141 +28,113 @@
#include "ngraph_functions/pass/convert_prc.hpp"
#include "ngraph_functions/subgraph_builders.hpp"
using CorrectConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
// Setting empty config doesn't throw
TEST_P(CorrectConfigTests, SetEmptyConfig) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
std::map<std::string, std::string> config;
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
}
// Setting correct config doesn't throw
TEST_P(CorrectConfigTests, SetCorrectConfig) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
ASSERT_NO_THROW(ie->SetConfig(configuration, targetDevice));
}
using IncorrectConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(IncorrectConfigTests, SetConfigWithIncorrectKey) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
namespace BehaviorTestsDefinitions {
using CorrectConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
// Setting empty config doesn't throw
TEST_P(CorrectConfigTests, SetEmptyConfig) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
std::map<std::string, std::string> config;
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
ASSERT_THROW(ie->SetConfig(configuration, targetDevice),
InferenceEngine::details::InferenceEngineException);
} else {
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
}
// Setting correct config doesn't throw
TEST_P(CorrectConfigTests, SetCorrectConfig) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
ASSERT_NO_THROW(ie->SetConfig(configuration, targetDevice));
}
}
TEST_P(IncorrectConfigTests, canNotLoadNetworkWithIncorrectConfig) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
ASSERT_THROW(auto execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration),
InferenceEngine::details::InferenceEngineException);
}
using IncorrectConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
using IncorrectConfigAPITests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(IncorrectConfigAPITests, SetConfigWithNoExistingKey) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
if (targetDevice.find(CommonTestUtils::DEVICE_GNA) != std::string::npos) {
ASSERT_THROW(ie->SetConfig(configuration, targetDevice), InferenceEngine::NotFound);
} else {
try {
ie->SetConfig(configuration, targetDevice);
} catch (InferenceEngine::details::InferenceEngineException ex) {}
TEST_P(IncorrectConfigTests, SetConfigWithIncorrectKey) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
ASSERT_THROW(ie->SetConfig(configuration, targetDevice),
InferenceEngine::details::InferenceEngineException);
} else {
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
ASSERT_NO_THROW(ie->SetConfig(configuration, targetDevice));
}
}
}
using CorrectConfigAPITests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(CorrectConfigAPITests, canSetExclusiveAsyncRequests) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
// Load config
std::map<std::string, std::string> config = {{CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(YES)}};
config.insert(configuration.begin(), configuration.end());
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
TEST_P(IncorrectConfigTests, canNotLoadNetworkWithIncorrectConfig) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
ASSERT_THROW(auto execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration),
InferenceEngine::details::InferenceEngineException);
}
// Load CNNNetwork to target plugins
auto execNet = ie->LoadNetwork(cnnNet, targetDevice, config);
execNet.CreateInferRequest();
if ((targetDevice == CommonTestUtils::DEVICE_HDDL) || (targetDevice == CommonTestUtils::DEVICE_GNA)) {
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
} else if ((targetDevice == CommonTestUtils::DEVICE_FPGA) ||
(targetDevice == CommonTestUtils::DEVICE_KEEMBAY) || (targetDevice == CommonTestUtils::DEVICE_MYRIAD)) {
ASSERT_EQ(2u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
} else if (targetDevice == CommonTestUtils::DEVICE_MULTI) {
} else {
ASSERT_EQ(1u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
using IncorrectConfigAPITests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(IncorrectConfigAPITests, SetConfigWithNoExistingKey) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
if (targetDevice.find(CommonTestUtils::DEVICE_GNA) != std::string::npos) {
ASSERT_THROW(ie->SetConfig(configuration, targetDevice), InferenceEngine::NotFound);
} else {
try {
ie->SetConfig(configuration, targetDevice);
} catch (InferenceEngine::details::InferenceEngineException ex) {}
}
}
}
TEST_P(CorrectConfigAPITests, withoutExclusiveAsyncRequests) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
// Load config
std::map<std::string, std::string> config = {{CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(NO)}};
config.insert(configuration.begin(), configuration.end());
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
using CorrectConfigAPITests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(CorrectConfigAPITests, canSetExclusiveAsyncRequests) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
// Load config
std::map<std::string, std::string> config = {{CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(YES)}};
config.insert(configuration.begin(), configuration.end());
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
}
// Load CNNNetwork to target plugins
auto execNet = ie->LoadNetwork(cnnNet, targetDevice, config);
execNet.CreateInferRequest();
if ((targetDevice == CommonTestUtils::DEVICE_HDDL) || (targetDevice == CommonTestUtils::DEVICE_GNA)) {
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
} else if ((targetDevice == CommonTestUtils::DEVICE_FPGA) ||
(targetDevice == CommonTestUtils::DEVICE_KEEMBAY) ||
(targetDevice == CommonTestUtils::DEVICE_MYRIAD)) {
ASSERT_EQ(2u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
} else if (targetDevice == CommonTestUtils::DEVICE_MULTI) {
} else {
ASSERT_EQ(1u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
}
}
// Load CNNNetwork to target plugins
auto execNet = ie->LoadNetwork(cnnNet, targetDevice, config);
execNet.CreateInferRequest();
if ((targetDevice == CommonTestUtils::DEVICE_FPGA) || (targetDevice == CommonTestUtils::DEVICE_MYRIAD) ||
(targetDevice == CommonTestUtils::DEVICE_KEEMBAY)) {
ASSERT_EQ(1u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
} else if (targetDevice == CommonTestUtils::DEVICE_MULTI) {
} else {
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
}
}
TEST_P(CorrectConfigAPITests, reusableCPUStreamsExecutor) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
{
TEST_P(CorrectConfigAPITests, withoutExclusiveAsyncRequests) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
// Load config
std::map<std::string, std::string> config = {{CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(NO)}};
config.insert(configuration.begin(), configuration.end());
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
}
// Load CNNNetwork to target plugins
@ -170,19 +142,49 @@ TEST_P(CorrectConfigAPITests, reusableCPUStreamsExecutor) {
execNet.CreateInferRequest();
if ((targetDevice == CommonTestUtils::DEVICE_FPGA) || (targetDevice == CommonTestUtils::DEVICE_MYRIAD) ||
(targetDevice == CommonTestUtils::DEVICE_KEEMBAY)) {
(targetDevice == CommonTestUtils::DEVICE_KEEMBAY)) {
ASSERT_EQ(1u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
} else if (targetDevice == CommonTestUtils::DEVICE_MULTI) {
} else {
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_GE(2u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
}
}
if (targetDevice == CommonTestUtils::DEVICE_CPU) {
ASSERT_NE(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
ASSERT_NO_THROW(ie->UnregisterPlugin("CPU"));
TEST_P(CorrectConfigAPITests, reusableCPUStreamsExecutor) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
{
// Load config
std::map<std::string, std::string> config = {{CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(NO)}};
config.insert(configuration.begin(), configuration.end());
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
ASSERT_NO_THROW(ie->SetConfig(config, targetDevice));
}
// Load CNNNetwork to target plugins
auto execNet = ie->LoadNetwork(cnnNet, targetDevice, config);
execNet.CreateInferRequest();
if ((targetDevice == CommonTestUtils::DEVICE_FPGA) || (targetDevice == CommonTestUtils::DEVICE_MYRIAD) ||
(targetDevice == CommonTestUtils::DEVICE_KEEMBAY)) {
ASSERT_EQ(1u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
} else if (targetDevice == CommonTestUtils::DEVICE_MULTI) {
} else {
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_GE(2u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
}
}
if (targetDevice == CommonTestUtils::DEVICE_CPU) {
ASSERT_NE(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
ASSERT_NO_THROW(ie->UnregisterPlugin("CPU"));
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getExecutorsNumber());
ASSERT_EQ(0u, InferenceEngine::ExecutorManager::getInstance()->getIdleCPUStreamsExecutorsNumber());
}
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,43 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <string>
#include <vector>
#include <memory>
#include <tuple>
#include <gtest/gtest.h>
#include <ngraph/function.hpp>
#include <ie_plugin_config.hpp>
#include <ngraph/function.hpp>
#include <common_test_utils/test_constants.hpp>
#include <cpp/ie_cnn_network.h>
#include "gtest/gtest.h"
#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/test_common.hpp"
#include "functional_test_utils/skip_tests_config.hpp"
#include "functional_test_utils/precision_utils.hpp"
#include <ie_core.hpp>
namespace BehaviorTestsDefinitions {
typedef std::tuple<
std::string, // Target device name
std::vector<int>> // Order
HoldersParams;
class HoldersTest : public CommonTestUtils::TestsCommon,
public ::testing::WithParamInterface<HoldersParams> {
public:
static std::string getTestCaseName(testing::TestParamInfo<HoldersParams> obj);
void SetUp() override;
void TearDown() override;
std::string deathTestStyle;
std::vector<int> order;
std::shared_ptr<ngraph::Function> function;
std::string targetDevice;
};
} // namespace BehaviorTestsDefinitions

View File

@ -20,6 +20,7 @@
#include "functional_test_utils/plugin_cache.hpp"
#include "functional_test_utils/blob_utils.hpp"
namespace BehaviorTestsDefinitions {
using ExecGraphTests = BehaviorTestsUtils::BehaviorTestsBasic;
inline std::vector<std::string> separateStrToVec(std::string str, const char sep) {
@ -240,4 +241,5 @@ TEST_P(ExecGraphTests, CheckExecGraphInfoSerialization) {
ASSERT_THROW(ie->LoadNetwork(cnnNet, targetDevice).GetExecGraphInfo(),
InferenceEngine::details::InferenceEngineException);
}
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -24,6 +24,7 @@
#include "functional_test_utils/blob_utils.hpp"
#include "ngraph_functions/subgraph_builders.hpp"
namespace BehaviorTestsDefinitions {
using InferRequestTests = BehaviorTestsUtils::BehaviorTestsBasic;
// Setting empty config to LoadNetwork doesn't throw
@ -621,4 +622,5 @@ TEST_P(InferRequestTests, returnDeviceBusyOnGetPerformanceCountAfterAsyncInfer)
catch (const std::exception &e) {
std::cout << "Exception" << e.what() << std::endl;
}
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -22,6 +22,7 @@
#include "ngraph_functions/subgraph_builders.hpp"
#include "behavior/infer_request_callback.hpp"
namespace BehaviorTestsDefinitions {
using CallbackTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(CallbackTests, canCallSyncAndAsyncWithCompletionCallback) {
@ -294,4 +295,5 @@ TEST_P(CallbackTests, returnGeneralErrorIfCallbackThrowException) {
}
ASSERT_EQ(InferenceEngine::StatusCode::GENERAL_ERROR, waitStatus);
ASSERT_NE(std::string(resp.msg).find("returnGeneralErrorIfCallbackThrowException"), std::string::npos);
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -25,6 +25,7 @@
#include "functional_test_utils/blob_utils.hpp"
#include "ngraph_functions/subgraph_builders.hpp"
namespace BehaviorTestsDefinitions {
using InferConfigTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(InferConfigTests, canSetExclusiveAsyncRequests) {
@ -93,4 +94,5 @@ TEST_P(InferConfigInTests, CanInferWithConfig) {
auto execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration);
auto req = execNet.CreateInferRequest();
ASSERT_NO_THROW(req.Infer());
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -23,6 +23,7 @@
#include "ngraph_functions/subgraph_builders.hpp"
#include "behavior/infer_request_input.hpp"
namespace BehaviorTestsDefinitions {
using InferRequestInputTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(InferRequestInputTests, canSetInputBlobForSyncRequest) {
@ -136,4 +137,5 @@ TEST_P(InferRequestInputTests, canStartAsyncInferWithGetInOut) {
sts = req.Wait(500);
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts);
InferenceEngine::Blob::Ptr outputBlob = req.GetBlob(cnnNet.getOutputsInfo().begin()->first);
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -23,6 +23,7 @@
#include "ngraph_functions/subgraph_builders.hpp"
#include "behavior/infer_request_output.hpp"
namespace BehaviorTestsDefinitions {
using InferRequestOutputTests = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(InferRequestOutputTests, canGetInputBlobForSyncRequest) {
@ -136,4 +137,5 @@ TEST_P(InferRequestOutputTests, canStartAsyncInferWithGetInOut) {
sts = req.Wait(500);
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts);
InferenceEngine::Blob::Ptr outputBlob = req.GetBlob(cnnNet.getOutputsInfo().begin()->first);
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,54 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <typeindex>
#include <string>
#include <vector>
#include <memory>
#include <tuple>
#include <gtest/gtest.h>
#include <ngraph/node.hpp>
#include <ngraph/function.hpp>
#include <ie_plugin_config.hpp>
#include <ngraph/function.hpp>
#include <ngraph_functions/subgraph_builders.hpp>
#include "gtest/gtest.h"
#include "common_test_utils/common_utils.hpp"
#include "common_test_utils/test_common.hpp"
#include "functional_test_utils/skip_tests_config.hpp"
#include "functional_test_utils/plugin_cache.hpp"
#include "functional_test_utils/blob_utils.hpp"
#include "functional_test_utils/precision_utils.hpp"
#include "ngraph_functions/utils/ngraph_helpers.hpp"
#include "ngraph_functions/pass/convert_prc.hpp"
namespace BehaviorTestsDefinitions {
typedef std::tuple<
InferenceEngine::Precision, // Network precision
std::string, // Target device name
std::map<std::string, std::string>, // Target config
InferenceEngine::Layout, // Layout
std::vector<size_t>> // InputShapes
LayoutParams;
class LayoutTest : public CommonTestUtils::TestsCommon,
public ::testing::WithParamInterface<LayoutParams> {
public:
static std::string getTestCaseName(testing::TestParamInfo<LayoutParams> obj);
void SetUp() override;
void TearDown() override;
std::shared_ptr<InferenceEngine::Core> ie = PluginCache::get().ie();
InferenceEngine::Layout layout;
std::vector<size_t> inputShapes;
std::shared_ptr<ngraph::Function> function;
InferenceEngine::Precision netPrecision;
std::string targetDevice;
std::map<std::string, std::string> configuration;
};
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,39 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vector>
#include <ie_core.hpp>
#include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/common_utils.hpp"
#include "functional_test_utils/plugin_cache.hpp"
#include "functional_test_utils/layer_test_utils.hpp"
#include "functional_test_utils/blob_utils.hpp"
#include "ie_preprocess.hpp"
#include "functional_test_utils/behavior_test_utils.hpp"
namespace BehaviorTestsDefinitions {
using PerfCountersTest = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(PerfCountersTest, NotEmptyWhenExecuted) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
std::map<std::string, std::string> config = {{ InferenceEngine::PluginConfigParams::KEY_PERF_COUNT,
InferenceEngine::PluginConfigParams::YES }};
config.insert(configuration.begin(), configuration.end());
// Load CNNNetwork to target plugins
auto execNet = ie->LoadNetwork(cnnNet, targetDevice, config);
// Create InferRequest
InferenceEngine::InferRequest req;
InferenceEngine::ResponseDesc response;
ASSERT_NO_FATAL_FAILURE(req = execNet.CreateInferRequest());
ASSERT_NO_THROW(req.Infer()) << response.msg;
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
perfMap = req.GetPerformanceCounts();
ASSERT_NE(perfMap.size(), 0);
}
} // namespace BehaviorTestsDefinitions

View File

@ -13,6 +13,7 @@
#include "ie_preprocess.hpp"
#include "functional_test_utils/behavior_test_utils.hpp"
namespace BehaviorTestsDefinitions {
using PreprocessTest = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(PreprocessTest, SetPreProcessToInputInfo) {
@ -59,3 +60,4 @@ TEST_P(PreprocessTest, SetPreProcessToInferRequest) {
info->getResizeAlgorithm());
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,160 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <tuple>
#include <vector>
#include <string>
#include <memory>
#include "ie_extension.h"
#include <condition_variable>
#include <ngraph_functions/subgraph_builders.hpp>
#include <functional_test_utils/test_model/test_model.hpp>
#include <fstream>
#include <functional_test_utils/behavior_test_utils.hpp>
#include <common_test_utils/test_assertions.hpp>
#include "functional_test_utils/layer_test_utils.hpp"
#include "ngraph_functions/utils/ngraph_helpers.hpp"
#include "ngraph_functions/builders.hpp"
namespace BehaviorTestsDefinitions {
using BehaviorTests = BehaviorTestsUtils::BehaviorTestsBasic;
bool static compare_two_files_lexicographically(const std::string &name_a, const std::string &name_b) {
std::ifstream a(name_a), b(name_b);
std::string line_a, line_b;
while (std::getline(a, line_a)) {
std::string str_a, str_b;
std::istringstream(line_a) >> str_a;
if (!std::getline(b, line_b))
throw std::logic_error("Second file is shorter than first");
else
std::istringstream(line_b) >> str_b;
if (line_a != line_b) {
std::cout << "Line A: " << line_a << std::endl;
std::cout << "Line B: " << line_b << std::endl;
throw std::logic_error("Files are different");
}
}
if (std::getline(b, line_b))
throw std::logic_error("First file is shorter than second");
else
return true;
}
void setInputNetworkPrecision(InferenceEngine::CNNNetwork &network, InferenceEngine::InputsDataMap &inputs_info,
InferenceEngine::Precision input_precision) {
inputs_info = network.getInputsInfo();
ASSERT_EQ(1u, inputs_info.size());
inputs_info.begin()->second->setPrecision(input_precision);
}
void setOutputNetworkPrecision(InferenceEngine::CNNNetwork &network, InferenceEngine::OutputsDataMap &outputs_info,
InferenceEngine::Precision output_precision) {
outputs_info = network.getOutputsInfo();
ASSERT_EQ(outputs_info.size(), 1u);
outputs_info.begin()->second->setPrecision(output_precision);
}
TEST_P(BehaviorTests, allocateNullBlob) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
InferenceEngine::TensorDesc tdesc = InferenceEngine::TensorDesc(InferenceEngine::Precision::FP32,
InferenceEngine::NCHW);
InferenceEngine::TBlob<float> blob(tdesc);
ASSERT_NO_THROW(blob.allocate());
}
TEST_P(BehaviorTests, canNotLoadNetworkWithoutWeights) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
InferenceEngine::Core core;
auto model = FuncTestUtils::TestModel::convReluNormPoolFcModelFP32;
ASSERT_THROW(core.ReadNetwork(model.model_xml_str, InferenceEngine::Blob::CPtr()),
InferenceEngine::details::InferenceEngineException);
}
TEST_P(BehaviorTests, pluginDoesNotChangeOriginalNetwork) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
const std::string name_a = "a.xml";
const std::string name_b = "b.xml";
auto param = GetParam();
InferenceEngine::CNNNetwork cnnNet(function);
InferenceEngine::CNNNetwork execGraph;
cnnNet.serialize(name_a);
ASSERT_NO_THROW(ie->LoadNetwork(cnnNet, targetDevice, configuration));
cnnNet.serialize(name_b);
compare_two_files_lexicographically(name_a, name_b);
EXPECT_EQ(0, std::remove(name_a.c_str()));
EXPECT_EQ(0, std::remove(name_b.c_str()));
}
using BehaviorTestInput = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(BehaviorTestInput, canSetInputPrecisionForNetwork) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
InferenceEngine::InputsDataMap inputs_info;
InferenceEngine::CNNNetwork cnnNet(function);
setInputNetworkPrecision(cnnNet, inputs_info, netPrecision);
// Input image format I16 is not supported yet.
if (( targetDevice == CommonTestUtils::DEVICE_MYRIAD
|| targetDevice == CommonTestUtils::DEVICE_HDDL
|| targetDevice == CommonTestUtils::DEVICE_KEEMBAY)
&& netPrecision == InferenceEngine::Precision::I16) {
std::string msg;
InferenceEngine::StatusCode sts = InferenceEngine::StatusCode::OK;
try {
ie->LoadNetwork(cnnNet, targetDevice, configuration);
} catch (InferenceEngine::details::InferenceEngineException ex) {
msg = ex.what();
sts = ex.getStatus();
}
ASSERT_EQ(InferenceEngine::StatusCode::GENERAL_ERROR, sts) << msg;
std::string refError = "Input image format I16 is not supported yet.";
ASSERT_EQ(refError, msg);
} else {
ASSERT_NO_THROW(ie->LoadNetwork(cnnNet, targetDevice, configuration));
}
}
using BehaviorTestOutput = BehaviorTestsUtils::BehaviorTestsBasic;
TEST_P(BehaviorTestOutput, canSetOutputPrecisionForNetwork) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
InferenceEngine::OutputsDataMap output_info;
InferenceEngine::CNNNetwork cnnNet(function);
setOutputNetworkPrecision(cnnNet, output_info, netPrecision);
std::string msg;
InferenceEngine::StatusCode sts = InferenceEngine::StatusCode::OK;
try {
InferenceEngine::ExecutableNetwork exeNetwork = ie->LoadNetwork(cnnNet, targetDevice, configuration);
} catch (InferenceEngine::details::InferenceEngineException ex) {
sts = ex.getStatus();
msg = ex.what();
std::cout << "LoadNetwork() threw InferenceEngineException. Status: " << sts << ", message: " << msg << std::endl;
}
if ((netPrecision == InferenceEngine::Precision::I16 || netPrecision == InferenceEngine::Precision::U8)) {
if ((targetDevice == "CPU") || (targetDevice == "GPU")) {
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts);
}
} else {
ASSERT_EQ(InferenceEngine::StatusCode::OK, sts);
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,35 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vector>
#include <ie_core.hpp>
#include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/common_utils.hpp"
#include "functional_test_utils/plugin_cache.hpp"
#include "functional_test_utils/layer_test_utils.hpp"
#include "functional_test_utils/blob_utils.hpp"
#include "ie_preprocess.hpp"
#include "functional_test_utils/behavior_test_utils.hpp"
namespace BehaviorTestsDefinitions {
using VersionTest = BehaviorTestsUtils::BehaviorTestsBasic;
// Load unsupported network type to the Plugin
TEST_P(VersionTest, pluginCurrentVersionIsCorrect) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
std::string refError = "The plugin does not support";
if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos &&
targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) {
std::map<std::string, InferenceEngine::Version> versions = ie->GetVersions(targetDevice);
ASSERT_EQ(versions.size(), 1);
auto version = versions.begin()->second;
ASSERT_EQ(version.apiVersion.major, 2);
ASSERT_EQ(version.apiVersion.minor, 1);
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,74 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph_functions/subgraph_builders.hpp>
#include "behavior/cpp_holders.hpp"
namespace BehaviorTestsDefinitions {
std::string HoldersTest::getTestCaseName(testing::TestParamInfo<HoldersParams> obj) {
std::string targetDevice;
std::vector<int> order;
std::tie(targetDevice, order) = obj.param;
std::ostringstream result;
result << "targetDevice=" << targetDevice << "_";
if (!order.empty()) {
for (auto &Item : order) {
result << "order=" << Item << "_";
}
}
return result.str();
}
void HoldersTest::SetUp() {
std::tie(targetDevice, order) = this->GetParam();
deathTestStyle = ::testing::GTEST_FLAG(death_test_style);
if ((deathTestStyle == "fast" && targetDevice == CommonTestUtils::DEVICE_MYRIAD) ||
targetDevice == CommonTestUtils::DEVICE_GPU) {
// Default death test mode "fast" must be used in single-threaded context only.
// "MyriadBehaviorTests" links "XLink" library that statically initializes "libusb".
// Which in turn creates a thread.
::testing::GTEST_FLAG(death_test_style) = "threadsafe";
}
function = ngraph::builder::subgraph::makeConvPoolRelu();
}
void HoldersTest::TearDown() {
::testing::GTEST_FLAG(death_test_style) = deathTestStyle;
function.reset();
}
#define EXPECT_NO_CRASH(_statement) \
EXPECT_EXIT(_statement; exit(0), testing::ExitedWithCode(0), "")
void release_order_test(std::vector<int> order, const std::string &deviceName,
std::shared_ptr<ngraph::Function> function) {
InferenceEngine::CNNNetwork cnnNet(function);
InferenceEngine::Core core;
auto exe_net = core.LoadNetwork(cnnNet, deviceName);
auto request = exe_net.CreateInferRequest();
auto release = [&](int i) {
switch (i) {
case 0:
core = InferenceEngine::Core{};
break;
case 1:
exe_net = {};
break;
case 2:
request = {};
break;
default:
break;
}
};
for (auto i : order)
release(i);
}
TEST_P(HoldersTest, Orders) {
// Test failed if crash happens
EXPECT_NO_CRASH(release_order_test(order, targetDevice, function));
}
} // namespace BehaviorTestsDefinitions

View File

@ -0,0 +1,93 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior/layout.hpp"
namespace BehaviorTestsDefinitions {
std::string LayoutTest::getTestCaseName(testing::TestParamInfo<LayoutParams> obj) {
InferenceEngine::Precision netPrecision;
std::string targetDevice;
InferenceEngine::Layout layout;
std::vector<size_t> inputShapes;
std::map<std::string, std::string> configuration;
std::tie(netPrecision, targetDevice, configuration, layout, inputShapes) = obj.param;
std::ostringstream result;
result << "netPRC=" << netPrecision.name() << "_";
result << "targetDevice=" << targetDevice << "_";
result << "layout=" << layout << "_";
if (!inputShapes.empty()) {
for (auto &Item : inputShapes) {
result << "inputShapes=" << Item << "_";
}
}
return result.str();
}
void LayoutTest::SetUp() {
std::tie(netPrecision, targetDevice, configuration, layout, inputShapes) = this->GetParam();
function = ngraph::builder::subgraph::make2InputSubtract(inputShapes, netPrecision);
}
void LayoutTest::TearDown() {
if ((targetDevice == CommonTestUtils::DEVICE_GPU) || (!configuration.empty())) {
PluginCache::get().reset();
}
function.reset();
}
inline bool checkLayout(InferenceEngine::Layout layout, std::vector<size_t> &inputShapes) {
bool check = false;
switch (layout) {
case InferenceEngine::Layout::C:
check = 1 == inputShapes.size();
break;
case InferenceEngine::Layout::BLOCKED:
case InferenceEngine::Layout::ANY:
check = true;
break;
case InferenceEngine::Layout::GOIDHW:
check = 6 == inputShapes.size();
break;
case InferenceEngine::Layout::NCDHW:
case InferenceEngine::Layout::NDHWC:
case InferenceEngine::Layout::OIDHW:
case InferenceEngine::Layout::GOIHW:
check = 5 == inputShapes.size();
break;
case InferenceEngine::Layout::OIHW:
case InferenceEngine::Layout::NCHW:
case InferenceEngine::Layout::NHWC:
check = 4 == inputShapes.size();
break;
case InferenceEngine::Layout::CHW:
check = 3 == inputShapes.size();
break;
case InferenceEngine::Layout::CN:
case InferenceEngine::Layout::NC:
case InferenceEngine::Layout::HW:
check = 2 == inputShapes.size();
break;
default:
break;
}
return check;
}
TEST_P(LayoutTest, NetWithLayout) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED();
// Create CNNNetwork from ngrpah::Function
InferenceEngine::CNNNetwork cnnNet(function);
if (checkLayout(layout, inputShapes)) {
ASSERT_NO_THROW(cnnNet.getInputsInfo().begin()->second->setLayout(layout));
} else {
ASSERT_THROW(cnnNet.getInputsInfo().begin()->second->setLayout(layout),
InferenceEngine::details::InferenceEngineException);
}
if (targetDevice != CommonTestUtils::DEVICE_GNA) {
ASSERT_NO_THROW(InferenceEngine::ExecutableNetwork exeNetwork =
ie->LoadNetwork(cnnNet, targetDevice, configuration));
}
}
} // namespace BehaviorTestsDefinitions

View File

@ -104,8 +104,7 @@ static std::shared_ptr<ngraph::Function> makeSplitMultiConvConcat(std::vector<si
return fnPtr;
}
static std::shared_ptr<ngraph::Function>
makeTIwithLSTMcell(InferenceEngine::Precision prc = InferenceEngine::Precision::FP32) {
static std::shared_ptr<ngraph::Function> makeTIwithLSTMcell(InferenceEngine::Precision prc = InferenceEngine::Precision::FP32) {
auto ngPRC = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(prc);
// That which we iterate over
const size_t N = 32; // Batch size
@ -467,4 +466,4 @@ static std::shared_ptr<ngraph::Function> makeConvBias(std::vector<size_t> inputS
}
} // namespace subgraph
} // namespace builder
} // namespace ngraph
} // namespace ngraph

View File

@ -20,4 +20,4 @@ endif()
if (ENABLE_HDDL OR ENABLE_MYRIAD)
add_subdirectory(vpu)
endif()
endif()

View File

@ -0,0 +1,3 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

View File

@ -1,17 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "holders_tests.hpp"
INSTANTIATE_TEST_CASE_P(smoke_ReleaseOrderTests, CPP_HoldersTests, testing::Combine(testing::ValuesIn(std::vector<std::vector<int>> {
// 0 - plugin
// 1 - executable_network
// 2 - infer_request
{0,1,2},
{0,2,1},
{1,0,2},
{1,2,0},
{2,0,1},
{2,1,0},
}), testing::Values(std::string("GPU"))));

View File

@ -1,14 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin.h"
#include "behavior_test_plugins.hpp"
#include "cldnn_test_data.hpp"
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, BehaviorPluginTest, ValuesIn(supportedValues),
getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, BehaviorPluginTestInput, ValuesIn(allInputSupportedValues),
getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, BehaviorPluginTestOutput, ValuesIn(allOutputSupportedValues),
getOutputTestCaseName);

View File

@ -1,16 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_layers.hpp"
memory_test_params memory_test_cases[] = {
memory_test_params("GPU", "FP32", memory_case),
};
// FIXME
//#if (defined INSTANTIATE_TESTS)
//INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, MemoryLayerTest,
// ::testing::ValuesIn(memory_test_cases),
// getTestName<memory_test_params>);
//#endif

View File

@ -1,21 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_layout.hpp"
layout_test_params power_test_cases[] = {
layout_test_params("GPU", "FP32", Layout::NC, power_params({ { 1, 3 } }, 1, 2, 2)),
layout_test_params("GPU", "FP32", Layout::NCHW, power_params({ { 1, 3, 16, 16 } }, 1, 2, 2)),
};
layout_test_params conv_test_cases[] = {
layout_test_params("GPU", "FP32", Layout::NC, power_params({ { 1, 3 } }, 1, 2, 2)),
layout_test_params("GPU", "FP32", Layout::NCHW, power_params({ { 1, 3, 16, 16 } }, 1, 2, 2)),
};
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, LayoutTestCanLoadPower,
::testing::ValuesIn(power_test_cases), getTestName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, LayoutTestCanLoadConv,
::testing::ValuesIn(conv_test_cases), getTestName);

View File

@ -1,14 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_perf_counters.hpp"
#include "cldnn_test_data.hpp"
// Disabled due to a bug on CentOS that leads to segmentation fault of application on exit
// when perf counters are enabled
//INSTANTIATE_TEST_CASE_P(smoke_
// BehaviorTest,
// BehaviorPluginTestPerfCounters,
// ValuesIn(supportedValues),
// getTestCaseName);

View File

@ -1,12 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_unsupported.hpp"
#include "cldnn_test_data.hpp"
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, BehaviorPluginTestAllUnsupported, ValuesIn(allUnSupportedValues),
getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, BehaviorPluginTestTypeUnsupported, ValuesIn(typeUnSupportedValues),
getTestCaseName);

View File

@ -1,8 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin_version.hpp"
#include "cldnn_test_data.hpp"
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTest, BehaviorPluginTestVersion, ValuesIn(add_element_into_array(supportedValues, BEH_HETERO)), getTestCaseName);

View File

@ -1,146 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "behavior_test_plugin.h"
#include <cldnn/cldnn_config.hpp>
// correct params
#define BEH_CLDNN BehTestParams("GPU", \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP32.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP32.weights_blob, \
Precision::FP32)
#define BEH_HETERO BehTestParams("HETERO", \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP32.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP32.weights_blob, \
Precision::FP32)
// for multi-device we are testing the fp16 (as it is supported by all device combos we are considering for testing
// e.g. GPU and VPU, for CPU the network is automatically (internally) converted to fp32.
const std::map<std::string, std::string> multi_device_conf = {{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"}};
#define BEH_MULTI BehTestParams("MULTI", \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP16.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelFP16.weights_blob, \
Precision::FP32, \
multi_device_conf)
// all parameters are unsupported - reversed
#define BEH_US_ALL_CLDNN BehTestParams("GPU", \
FuncTestUtils::TestModel::convReluNormPoolFcModelQ78.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelQ78.weights_blob, \
Precision::Q78)
#define BEH_US_ALL_MULTI BehTestParams("MULTI", \
FuncTestUtils::TestModel::convReluNormPoolFcModelQ78.model_xml_str, \
FuncTestUtils::TestModel::convReluNormPoolFcModelQ78.weights_blob, \
Precision::Q78, \
multi_device_conf)
const BehTestParams supportedValues[] = {
BEH_CLDNN,
BEH_MULTI,
};
const BehTestParams requestsSupportedValues[] = {
BEH_CLDNN,
BEH_MULTI,
};
const BehTestParams allInputSupportedValues[] = {
BEH_CLDNN, BEH_CLDNN.withIn(Precision::FP16), BEH_CLDNN.withIn(Precision::U8), BEH_CLDNN.withIn(Precision::I16),
BEH_CLDNN.withIn(Precision::I32),
BEH_CLDNN.withIn(Precision::U8).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_CLDNN.withIn(Precision::FP16).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_CLDNN.withIn(Precision::I16).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_CLDNN.withIn(Precision::I32).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_MULTI, BEH_MULTI.withIn(Precision::FP16), BEH_MULTI.withIn(Precision::U8), BEH_MULTI.withIn(Precision::I16),
BEH_MULTI.withIn(Precision::I32),
BEH_MULTI.withIn(Precision::U8).withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_MULTI.withIn(Precision::FP16).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO},
{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"}}),
BEH_MULTI.withIn(Precision::I16).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO},
{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"}}),
BEH_MULTI.withIn(Precision::I32).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO},
{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"}}),
};
const BehTestParams allOutputSupportedValues[] = {
BEH_CLDNN, BEH_CLDNN.withOut(Precision::FP16),
BEH_CLDNN.withIn(Precision::FP16).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_MULTI, BEH_MULTI.withOut(Precision::FP16),
BEH_MULTI.withIn(Precision::FP16).withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO},
{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"}}),
};
const BehTestParams typeUnSupportedValues[] = {
BEH_CLDNN.withIn(Precision::Q78), BEH_CLDNN.withIn(Precision::I8),
BEH_MULTI.withIn(Precision::Q78), BEH_MULTI.withIn(Precision::I8),
};
const BehTestParams allUnSupportedValues[] = {
BEH_US_ALL_CLDNN,
BEH_US_ALL_MULTI,
};
const std::vector<BehTestParams> withCorrectConfValues = {
BEH_CLDNN.withConfig({{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_CLDNN.withConfig({{KEY_GPU_THROUGHPUT_STREAMS, "2"}}),
BEH_CLDNN.withConfig({{KEY_PERF_COUNT, NO}}),
/*BEH_CLDNN.withConfig({ { KEY_PERF_COUNT, YES } }),*/
BEH_CLDNN.withConfig({{KEY_DUMP_KERNELS, NO}}),
BEH_CLDNN.withConfig({{KEY_DUMP_KERNELS, YES}}),
BEH_CLDNN.withConfig({{KEY_TUNING_MODE, TUNING_DISABLED}}),
// Too long inference of AlexNet (980 secs)
BEH_CLDNN.withConfig({{KEY_TUNING_MODE, TUNING_CREATE},
{KEY_TUNING_FILE, "tfile"}}),
BEH_CLDNN.withConfig({{KEY_DEVICE_ID, "0"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_GPU_THROUGHPUT_STREAMS, GPU_THROUGHPUT_AUTO}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_GPU_THROUGHPUT_STREAMS, "2"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_PERF_COUNT, NO}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_DUMP_KERNELS, NO}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_DUMP_KERNELS, YES}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_TUNING_MODE, TUNING_DISABLED}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_TUNING_MODE, TUNING_CREATE},
{KEY_TUNING_FILE, "tfile"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_DEVICE_ID, "0"}}),
};
const BehTestParams withIncorrectConfValues[] = {
BEH_CLDNN.withConfig({{KEY_GPU_THROUGHPUT_STREAMS, "OFF"}}),
BEH_CLDNN.withConfig({{KEY_PERF_COUNT, "ON"}}),
BEH_CLDNN.withConfig({{KEY_CONFIG_FILE, "unknown_file"}}),
BEH_CLDNN.withConfig({{KEY_DUMP_KERNELS, "ON"}}),
BEH_CLDNN.withConfig({{KEY_TUNING_MODE, "TUNING_UNKNOWN_MODE"}}),
BEH_CLDNN.withConfig({{KEY_DEVICE_ID, "DEVICE_UNKNOWN"}}),
// FIXME: [IE clDNN] The plugin doesn't throw GENERAL_ERROR if use non-exist tuning file. CVS-8593
//BEH_CLDNN.withConfig({ { KEY_TUNING_MODE, TUNING_USE_EXISTING },
// { KEY_TUNING_FILE, "unknown_file" } }),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_GPU_THROUGHPUT_STREAMS, "OFF"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_PERF_COUNT, "ON"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_CONFIG_FILE, "unknown_file"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_DUMP_KERNELS, "ON"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_TUNING_MODE, "TUNING_UNKNOWN_MODE"}}),
BEH_MULTI.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "GPU"},
{KEY_DEVICE_ID, "DEVICE_UNKNOWN"}})
};
const std::vector<BehTestParams> withCorrectConfValuesNetworkOnly = {
BEH_CLDNN.withConfig({{}}),
};
const BehTestParams withIncorrectConfKeys[] = {
BEH_CLDNN.withIncorrectConfigItem(),
BEH_MULTI.withIncorrectConfigItem(),
};

Some files were not shown because too many files have changed in this diff Show More