From 61ccde700f1d8a587291547d96b1eaa00955b89c Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 21 Jan 2021 15:05:12 +0300 Subject: [PATCH] Refactored VPU tests not to use old interfaces (#3888) * Refactored VPU tests not to use old interfaces * Added except of exceptions * Commented failing part of HDDL tests --- .../shared/include/behavior/infer_request.hpp | 6 +- .../helpers/myriad_load_network_case.cpp | 3 +- .../helpers/myriad_protocol_case.hpp | 4 +- .../vpu/myriad_tests/vpu_protocol_tests.cpp | 14 +- .../include/classification_matcher.hpp | 2 +- .../ie_tests/include/ie_core_adapter.hpp | 21 +- .../ie_tests/src/classification_matcher.cpp | 25 +- .../ie_tests/src/ie_core_adapter.cpp | 32 +- .../ie_tests/src/segmentation_matcher.cpp | 29 +- .../common/layers/myriad_layers_blob_test.cpp | 132 +++--- .../layers/myriad_layers_concat_test.cpp | 34 +- .../layers/myriad_layers_conv_nd_test.hpp | 27 +- .../layers/myriad_layers_convolution1x1.hpp | 67 ++- .../layers/myriad_layers_convolution3x3.hpp | 63 ++- .../layers/myriad_layers_convolution_test.cpp | 45 +- .../layers/myriad_layers_custom_test.hpp | 78 ++-- .../myriad_layers_detection_output_test.cpp | 99 ++--- .../layers/myriad_layers_eltwise_test.cpp | 79 +--- ...myriad_layers_exp_detectionoutput_test.hpp | 405 +++++++++--------- .../common/layers/myriad_layers_lstm_cell.cpp | 34 +- .../common/layers/myriad_layers_mvn_test.cpp | 24 +- .../layers/myriad_layers_pool_nd_test.hpp | 27 +- ...myriad_layers_prior_box_clustered_test.cpp | 31 +- .../layers/myriad_layers_prior_box_test.cpp | 92 ++-- .../layers/myriad_layers_proposal_test.cpp | 34 +- .../myriad_layers_psroipooling_test.hpp | 21 +- .../layers/myriad_layers_reduce_test.hpp | 55 +-- .../common/layers/myriad_layers_relu_test.cpp | 11 +- .../common/layers/myriad_layers_relu_test.hpp | 24 +- .../layers/myriad_layers_reshape_test.cpp | 86 ++-- .../layers/myriad_layers_reshape_test.hpp | 24 +- .../common/layers/myriad_layers_rfcn_test.cpp | 72 +--- .../layers/myriad_layers_roi_align_test.hpp | 30 +- .../layers/myriad_layers_roi_pooling_test.hpp | 21 +- ...ad_layers_scatter_elements_update_test.hpp | 42 +- .../myriad_layers_scatter_update_test.hpp | 42 +- .../layers/myriad_layers_strided_slice_test.h | 25 +- .../common/layers/myriad_layers_topk_test.hpp | 28 +- .../layers/myriad_layers_unsqueeze_test.hpp | 3 - .../vpu/common/myriad_get_output_tests.hpp | 48 +-- .../common/myriad_get_perf_count_tests.cpp | 21 +- .../vpu/common/myriad_hw_extra_tests.hpp | 49 +-- .../vpu/common/myriad_hw_network_tests.hpp | 26 +- .../vpu/common/myriad_hw_tests_base.hpp | 32 +- .../vpu/common/myriad_infer_tests.cpp | 85 ++-- .../vpu/common/myriad_merge_permute_tests.hpp | 3 +- .../graph_transformer/gt_functional_tests.cpp | 7 +- .../vpu/myriad_tests/myriad_configs_tests.cpp | 38 +- .../myriad_multiple_graph_tests.cpp | 7 +- .../vpu/vpu_base/vpu_layers_tests.cpp | 33 +- .../vpu/vpu_base/vpu_layers_tests.hpp | 7 +- 51 files changed, 837 insertions(+), 1410 deletions(-) diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp index c371abf39df7b4..28d03e1f91bc41 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp @@ -37,7 +37,7 @@ TEST_P(InferRequestTests, SetEmptyConfig) { // Create CNNNetwork from ngrpah::Function InferenceEngine::CNNNetwork cnnNet(function); // Load CNNNetwork to target plugins - InferenceEngine::IExecutableNetwork::Ptr execNet; + InferenceEngine::ExecutableNetwork execNet; std::map config {}; if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos && targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) { @@ -55,7 +55,7 @@ TEST_P(InferRequestTests, canLoadCorrectNetworkToGetExecutable) { SKIP_IF_CURRENT_TEST_IS_DISABLED() // Create CNNNetwork from ngrpah::Function InferenceEngine::CNNNetwork cnnNet(function); - InferenceEngine::IExecutableNetwork::Ptr execNet; + InferenceEngine::ExecutableNetwork execNet; ASSERT_NO_THROW(execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration)); } @@ -64,7 +64,7 @@ TEST_P(InferRequestTests, CanCreateTwoExeNetworks) { SKIP_IF_CURRENT_TEST_IS_DISABLED() // Create CNNNetwork from ngrpah::Function InferenceEngine::CNNNetwork cnnNet(function); - InferenceEngine::IExecutableNetwork::Ptr execNet; + InferenceEngine::ExecutableNetwork execNet; for (auto i = 0; i < 2; i++) { ASSERT_NO_THROW(execNet = ie->LoadNetwork(cnnNet, targetDevice, configuration)); ASSERT_NE(nullptr, cnnNet.getFunction()); diff --git a/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_load_network_case.cpp b/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_load_network_case.cpp index 20e8faa7452d08..48f005e132e982 100644 --- a/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_load_network_case.cpp +++ b/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_load_network_case.cpp @@ -21,8 +21,7 @@ void MyriadLoadNetworkTestCase::SetUp() { } void MyriadLoadNetworkTestCase::LoadNetwork() { - ASSERT_NO_THROW(InferenceEngine::IExecutableNetwork::Ptr exe_network = - ie->LoadNetwork(cnnNetwork, "MYRIAD")); + ASSERT_NO_THROW(ie->LoadNetwork(cnnNetwork, "MYRIAD")); } bool MyriadLoadNetworkTestCase::IsDeviceAvailable(std::string device_name) { diff --git a/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_protocol_case.hpp b/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_protocol_case.hpp index df054107779fd0..0be811a6fb5e2e 100644 --- a/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_protocol_case.hpp +++ b/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/helpers/myriad_protocol_case.hpp @@ -21,9 +21,7 @@ class MyriadProtocolTests : public testing::Test, public MyriadDevicesInfo { public: // IE variables - InferenceEngine::IInferRequest::Ptr request; - InferenceEngine::ResponseDesc resp; - StatusCode statusCode = StatusCode::GENERAL_ERROR; + InferenceEngine::InferRequest request; static std::shared_ptr ie; // MVNC variables diff --git a/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/vpu_protocol_tests.cpp b/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/vpu_protocol_tests.cpp index a2c2fb48ba59ce..c8062e64da9400 100644 --- a/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/vpu_protocol_tests.cpp +++ b/inference-engine/tests_deprecated/behavior/vpu/myriad_tests/vpu_protocol_tests.cpp @@ -17,18 +17,13 @@ TEST_P(MyriadProtocolTests, CanInferenceWithProtocol) { std::map config = getConfigForProtocol(protocol); - InferenceEngine::IExecutableNetwork::Ptr exe_network = + InferenceEngine::ExecutableNetwork exe_network = ie->LoadNetwork(network, "MYRIAD", config); - ASSERT_NO_THROW(statusCode = exe_network->CreateInferRequest(request, &resp)); - ASSERT_EQ(statusCode, StatusCode::OK) << resp.msg; - - ASSERT_NO_THROW(statusCode = request->Infer(&resp)); - ASSERT_EQ(statusCode, StatusCode::OK) << resp.msg; + ASSERT_NO_THROW(request = exe_network.CreateInferRequest()); + ASSERT_NO_THROW(request.Infer()); } - - TEST_P(MyriadProtocolTests, NoErrorsMessagesWhenLoadNetworkSuccessful) { if (protocol != NC_USB) { GTEST_SKIP(); @@ -42,11 +37,10 @@ TEST_P(MyriadProtocolTests, NoErrorsMessagesWhenLoadNetworkSuccessful) { std::map config = {{CONFIG_KEY(LOG_LEVEL), CONFIG_VALUE(LOG_WARNING)}}; - InferenceEngine::IExecutableNetwork::Ptr exe_network = + InferenceEngine::ExecutableNetwork exe_network = ie->LoadNetwork(network, "MYRIAD", config); setbuf(stdout, NULL); - std::string content(buff); for (int i = MVLOG_WARN; i < MVLOG_LAST; i++) { auto found = content.find(mvLogHeader[i]); diff --git a/inference-engine/tests_deprecated/functional/ie_tests/include/classification_matcher.hpp b/inference-engine/tests_deprecated/functional/ie_tests/include/classification_matcher.hpp index bc3479b7a43be4..e487ad6aa7f609 100644 --- a/inference-engine/tests_deprecated/functional/ie_tests/include/classification_matcher.hpp +++ b/inference-engine/tests_deprecated/functional/ie_tests/include/classification_matcher.hpp @@ -17,7 +17,7 @@ namespace Regression { namespace Matchers { class ClassificationMatcher : public BaseMatcher { private: size_t checkResultNumber; - std::vector> _executableNetworks; + std::vector _executableNetworks; std::vector > _results; ResponseDesc _resp; InferenceEngine::InputsDataMap _inputsInfo; diff --git a/inference-engine/tests_deprecated/functional/ie_tests/include/ie_core_adapter.hpp b/inference-engine/tests_deprecated/functional/ie_tests/include/ie_core_adapter.hpp index 928c17700f80e2..436a7fe913bc59 100644 --- a/inference-engine/tests_deprecated/functional/ie_tests/include/ie_core_adapter.hpp +++ b/inference-engine/tests_deprecated/functional/ie_tests/include/ie_core_adapter.hpp @@ -14,22 +14,11 @@ class IECoreAdapter { IECoreAdapter( std::shared_ptr ieCore, std::string deviceName); - // ----------------------------------------- - // IInferencePlugin API (deprecated). Begin. - // - InferenceEngine::ICNNNetwork is replaced by InferenceEngine::CNNNetwork - // ----------------------------------------- - - InferenceEngine::StatusCode LoadNetwork( - InferenceEngine::IExecutableNetwork::Ptr& ret, InferenceEngine::CNNNetwork network, - const std::map& config, InferenceEngine::ResponseDesc* resp) noexcept; - - InferenceEngine::StatusCode ImportNetwork( - InferenceEngine::IExecutableNetwork::Ptr& ret, const std::string& modelFileName, - const std::map& config, InferenceEngine::ResponseDesc* resp) noexcept; - - // ----------------------------------------- - // IInferencePlugin API (deprecated). End. - // ----------------------------------------- + InferenceEngine::ExecutableNetwork LoadNetwork(const InferenceEngine::CNNNetwork & network, + const std::map& config = {}); + + InferenceEngine::ExecutableNetwork ImportNetwork(const std::string& modelFileName, + const std::map& config = {}); InferenceEngine::ExecutableNetwork ImportNetwork(std::istream& networkModel, const std::map& config = {}); diff --git a/inference-engine/tests_deprecated/functional/ie_tests/src/classification_matcher.cpp b/inference-engine/tests_deprecated/functional/ie_tests/src/classification_matcher.cpp index b1520661d35072..f15abfa415976a 100644 --- a/inference-engine/tests_deprecated/functional/ie_tests/src/classification_matcher.cpp +++ b/inference-engine/tests_deprecated/functional/ie_tests/src/classification_matcher.cpp @@ -213,18 +213,14 @@ inline void TopResults(unsigned int n, TBlob& input, std::vector& o void ClassificationMatcher::match_n(size_t top, int index) { try { - InferenceEngine::IInferRequest::Ptr inferRequest; - if (_executableNetworks[index]->CreateInferRequest(inferRequest, &_resp) != OK) { - THROW_IE_EXCEPTION << "Can not create infer request: " << _resp.msg; - } + auto inferRequest = _executableNetworks[index].CreateInferRequest(); std::string prevImageName = ""; auto batchSize = config.batchSize; if (config.useDynamicBatching) { batchSize = config.dynBatch; - InferenceEngine::ResponseDesc resp; - inferRequest->SetBatch(batchSize, &resp); + inferRequest.SetBatch(batchSize); } if (config._paths_to_images.size() % batchSize != 0) { @@ -249,25 +245,14 @@ void ClassificationMatcher::match_n(size_t top, int index) { for (int j = 0; j != batchSize; j++) { const auto & imageName = config._paths_to_images[i + j]; - InferenceEngine::Blob::Ptr inputBlob; - if (inferRequest->GetBlob(_inputsInfo.begin()->first.c_str(), inputBlob, &_resp) != OK) { - THROW_IE_EXCEPTION << "Can not get input with name: " << _inputsInfo.begin()->first - << " error message: " << _resp.msg; - } + auto inputBlob = inferRequest.GetBlob(_inputsInfo.begin()->first.c_str()); loadImage(imageName, inputBlob, true, j); } } - StatusCode status = inferRequest->Infer(&_resp); - if (status != OK) { - THROW_IE_EXCEPTION << "Can not do infer: " << _resp.msg; - } + inferRequest.Infer(); - InferenceEngine::Blob::Ptr outputBlobPtr; - if (inferRequest->GetBlob(_outputsInfo.begin()->first.c_str(), outputBlobPtr, &_resp) != OK) { - THROW_IE_EXCEPTION << "Can not get output with name: " << _outputsInfo.begin()->first - << " error message: " << _resp.msg; - } + auto outputBlobPtr = inferRequest.GetBlob(_outputsInfo.begin()->first.c_str()); InferenceEngine::TBlob::Ptr outputFP32; if (outputBlobPtr->getTensorDesc().getPrecision() == InferenceEngine::Precision::FP16) { diff --git a/inference-engine/tests_deprecated/functional/ie_tests/src/ie_core_adapter.cpp b/inference-engine/tests_deprecated/functional/ie_tests/src/ie_core_adapter.cpp index b81d20630f4c5f..5f30a8069a9b04 100644 --- a/inference-engine/tests_deprecated/functional/ie_tests/src/ie_core_adapter.cpp +++ b/inference-engine/tests_deprecated/functional/ie_tests/src/ie_core_adapter.cpp @@ -12,32 +12,16 @@ using IECorePtr = std::shared_ptr; IECoreAdapter::IECoreAdapter(IECorePtr ieCore, std::string deviceName) : m_ieCore(ieCore), m_deviceName(deviceName) {} -StatusCode IECoreAdapter::LoadNetwork( - IExecutableNetwork::Ptr& ret, CNNNetwork network, - const std::map& config, ResponseDesc* resp) noexcept { - - try { - ret = m_ieCore->LoadNetwork(network, m_deviceName, config); - } catch (const std::exception& ex) { - return DescriptionBuffer(GENERAL_ERROR, resp) << ex.what(); - } - - return OK; +ExecutableNetwork IECoreAdapter::LoadNetwork( + const CNNNetwork & network, + const std::map& config) { + return m_ieCore->LoadNetwork(network, m_deviceName, config); } -StatusCode IECoreAdapter::ImportNetwork( - IExecutableNetwork::Ptr& ret, const std::string& modelFileName, - const std::map& config, ResponseDesc* resp) noexcept { - - try { - ret = m_ieCore->ImportNetwork(modelFileName, m_deviceName, config); - } catch (const NetworkNotRead& ie_ex) { - return DescriptionBuffer(NETWORK_NOT_READ, resp) << ie_ex.what(); - } catch (const std::exception& ex) { - return DescriptionBuffer(GENERAL_ERROR, resp) << ex.what(); - } - - return OK; +ExecutableNetwork IECoreAdapter::ImportNetwork( + const std::string& modelFileName, + const std::map& config) { + return m_ieCore->ImportNetwork(modelFileName, m_deviceName, config); } ExecutableNetwork IECoreAdapter::ImportNetwork( diff --git a/inference-engine/tests_deprecated/functional/ie_tests/src/segmentation_matcher.cpp b/inference-engine/tests_deprecated/functional/ie_tests/src/segmentation_matcher.cpp index 2396eb9019d91a..0f671640c677fb 100644 --- a/inference-engine/tests_deprecated/functional/ie_tests/src/segmentation_matcher.cpp +++ b/inference-engine/tests_deprecated/functional/ie_tests/src/segmentation_matcher.cpp @@ -140,33 +140,12 @@ void SegmentationMatcher::match() { executableNetwork = loadedExecutableNetwork; } - InferenceEngine::IInferRequest::Ptr inferRequest; - sts = static_cast(executableNetwork)->CreateInferRequest(inferRequest, &dsc); - if (sts != InferenceEngine::OK) { - THROW_IE_EXCEPTION << "Failed CreateInferRequest with error: " << dsc.msg; - } - - sts = inferRequest->SetBlob(inputs.begin()->first.c_str(), input, &dsc); - if (sts != InferenceEngine::OK) { - THROW_IE_EXCEPTION << "Failed SetBlob with error: " << dsc.msg; - } - - sts = inferRequest->SetBlob(outInfo.begin()->first.c_str(), output, &dsc); - if (sts != InferenceEngine::OK) { - THROW_IE_EXCEPTION << "Failed SetBlob with error: " << dsc.msg; - } + auto inferRequest = executableNetwork.CreateInferRequest(); + inferRequest.SetBlob(inputs.begin()->first.c_str(), input); + inferRequest.SetBlob(outInfo.begin()->first.c_str(), output); // Infer model - sts = inferRequest->Infer(&dsc); - - // Check errors - if (sts == InferenceEngine::GENERAL_ERROR) { - THROW_IE_EXCEPTION << "Scoring failed! Critical error: " << dsc.msg; - } else if (sts == InferenceEngine::NOT_IMPLEMENTED) { - THROW_IE_EXCEPTION << "Scoring failed! Input data is incorrect and not supported!"; - } else if (sts == InferenceEngine::NETWORK_NOT_LOADED) { - THROW_IE_EXCEPTION << "Scoring failed! " << dsc.msg; - } + inferRequest.Infer(); // Convert output data and save it to image outArray = blobToImageOutputArray(output, nullptr, nullptr, &C); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_blob_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_blob_test.cpp index 79699abfe400b0..8c576d7e752132 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_blob_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_blob_test.cpp @@ -43,15 +43,12 @@ TEST_P(myriadBlobTests_smoke, CanGetSameBlobsOnSameIR) { const size_t countBlobsToDump = 3; std::vector filenames(countBlobsToDump); for (int i = 0; i < countBlobsToDump; i++) { - - StatusCode st; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, - { {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue } }, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, + { {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue } })); std::stringstream modelFilenameStream; modelFilenameStream << "spltConvConcat" << i << ".blob"; filenames[i] = modelFilenameStream.str(); - ASSERT_NO_THROW(_exeNetwork->Export(modelFilenameStream.str(), nullptr)); + ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str())); } for (int i = 0; i < filenames.size() - 1; i++) { @@ -74,8 +71,8 @@ using myriadBlobExportTests_smoke = myriadLayersTests_nightly; TEST_F(myriadBlobExportTests_smoke, CanNotDoImportOnNonExistFile) { - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::NETWORK_NOT_READ, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, "I_dont_exist.blob", {}, nullptr)); + ASSERT_THROW(_vpuPluginPtr->ImportNetwork("I_dont_exist.blob"), + InferenceEngine::NetworkNotRead); } TEST_F(myriadBlobExportTests_smoke, CanInferImportedNetworkOnExportedBlob) @@ -83,17 +80,17 @@ TEST_F(myriadBlobExportTests_smoke, CanInferImportedNetworkOnExportedBlob) auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat(); ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr)); - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, { }, &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); std::stringstream modelFilenameStream; modelFilenameStream << "SplitConvConcat" << ".blob"; - ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str())); - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), {}, &_resp)) << _resp.msg; - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(inferRequest, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork importedNetwork; + ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str())); - ASSERT_EQ(StatusCode::OK, inferRequest->Infer(&_resp)) << _resp.msg; + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = importedNetwork.CreateInferRequest()); + ASSERT_NO_THROW(inferRequest.Infer()); } TEST_F(myriadBlobExportTests_smoke, CanGetPerfCountsImportedNetwork) @@ -101,20 +98,20 @@ TEST_F(myriadBlobExportTests_smoke, CanGetPerfCountsImportedNetwork) auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat(); ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr)); - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); std::stringstream modelFilenameStream; modelFilenameStream << "splitConvConcat" << ".blob"; - ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str())); std::map config = { {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)} }; - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), config, &_resp)) << _resp.msg; - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(inferRequest, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork importedNetwork; + ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str(), config)); + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = importedNetwork.CreateInferRequest()); - ASSERT_EQ(StatusCode::OK, inferRequest->Infer(&_resp)) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); std::map perfCounts; - ASSERT_EQ(StatusCode::OK, inferRequest->GetPerformanceCounts(perfCounts, &_resp)) << _resp.msg; + ASSERT_NO_THROW(perfCounts = inferRequest.GetPerformanceCounts()); ASSERT_NE(0, perfCounts.size()); for (const auto &perfInfoElem : perfCounts) { @@ -154,10 +151,10 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetCompileOptionPrintsWar auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat(); ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr)); - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); std::stringstream modelFilenameStream; modelFilenameStream << "splitConvConcat" << ".blob"; - ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str())); std::map config = { {InferenceEngine::MYRIAD_COPY_OPTIMIZATION, CONFIG_VALUE(YES)}, @@ -167,8 +164,8 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetCompileOptionPrintsWar {InferenceEngine::MYRIAD_NUMBER_OF_SHAVES, std::to_string(10)}, {InferenceEngine::MYRIAD_NUMBER_OF_CMX_SLICES, std::to_string(10)} }; - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), config, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork importedNetwork; + ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str(), config)); std::string content = redirectCoutStream.str(); for (auto &&elem : config) { @@ -184,10 +181,10 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetRuntimeOptionDoesNotPr auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat(); ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr)); - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); std::stringstream modelFilenameStream; modelFilenameStream << "splitConvConcat" << ".blob"; - ASSERT_EQ(StatusCode::OK, _exeNetwork->Export(modelFilenameStream.str(), &_resp)) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork.Export(modelFilenameStream.str())); std::map config = { {CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), CONFIG_VALUE(YES)}, {CONFIG_KEY(LOG_LEVEL), CONFIG_VALUE(LOG_INFO)}, @@ -198,8 +195,8 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetRuntimeOptionDoesNotPr config.insert({VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)}); } - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), config, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork importedNetwork; + ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str(), config)); std::string content = redirectCoutStream.str(); for (auto &&elem : config) { @@ -220,62 +217,62 @@ TEST_F(myriadBlobExportAccuracyDifferentCountInAndOutTests_smoke, IsResultOfImpo auto fnPtr = ngraph::builder::subgraph::makeSplitConvConcat(); ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr)); - InferenceEngine::IExecutableNetwork::Ptr originalExeNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(originalExeNetworkPtr, _cnnNetwork, { }, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork originalExeNetwork; + ASSERT_NO_THROW(originalExeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); ConstInputsDataMap originalInputsInfo; - ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->GetInputsInfo(originalInputsInfo, &_resp)) << _resp.msg; + ASSERT_NO_THROW(originalInputsInfo = originalExeNetwork.GetInputsInfo()); - InferenceEngine::IInferRequest::Ptr orignalInferRequest; - ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->CreateInferRequest(orignalInferRequest, &_resp)) << _resp.msg; + InferenceEngine::InferRequest orignalInferRequest; + ASSERT_NO_THROW(orignalInferRequest = originalExeNetwork.CreateInferRequest()); std::vector inputBlobs(originalInputsInfo.size()); auto inputBlobsIt = inputBlobs.begin(); for (const auto &inputInfo : originalInputsInfo) { - ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(inputInfo.first.c_str(), *inputBlobsIt, &_resp)) << _resp.msg; + ASSERT_NO_THROW(*inputBlobsIt = orignalInferRequest.GetBlob(inputInfo.first.c_str())); GenRandomData(*inputBlobsIt); inputBlobsIt++; } - ASSERT_EQ(StatusCode::OK, orignalInferRequest->Infer(&_resp)) << _resp.msg; + ASSERT_NO_THROW(orignalInferRequest.Infer()); ConstOutputsDataMap orignalOutputsInfo; - ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->GetOutputsInfo(orignalOutputsInfo, &_resp)) << _resp.msg; + ASSERT_NO_THROW(orignalOutputsInfo = originalExeNetwork.GetOutputsInfo()); std::vector originalOutputBlobs(orignalOutputsInfo.size()); auto outputBlobsIt = originalOutputBlobs.begin(); for (const auto &outputInfo: orignalOutputsInfo) { - ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(outputInfo.first.c_str(), *outputBlobsIt, &_resp)) << _resp.msg; + ASSERT_NO_THROW(*outputBlobsIt = orignalInferRequest.GetBlob(outputInfo.first.c_str())); outputBlobsIt++; } std::stringstream modelFilenameStream; modelFilenameStream << "exportedModel" << ".blob"; - ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->Export(modelFilenameStream.str(), &_resp)) << _resp.msg; + ASSERT_NO_THROW(originalExeNetwork.Export(modelFilenameStream.str())); - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), {}, &_resp)) << _resp.msg; - InferenceEngine::IInferRequest::Ptr importedInferRequest; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(importedInferRequest, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork importedNetwork; + ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str())); + InferenceEngine::InferRequest importedInferRequest; + ASSERT_NO_THROW(importedInferRequest = importedNetwork.CreateInferRequest()); ConstInputsDataMap importedInputsInfo; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetInputsInfo(importedInputsInfo, &_resp)) << _resp.msg; + ASSERT_NO_THROW(importedInputsInfo = importedNetwork.GetInputsInfo()); inputBlobsIt = inputBlobs.begin(); for (const auto &inputInfo : importedInputsInfo) { - ASSERT_EQ(StatusCode::OK, importedInferRequest->SetBlob(inputInfo.first.c_str(), *inputBlobsIt, &_resp)) << &_resp.msg; + ASSERT_NO_THROW(importedInferRequest.SetBlob(inputInfo.first.c_str(), *inputBlobsIt)); inputBlobsIt++; } - ASSERT_EQ(StatusCode::OK, importedInferRequest->Infer(&_resp)) << _resp.msg; + ASSERT_NO_THROW(importedInferRequest.Infer()); ConstOutputsDataMap importedOutputsInfo; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetOutputsInfo(importedOutputsInfo, &_resp)) << _resp.msg; + ASSERT_NO_THROW(importedOutputsInfo = importedNetwork.GetOutputsInfo()); outputBlobsIt = originalOutputBlobs.begin(); for (const auto &outputInfo : importedOutputsInfo) { Blob::Ptr importedOutputBlobPtr; - ASSERT_EQ(StatusCode::OK, importedInferRequest->GetBlob(outputInfo.first.c_str(), importedOutputBlobPtr, &_resp)) << _resp.msg; + ASSERT_NO_THROW(importedOutputBlobPtr = importedInferRequest.GetBlob(outputInfo.first.c_str())); CompareCommonAbsolute(importedOutputBlobPtr, *outputBlobsIt, 0.f); outputBlobsIt++; @@ -306,46 +303,46 @@ TEST_P(myriadBlobExportAccuracyDifferentPrecisionOfInAndOutTests_smoke, IsResult auto outputInfo = outputsInfo.begin(); ASSERT_NO_THROW(outputInfo->second->setPrecision(outputPrecision)); - InferenceEngine::IExecutableNetwork::Ptr originalExeNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->LoadNetwork(originalExeNetworkPtr, network, { }, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork originalExeNetwork; + ASSERT_NO_THROW(originalExeNetwork = _vpuPluginPtr->LoadNetwork(network)); - InferenceEngine::IInferRequest::Ptr orignalInferRequest; - ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->CreateInferRequest(orignalInferRequest, &_resp)) << _resp.msg; + InferenceEngine::InferRequest orignalInferRequest; + ASSERT_NO_THROW(orignalInferRequest = originalExeNetwork.CreateInferRequest()); Blob::Ptr inputBlobPtr; - ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(inputInfo->first.c_str(), inputBlobPtr, &_resp)) << _resp.msg; + ASSERT_NO_THROW(inputBlobPtr = orignalInferRequest.GetBlob(inputInfo->first.c_str())); GenRandomData(inputBlobPtr); - ASSERT_EQ(StatusCode::OK, orignalInferRequest->Infer(&_resp)) << _resp.msg; + ASSERT_NO_THROW(orignalInferRequest.Infer()); Blob::Ptr outputBlobPtr; - ASSERT_EQ(StatusCode::OK, orignalInferRequest->GetBlob(outputInfo->first.c_str(), outputBlobPtr, &_resp)) << _resp.msg; + ASSERT_NO_THROW(outputBlobPtr = orignalInferRequest.GetBlob(outputInfo->first.c_str())); std::stringstream modelFilenameStream; modelFilenameStream << "exportedModel" << ".blob"; - ASSERT_EQ(StatusCode::OK, originalExeNetworkPtr->Export(modelFilenameStream.str(), &_resp)) << _resp.msg; + ASSERT_NO_THROW(originalExeNetwork.Export(modelFilenameStream.str())); - InferenceEngine::IExecutableNetwork::Ptr importedNetworkPtr; - ASSERT_EQ(StatusCode::OK, _vpuPluginPtr->ImportNetwork(importedNetworkPtr, modelFilenameStream.str(), {}, &_resp)) << _resp.msg; - InferenceEngine::IInferRequest::Ptr importedInferRequest; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->CreateInferRequest(importedInferRequest, &_resp)) << _resp.msg; + InferenceEngine::ExecutableNetwork importedNetwork; + ASSERT_NO_THROW(importedNetwork = _vpuPluginPtr->ImportNetwork(modelFilenameStream.str())); + InferenceEngine::InferRequest importedInferRequest; + ASSERT_NO_THROW(importedInferRequest = importedNetwork.CreateInferRequest()); ConstInputsDataMap importedInputsInfo; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetInputsInfo(importedInputsInfo, &_resp)) << _resp.msg; + ASSERT_NO_THROW(importedInputsInfo = importedNetwork.GetInputsInfo()); ASSERT_EQ(importedInputsInfo.size(), 1); auto importedInputInfo = importedInputsInfo.begin(); - ASSERT_EQ(StatusCode::OK, importedInferRequest->SetBlob(importedInputInfo->first.c_str(), inputBlobPtr, &_resp)) << &_resp.msg; + ASSERT_NO_THROW(importedInferRequest.SetBlob(importedInputInfo->first.c_str(), inputBlobPtr)); - ASSERT_EQ(StatusCode::OK, importedInferRequest->Infer(&_resp)) << _resp.msg; + ASSERT_NO_THROW(importedInferRequest.Infer()); ConstOutputsDataMap importedOutputsInfo; - ASSERT_EQ(StatusCode::OK, importedNetworkPtr->GetOutputsInfo(importedOutputsInfo, &_resp)) << _resp.msg; + ASSERT_NO_THROW(importedOutputsInfo = importedNetwork.GetOutputsInfo()); ASSERT_EQ(importedOutputsInfo.size(), 1); auto importedOutputInfo = importedOutputsInfo.begin(); Blob::Ptr importedOutputBlobPtr; - ASSERT_EQ(StatusCode::OK, importedInferRequest->GetBlob(importedOutputInfo->first.c_str(), importedOutputBlobPtr, &_resp)) << _resp.msg; + ASSERT_NO_THROW(importedOutputBlobPtr = importedInferRequest.GetBlob(importedOutputInfo->first.c_str())); CompareCommonAbsolute(importedOutputBlobPtr, outputBlobPtr, 0.f); } @@ -396,6 +393,7 @@ TEST_F(myriadExtraTests_smoke, ThereIsNoSegfaultOnZeroConvolutionWeights) { ,{ "dilation-x", std::to_string(dilation_factor.x) } ,{ "dilation-y", std::to_string(dilation_factor.y) } }; + ASSERT_NO_FATAL_FAILURE(makeSingleLayerNetwork(LayerInitParams("Convolution") .params(layer_params) .weights(num_weights) diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_concat_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_concat_test.cpp index 07bf286837592f..ded0c301fad01b 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_concat_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_concat_test.cpp @@ -160,37 +160,27 @@ TEST_F(myriadLayersTestsConcat_smoke, ConcatAfterNormalize) { outputsInfo["copy2"]->setLayout(Layout::NHWC); // Load network - StatusCode st; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); // Create InferRequest - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = _exeNetwork.CreateInferRequest()); + // Generate input blob InferenceEngine::Blob::Ptr inputBlob; - ASSERT_NO_THROW(st = inferRequest->GetBlob("input", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob("input")); GenRandomData(inputBlob); // Get output blob InferenceEngine::Blob::Ptr output; - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->GetBlob("concat", output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(output = inferRequest.GetBlob("concat")); + // Get blobs which are input to Concat - InferenceEngine::Blob::Ptr norm1; - InferenceEngine::Blob::Ptr norm2; - ASSERT_NO_THROW(st = inferRequest->GetBlob("copy1", norm1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->GetBlob("copy2", norm2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + InferenceEngine::Blob::Ptr norm1, norm2; + ASSERT_NO_THROW(norm1 = inferRequest.GetBlob("copy1")); + ASSERT_NO_THROW(norm2 = inferRequest.GetBlob("copy2")); + InferenceEngine::BlobMap normMap; normMap["normalize1"] = norm1; normMap["normalize2"] = norm2; diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_conv_nd_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_conv_nd_test.hpp index f12c1eabb634a0..fe9611abdab635 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_conv_nd_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_conv_nd_test.hpp @@ -266,29 +266,20 @@ class ConvNDTest: public myriadLayerTestBaseWithParam // Infer // - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr inputValuesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputValuesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inputValuesBlob = _inferRequest.GetBlob("input")); + void* inputValuesBlobDataPtr = inputValuesBlob->buffer(); std::memcpy(inputValuesBlobDataPtr, inputBlobDataPtr, inputNum * sizeof(ie_fp16)); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputValuesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("convolution", outputValuesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputValuesBlob = _inferRequest.GetBlob("convolution")); + // // Check result // diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution1x1.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution1x1.hpp index 505f820a70d36f..4a9b993d1344e2 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution1x1.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution1x1.hpp @@ -172,8 +172,6 @@ TEST_P(myriadConvolution1x1LayerTests_smoke, Convolution1x1) { InferenceEngine::TBlob::Ptr weights_ptr = InferenceEngine::TBlob::Ptr(GenWeights(num_weights)); - StatusCode st; - InferenceEngine::Core ie; auto network = ie.ReadNetwork(model, weights_ptr); @@ -185,49 +183,44 @@ TEST_P(myriadConvolution1x1LayerTests_smoke, Convolution1x1) { _outputsInfo["conv1x1"]->setPrecision(Precision::FP16); _outputsInfo["conv1x1"]->setLayout(layout); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig.custom_config}, - {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}}, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data", data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(data = _inferRequest.GetBlob("data")); GenRandomData(data); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - -{ - std::map perfMap; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); - std::vector > perfVec(perfMap.begin(), perfMap.end()); - std::sort(perfVec.begin(), perfVec.end(), - [=](const std::pair &pair1, - const std::pair &pair2) -> bool { - return pair1.second.execution_index < pair2.second.execution_index; - }); - - unsigned currentIndex = 0; - for (auto it = perfVec.begin(); it != perfVec.end(); ++it) { - std::string layerName = it->first; - InferenceEngine::InferenceEngineProfileInfo info = it->second; - if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) { - printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f); + ASSERT_NO_THROW(_inferRequest.Infer()); + + // TODO: fix CVS-47174 + if (0) + { + auto perfMap = _inferRequest.GetPerformanceCounts(); + std::vector > perfVec(perfMap.begin(), perfMap.end()); + std::sort(perfVec.begin(), perfVec.end(), + [=](const std::pair &pair1, + const std::pair &pair2) -> bool { + return pair1.second.execution_index < pair2.second.execution_index; + }); + + unsigned currentIndex = 0; + for (auto it = perfVec.begin(); it != perfVec.end(); ++it) { + std::string layerName = it->first; + InferenceEngine::InferenceEngineProfileInfo info = it->second; + if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) { + printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f); + } } + printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d].\n", IB, IC, IH, IW, OB, OC, OH, OW); + printf("[----------] isHardware: %s; isHWC: %d.\n", HWConfigValue.c_str(), isHWC); } - printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d].\n", IB, IC, IH, IW, OB, OC, OH, OW); - printf("[----------] isHardware: %s; isHWC: %d.\n", HWConfigValue.c_str(), isHWC); -} - Blob::Ptr outputBlob; - ASSERT_NO_THROW(_inferRequest->GetBlob("conv1x1", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + Blob::Ptr outputBlob; + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("conv1x1")); + _refBlob = make_shared_blob(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), NCHW)); _refBlob->allocate(); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution3x3.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution3x3.hpp index 2df83a7499c141..54c9875decee40 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution3x3.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution3x3.hpp @@ -189,8 +189,6 @@ TEST_P(myriadConvolution3x3LayerTests_smoke, Convolution3x3) { InferenceEngine::Core ie; auto network = ie.ReadNetwork(model, weights_ptr); - - StatusCode st; _inputsInfo = network.getInputsInfo(); _inputsInfo["data"]->setPrecision(Precision::FP16); @@ -200,19 +198,14 @@ TEST_P(myriadConvolution3x3LayerTests_smoke, Convolution3x3) { _outputsInfo["conv3x3"]->setPrecision(Precision::FP16); _outputsInfo["conv3x3"]->setLayout(NCHW); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig.custom_config}, - {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}}, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data", data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(data = _inferRequest.GetBlob("data")); GenRandomData(data); //padding with zeros 1 row(top/bottom), 1 column(left/right) input tensor @@ -233,33 +226,33 @@ TEST_P(myriadConvolution3x3LayerTests_smoke, Convolution3x3) { } } - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; -{ - std::map perfMap; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); - std::vector > perfVec(perfMap.begin(), perfMap.end()); - std::sort(perfVec.begin(), perfVec.end(), - [=](const std::pair &pair1, - const std::pair &pair2) -> bool { - return pair1.second.execution_index < pair2.second.execution_index; - }); - - unsigned currentIndex = 0; - for (auto it = perfVec.begin(); it != perfVec.end(); ++it) { - std::string layerName = it->first; - InferenceEngine::InferenceEngineProfileInfo info = it->second; - if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) { - printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f); + ASSERT_NO_THROW(_inferRequest.Infer()); + + // TODO: fix CVS-47174 + if (0) + { + auto perfMap = _inferRequest.GetPerformanceCounts(); + std::vector > perfVec(perfMap.begin(), perfMap.end()); + std::sort(perfVec.begin(), perfVec.end(), + [=](const std::pair &pair1, + const std::pair &pair2) -> bool { + return pair1.second.execution_index < pair2.second.execution_index; + }); + + unsigned currentIndex = 0; + for (auto it = perfVec.begin(); it != perfVec.end(); ++it) { + std::string layerName = it->first; + InferenceEngine::InferenceEngineProfileInfo info = it->second; + if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) { + printf("[----------] Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f); + } } + printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d]; stride: %d.\n", IB, IC, IH, IW, OB, OC, OH, OW, stride_xy); + printf("[----------] isHardware: %s.\n", HWConfigValue.c_str()); } - printf("[----------] input dim: [%d %d %d %d]; output dim: [%d %d %d %d]; stride: %d.\n", IB, IC, IH, IW, OB, OC, OH, OW, stride_xy); - printf("[----------] isHardware: %s.\n", HWConfigValue.c_str()); -} Blob::Ptr outputBlob; - ASSERT_NO_THROW(_inferRequest->GetBlob("conv3x3", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("conv3x3")); _refBlob = make_shared_blob(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), NCHW)); _refBlob->allocate(); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution_test.cpp index 0304147b8e8697..4592cc1dfee236 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_convolution_test.cpp @@ -704,8 +704,6 @@ TEST_F(myriadLayersTests_nightly, DISABLED_tests125) { InferenceEngine::TBlob::Ptr weights(GenWeights(1697280 / sizeof(ie_fp16))); constWeightsRange(weights->data().as(), 1697280 / sizeof(ie_fp16)); - StatusCode st; - InferenceEngine::Core ie; auto network = ie.ReadNetwork(MODEL_RFCNN, weights); @@ -716,26 +714,21 @@ TEST_F(myriadLayersTests_nightly, DISABLED_tests125) { outputsInfo[outName1]->setPrecision(Precision::FP16); outputsInfo[outName2]->setPrecision(Precision::FP16); - InferenceEngine::IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferenceEngine::ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network)); - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); Blob::Ptr input; - ASSERT_NO_THROW(st = inferRequest->GetBlob("input", input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input = inferRequest.GetBlob("input")); genTestData(input); - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); - Blob::Ptr out1; - Blob::Ptr out2; - ASSERT_NO_THROW(st = inferRequest->GetBlob(outName1.c_str(), out1, &_resp)); - ASSERT_NO_THROW(st = inferRequest->GetBlob(outName2.c_str(), out2, &_resp)); + Blob::Ptr out1, out2; + ASSERT_NO_THROW(out1 = inferRequest.GetBlob(outName1.c_str())); + ASSERT_NO_THROW(out2 = inferRequest.GetBlob(outName2.c_str())); }; // This tests checks that conv3x3s1 case doesn't corrupt its input. @@ -874,8 +867,6 @@ TEST_F(myriadLayersTests_nightly, SmallConv_CorruptInputBug) { const ie_fp16 *weights = weightsBlob->readOnly().as(); const ie_fp16 *bias = weights + num_weights; - StatusCode st; - ASSERT_NO_THROW(readNetwork(model, weightsBlob)); const auto& network = _cnnNetwork; @@ -887,15 +878,12 @@ TEST_F(myriadLayersTests_nightly, SmallConv_CorruptInputBug) { _outputsInfo["conv1_out"]->setPrecision(Precision::FP16); _outputsInfo["conv2_out"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network)); - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); Blob::Ptr input; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input = _inferRequest.GetBlob("input")); { ie_fp16 *dst = input->buffer().as(); for (int i = 0; i < input->size(); ++i) { @@ -904,16 +892,13 @@ TEST_F(myriadLayersTests_nightly, SmallConv_CorruptInputBug) { } } - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.Infer()); Blob::Ptr conv1; - ASSERT_NO_THROW(_inferRequest->GetBlob("conv1_out", conv1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(conv1 = _inferRequest.GetBlob("conv1_out")); Blob::Ptr conv2; - ASSERT_NO_THROW(_inferRequest->GetBlob("conv2_out", conv2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(conv2 = _inferRequest.GetBlob("conv2_out")); { SCOPED_TRACE("CompareCommonAbsolute with itself"); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_custom_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_custom_test.hpp index fb592d8adcde56..5ad034dc5d4771 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_custom_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_custom_test.hpp @@ -909,8 +909,6 @@ TEST_P(myriadLayersTestsQuantizeBinarize_smoke, Quantize_Binarization) { model.replace( model.find("@output_low_size@"), sizeof("@output_low_size@") -1, std::to_string(output_low_size)); model.replace( model.find("@output_high_size@"), sizeof("@output_high_size@") -1, std::to_string(output_high_size)); - StatusCode st; - InferenceEngine::Core ie; auto network = ie.ReadNetwork(model, InferenceEngine::Blob::CPtr()); @@ -931,74 +929,64 @@ TEST_P(myriadLayersTestsQuantizeBinarize_smoke, Quantize_Binarization) { _inputsInfo["output_high"]->setLayout(NCHW); _outputsInfo["Quantize"]->setLayout(NCHW); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, - {{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig }}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, + {{InferenceEngine::MYRIAD_CUSTOM_LAYERS, customConfig }})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data", data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(data = _inferRequest.GetBlob("data")); GenRandomData(data); Blob::Ptr input_low; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input_low", input_low, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input_low = _inferRequest.GetBlob("input_low")); GenRandomData(input_low); Blob::Ptr input_high; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input_high", input_high, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input_high = _inferRequest.GetBlob("input_high")); Blob::Ptr output_low; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("output_low", output_low, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(output_low = _inferRequest.GetBlob("output_low")); Blob::Ptr output_high; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("output_high", output_high, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - if(levels == 2){ + ASSERT_NO_THROW(output_high = _inferRequest.GetBlob("output_high")); + + if (levels == 2) { memcpy((uint8_t*)input_high->buffer(), (uint8_t*)input_low->buffer(), input_high->byteSize()); for(int i = 0; i < (output_low->byteSize() / output_low->element_size()); ++i){ *((ie_fp16*)output_low->buffer() + i) = switch_out ? PrecisionUtils::f32tof16(1.0f) : PrecisionUtils::f32tof16(-1.0f); *((ie_fp16*)output_high->buffer() + i) = switch_out ? PrecisionUtils::f32tof16(-1.0f) : PrecisionUtils::f32tof16(1.0f); } - } - else{ + } else { GenRandomData(input_high); GenRandomData(output_low); GenRandomData(output_high); } - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.Infer()); -{ - std::map perfMap; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); - std::vector > perfVec(perfMap.begin(), perfMap.end()); - std::sort(perfVec.begin(), perfVec.end(), - [=](const std::pair &pair1, - const std::pair &pair2) -> bool { - return pair1.second.execution_index < pair2.second.execution_index; - }); - - unsigned currentIndex = 0; - for (auto it = perfVec.begin(); it != perfVec.end(); ++it) { - std::string layerName = it->first; - InferenceEngine::InferenceEngineProfileInfo info = it->second; - if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) { - printf("\x1B[32m[----------]\x1B[0m Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f); + // TODO: fix CVS-47174 + if (0) + { + auto perfMap = _inferRequest.GetPerformanceCounts(); + std::vector > perfVec(perfMap.begin(), perfMap.end()); + std::sort(perfVec.begin(), perfVec.end(), + [=](const std::pair &pair1, + const std::pair &pair2) -> bool { + return pair1.second.execution_index < pair2.second.execution_index; + }); + + unsigned currentIndex = 0; + for (auto it = perfVec.begin(); it != perfVec.end(); ++it) { + std::string layerName = it->first; + InferenceEngine::InferenceEngineProfileInfo info = it->second; + if (info.status == InferenceEngine::InferenceEngineProfileInfo::EXECUTED) { + printf("\x1B[32m[----------]\x1B[0m Myriad time = '%s' layer with '%s' type is %f ms.\n", layerName.c_str(), info.exec_type, info.realTime_uSec / 1000.f); + } } } -} Blob::Ptr outputBlob; - ASSERT_NO_THROW(_inferRequest->GetBlob("Quantize", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("Quantize")); + _refBlob = make_shared_blob(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), NCHW)); _refBlob->allocate(); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_detection_output_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_detection_output_test.cpp index 50c254557e9624..51b53dbac0278a 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_detection_output_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_detection_output_test.cpp @@ -863,8 +863,6 @@ class myriadDetectionOutputTests_smoke : public myriadLayersTests_nightly { gen_confidence[i] = static_cast(std::rand()) / RAND_MAX; } - StatusCode st; - InferenceEngine::Core ie; auto network = ie.ReadNetwork(PRIOR_BOX_CLUSTERED_MODEL, InferenceEngine::Blob::CPtr()); @@ -877,20 +875,13 @@ class myriadDetectionOutputTests_smoke : public myriadLayersTests_nightly { outputsInfo["data2_copy"]->setPrecision(Precision::FP16); outputsInfo["priorboxclustered_copy"]->setPrecision(Precision::FP16); - IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; - - IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network)); - ASSERT_NO_THROW(inferRequest->GetBlob("priorboxclustered_copy", priorOutput, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(priorOutput = inferRequest.GetBlob("priorboxclustered_copy")); } TBlob::Ptr refOutput; @@ -998,8 +989,6 @@ class myriadDetectionOutputTests_smoke : public myriadLayersTests_nightly { TEST_F(myriadDetectionOutputTests_smoke, NoConst) { ASSERT_NO_FATAL_FAILURE(PrepareInput()); ASSERT_NO_FATAL_FAILURE(CalcRefOutput(false)); - - StatusCode st; InferenceEngine::Core ie; auto network = ie.ReadNetwork(DETECTION_OUTPUT_MODEL, InferenceEngine::Blob::CPtr()); @@ -1015,18 +1004,14 @@ TEST_F(myriadDetectionOutputTests_smoke, NoConst) { outputsInfo["data2_copy"]->setPrecision(Precision::FP16); outputsInfo["detection_out"]->setPrecision(Precision::FP16); - IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; + ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network)); - IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); Blob::Ptr locations; - ASSERT_NO_THROW(st = inferRequest->GetBlob("locations", locations, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(locations = inferRequest.GetBlob("locations")); { ie_fp16 *dst = locations->buffer().as(); for (int i = 0; i < NUM_LOC; ++i) { @@ -1035,8 +1020,7 @@ TEST_F(myriadDetectionOutputTests_smoke, NoConst) { } Blob::Ptr confidence; - ASSERT_NO_THROW(st = inferRequest->GetBlob("confidence", confidence, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(confidence = inferRequest.GetBlob("confidence")); { ie_fp16 *dst = confidence->buffer().as(); for (int i = 0; i < NUM_CONF; ++i) { @@ -1044,11 +1028,8 @@ TEST_F(myriadDetectionOutputTests_smoke, NoConst) { } } - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(inferRequest->GetBlob("detection_out", myriadOutput, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(myriadOutput = inferRequest.GetBlob("detection_out")); CheckResults(); } @@ -1057,8 +1038,6 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) { ASSERT_NO_FATAL_FAILURE(PrepareInput()); ASSERT_NO_FATAL_FAILURE(CalcRefOutput(true)); - StatusCode st; - TBlob::Ptr weights(new TBlob({Precision::U8, {priorOutput->byteSize()}, Layout::C}, priorOutput->buffer().as())); InferenceEngine::Core ie; @@ -1071,18 +1050,14 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) { auto outputsInfo = network.getOutputsInfo(); outputsInfo["detection_out"]->setPrecision(Precision::FP16); - IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; + ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network)); - IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); Blob::Ptr locations; - ASSERT_NO_THROW(st = inferRequest->GetBlob("locations", locations, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(locations = inferRequest.GetBlob("locations")); { ie_fp16 *dst = locations->buffer().as(); for (int i = 0; i < NUM_LOC; ++i) { @@ -1091,8 +1066,7 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) { } Blob::Ptr confidence; - ASSERT_NO_THROW(st = inferRequest->GetBlob("confidence", confidence, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(confidence = inferRequest.GetBlob("confidence")); { ie_fp16 *dst = confidence->buffer().as(); for (int i = 0; i < NUM_CONF; ++i) { @@ -1100,11 +1074,8 @@ TEST_F(myriadDetectionOutputTests_smoke, MxNet) { } } - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(inferRequest->GetBlob("detection_out", myriadOutput, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(myriadOutput = inferRequest.GetBlob("detection_out")); CheckResults(); } @@ -1113,8 +1084,6 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) { ASSERT_NO_FATAL_FAILURE(PrepareInput()); ASSERT_NO_FATAL_FAILURE(CalcRefOutput(false)); - StatusCode st; - TBlob::Ptr weights(new TBlob({Precision::U8, {priorOutput->byteSize()}, Layout::C}, priorOutput->buffer().as())); InferenceEngine::Core ie; @@ -1127,18 +1096,14 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) { auto outputsInfo = network.getOutputsInfo(); outputsInfo["detection_out"]->setPrecision(Precision::FP16); - IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; + ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network)); - IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); Blob::Ptr locations; - ASSERT_NO_THROW(st = inferRequest->GetBlob("locations", locations, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(locations = inferRequest.GetBlob("locations")); { ie_fp16 *dst = locations->buffer().as(); for (int i = 0; i < NUM_LOC; ++i) { @@ -1147,8 +1112,7 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) { } Blob::Ptr confidence; - ASSERT_NO_THROW(st = inferRequest->GetBlob("confidence", confidence, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(confidence = inferRequest.GetBlob("confidence")); { ie_fp16 *dst = confidence->buffer().as(); for (int i = 0; i < NUM_CONF; ++i) { @@ -1156,11 +1120,8 @@ TEST_F(myriadDetectionOutputTests_smoke, WithConst) { } } - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(inferRequest->GetBlob("detection_out", myriadOutput, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(myriadOutput = inferRequest.GetBlob("detection_out")); CheckResults(); } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.cpp index ce54757ea2457f..e7e9b5e6b042b8 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_eltwise_test.cpp @@ -173,7 +173,6 @@ INSTANTIATE_TEST_CASE_P(accuracy, myriadTestsEltwiseMean_smoke, ); TEST_F(myriadLayersTestsEltwiseBase, EltwiseWithSameInputs) { - StatusCode st; const std::string model = R"V0G0N( @@ -253,28 +252,20 @@ TEST_F(myriadLayersTestsEltwiseBase, EltwiseWithSameInputs) { networkOutputs.begin()->second->setPrecision(InferenceEngine::Precision::FP16); InferenceEngine::Blob::Ptr inputBlob; + InferenceEngine::ExecutableNetwork exeNetwork; - InferenceEngine::IExecutableNetwork::Ptr exeNetwork; std::map networkConfig = {{InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}}; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, networkConfig, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network, networkConfig)); - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob(networkInputs.begin()->first.c_str())); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = inferRequest->GetBlob(networkInputs.begin()->first.c_str(), inputBlob, &_resp)); - - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; GenRandomData(inputBlob); InferenceEngine::Blob::Ptr output; - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->GetBlob(networkOutputs.begin()->first.c_str(), output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(output = inferRequest.GetBlob(networkOutputs.begin()->first.c_str())); _refBlob = make_shared_blob({Precision::FP16, output->getTensorDesc().getDims(), output->getTensorDesc().getLayout()}); _refBlob->allocate(); @@ -490,24 +481,16 @@ TEST_F(myriadLayersTests_nightly, MergeEltwiseWithReLU) { auto outputInfo = _outputsInfo["last"]; outputInfo->setPrecision(Precision::FP16); - StatusCode st; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, { {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}, {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)}, - {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} })); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(_inferRequest.Infer()); std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); auto sumAndReLULayerIt = perfMap.find("sum + sum_relu"); ASSERT_TRUE(sumAndReLULayerIt != perfMap.end()); @@ -722,24 +705,16 @@ TEST_F(myriadLayersTests_nightly, MergeEltwiseWithLeakyReLU) { auto outputInfo = _outputsInfo["last"]; outputInfo->setPrecision(Precision::FP16); - StatusCode st; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, { {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}, {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)}, - {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; + {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} })); - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(_inferRequest.Infer()); std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); auto sumAndReLULayerIt = perfMap.find("sum + sum_leaky_relu"); ASSERT_TRUE(sumAndReLULayerIt != perfMap.end()); @@ -954,25 +929,17 @@ TEST_F(myriadLayersTests_nightly, MergeEltwiseWithClamp) { auto outputInfo = _outputsInfo["last"]; outputInfo->setPrecision(Precision::FP16); - StatusCode st; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork( - _exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork( + network, { {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}, {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)}, - {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} })); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(_inferRequest.Infer()); std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); auto sumAndReLULayerIt = perfMap.find("sum + sum_clamp"); ASSERT_TRUE(sumAndReLULayerIt != perfMap.end()); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_exp_detectionoutput_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_exp_detectionoutput_test.hpp index f104dd06b77219..407d3ce8d3f4c1 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_exp_detectionoutput_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_exp_detectionoutput_test.hpp @@ -153,232 +153,223 @@ class ExpDetectionOutputTest: public myriadLayerTestBaseWithParam(testParams); - const auto layerParams = std::get<1>(testParams); - - const auto blobDims = calcBlobDims(sizeParams); - - const auto model = getModel(blobDims, layerParams); - - ASSERT_NO_THROW(readNetwork(model)); - - const auto& network = _cnnNetwork; - - _inputsInfo = network.getInputsInfo(); - _inputsInfo["detectionOutput_inputBoxes"]->setPrecision(dataPrecision); - _inputsInfo["detectionOutput_inputBoxes"]->setLayout(defaultLayout(blobDims[InputBoxes].size())); - _inputsInfo["detectionOutput_inputDeltas"]->setPrecision(dataPrecision); - _inputsInfo["detectionOutput_inputDeltas"]->setLayout(defaultLayout(blobDims[InputDeltas].size())); - _inputsInfo["detectionOutput_inputScores"]->setPrecision(dataPrecision); - _inputsInfo["detectionOutput_inputScores"]->setLayout(defaultLayout(blobDims[InputScores].size())); - _inputsInfo["detectionOutput_inputIMinfo"]->setPrecision(dataPrecision); - _inputsInfo["detectionOutput_inputIMinfo"]->setLayout(defaultLayout(blobDims[InputIMinfo].size())); - - _outputsInfo = network.getOutputsInfo(); - _outputsInfo["expDetectionOutput.0"]->setPrecision(dataPrecision); - _outputsInfo["expDetectionOutput.0"]->setLayout(defaultLayout(blobDims[OutputBoxes].size())); - _outputsInfo["expDetectionOutput.1"]->setPrecision(classPrecision); - _outputsInfo["expDetectionOutput.1"]->setLayout(defaultLayout(blobDims[OutputClasses].size())); - _outputsInfo["expDetectionOutput.2"]->setPrecision(dataPrecision); - _outputsInfo["expDetectionOutput.2"]->setLayout(defaultLayout(blobDims[OutputScores].size())); - - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - Blob::Ptr inputBoxesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputBoxes", inputBoxesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - Blob::Ptr inputDeltasBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputDeltas", inputDeltasBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - Blob::Ptr inputScoresBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputScores", inputScoresBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - Blob::Ptr inputIMinfoBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("detectionOutput_inputIMinfo", inputIMinfoBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - generateData(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob, sizeParams, layerParams); - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - Blob::Ptr outputBoxesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("expDetectionOutput.0", outputBoxesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - Blob::Ptr refBoxesBlob = make_shared_blob(outputBoxesBlob->getTensorDesc()); - refBoxesBlob->allocate(); - - Blob::Ptr outputClassesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("expDetectionOutput.1", outputClassesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - Blob::Ptr refClassesBlob = make_shared_blob(outputClassesBlob->getTensorDesc()); - refClassesBlob->allocate(); - - Blob::Ptr outputScoresBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("expDetectionOutput.2", outputScoresBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - Blob::Ptr refScoresBlob = make_shared_blob(outputScoresBlob->getTensorDesc()); - refScoresBlob->allocate(); - - ref_expDetectionOutput(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob, - refBoxesBlob, refClassesBlob, refScoresBlob, - sizeParams.numRois, sizeParams.numClasses, sizeParams.maxDetections, layerParams); + { + _config[InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH] = CONFIG_VALUE(NO); + + const auto testParams = GetParam(); + const auto sizeParams = std::get<0>(testParams); + const auto layerParams = std::get<1>(testParams); + + const auto blobDims = calcBlobDims(sizeParams); + + const auto model = getModel(blobDims, layerParams); + + ASSERT_NO_THROW(readNetwork(model)); + + const auto& network = _cnnNetwork; + + _inputsInfo = network.getInputsInfo(); + _inputsInfo["detectionOutput_inputBoxes"]->setPrecision(dataPrecision); + _inputsInfo["detectionOutput_inputBoxes"]->setLayout(defaultLayout(blobDims[InputBoxes].size())); + _inputsInfo["detectionOutput_inputDeltas"]->setPrecision(dataPrecision); + _inputsInfo["detectionOutput_inputDeltas"]->setLayout(defaultLayout(blobDims[InputDeltas].size())); + _inputsInfo["detectionOutput_inputScores"]->setPrecision(dataPrecision); + _inputsInfo["detectionOutput_inputScores"]->setLayout(defaultLayout(blobDims[InputScores].size())); + _inputsInfo["detectionOutput_inputIMinfo"]->setPrecision(dataPrecision); + _inputsInfo["detectionOutput_inputIMinfo"]->setLayout(defaultLayout(blobDims[InputIMinfo].size())); + + _outputsInfo = network.getOutputsInfo(); + _outputsInfo["expDetectionOutput.0"]->setPrecision(dataPrecision); + _outputsInfo["expDetectionOutput.0"]->setLayout(defaultLayout(blobDims[OutputBoxes].size())); + _outputsInfo["expDetectionOutput.1"]->setPrecision(classPrecision); + _outputsInfo["expDetectionOutput.1"]->setLayout(defaultLayout(blobDims[OutputClasses].size())); + _outputsInfo["expDetectionOutput.2"]->setPrecision(dataPrecision); + _outputsInfo["expDetectionOutput.2"]->setLayout(defaultLayout(blobDims[OutputScores].size())); + + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + + Blob::Ptr inputBoxesBlob; + ASSERT_NO_THROW(inputBoxesBlob = _inferRequest.GetBlob("detectionOutput_inputBoxes")); + + Blob::Ptr inputDeltasBlob; + ASSERT_NO_THROW(inputDeltasBlob = _inferRequest.GetBlob("detectionOutput_inputDeltas")); + + Blob::Ptr inputScoresBlob; + ASSERT_NO_THROW(inputScoresBlob = _inferRequest.GetBlob("detectionOutput_inputScores")); + + Blob::Ptr inputIMinfoBlob; + ASSERT_NO_THROW(inputIMinfoBlob = _inferRequest.GetBlob("detectionOutput_inputIMinfo")); + + generateData(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob, sizeParams, layerParams); + + ASSERT_NO_THROW(_inferRequest.Infer()); + + Blob::Ptr outputBoxesBlob; + ASSERT_NO_THROW(outputBoxesBlob = _inferRequest.GetBlob("expDetectionOutput.0")); + Blob::Ptr refBoxesBlob = make_shared_blob(outputBoxesBlob->getTensorDesc()); + refBoxesBlob->allocate(); + + Blob::Ptr outputClassesBlob; + ASSERT_NO_THROW(outputClassesBlob = _inferRequest.GetBlob("expDetectionOutput.1")); + Blob::Ptr refClassesBlob = make_shared_blob(outputClassesBlob->getTensorDesc()); + refClassesBlob->allocate(); + + Blob::Ptr outputScoresBlob; + ASSERT_NO_THROW(outputScoresBlob = _inferRequest.GetBlob("expDetectionOutput.2")); + Blob::Ptr refScoresBlob = make_shared_blob(outputScoresBlob->getTensorDesc()); + refScoresBlob->allocate(); + + ref_expDetectionOutput(inputBoxesBlob, inputDeltasBlob, inputScoresBlob, inputIMinfoBlob, + refBoxesBlob, refClassesBlob, refScoresBlob, + sizeParams.numRois, sizeParams.numClasses, sizeParams.maxDetections, layerParams); + + CompareCommonAbsolute(refBoxesBlob, outputBoxesBlob, 0.0f); + CompareCommonExact(refClassesBlob, outputClassesBlob); + CompareCommonAbsolute(refScoresBlob, outputScoresBlob, 0.0f); + } - CompareCommonAbsolute(refBoxesBlob, outputBoxesBlob, 0.0f); - CompareCommonExact(refClassesBlob, outputClassesBlob); - CompareCommonAbsolute(refScoresBlob, outputScoresBlob, 0.0f); - } static std::string getModel(const BlobDimsList& blobDims, const ExpDetectionOutputParams& layerParams) - { - std::string model = R"V0G0N( - - - - - __INPUT_BOXES_DIMS__ - - - - - __INPUT_DELTAS_DIMS__ - - - - - __INPUT_SCORES_DIMS__ - - - + { + std::string model = R"V0G0N( + + + + + __INPUT_BOXES_DIMS__ + + + + + __INPUT_DELTAS_DIMS__ + + + + + __INPUT_SCORES_DIMS__ + + + + + __INPUT_IM_INFO_DIMS__ + + + + + + __INPUT_BOXES_DIMS__ + __INPUT_DELTAS_DIMS__ + __INPUT_SCORES_DIMS__ + __INPUT_IM_INFO_DIMS__ + - __INPUT_IM_INFO_DIMS__ + __OUTPUT_BOXES_DIMS__ + __OUTPUT_CLASSES_DIMS__ + __OUTPUT_SCORES_DIMS__ - - - - __INPUT_BOXES_DIMS__ - __INPUT_DELTAS_DIMS__ - __INPUT_SCORES_DIMS__ - __INPUT_IM_INFO_DIMS__ - - - __OUTPUT_BOXES_DIMS__ - __OUTPUT_CLASSES_DIMS__ - __OUTPUT_SCORES_DIMS__ - - - - - - - - - - - )V0G0N"; - - const auto inputBoxesDimsStr = dimsToString(blobDims[InputBoxes]); - const auto inputDeltasDimsStr = dimsToString(blobDims[InputDeltas]); - const auto inputScoresDimsStr = dimsToString(blobDims[InputScores]); - const auto inputIMinfoDimsStr = dimsToString(blobDims[InputIMinfo]); - - const auto outputBoxesDimsStr = dimsToString(blobDims[OutputBoxes]); - const auto outputClassesDimsStr = dimsToString(blobDims[OutputClasses]); - const auto outputScoresDimsStr = dimsToString(blobDims[OutputScores]); - - const auto layerParamsStr = layerParamsToString(layerParams); - - REPLACE_WITH_STR(model, "__DATA_PRECISION__", dataPrecision.name()); - REPLACE_WITH_STR(model, "__CLASS_PRECISION__", classPrecision.name()); - - REPLACE_WITH_STR(model, "__INPUT_BOXES_DIMS__", inputBoxesDimsStr); - REPLACE_WITH_STR(model, "__INPUT_DELTAS_DIMS__", inputDeltasDimsStr); - REPLACE_WITH_STR(model, "__INPUT_SCORES_DIMS__", inputScoresDimsStr); - REPLACE_WITH_STR(model, "__INPUT_IM_INFO_DIMS__", inputIMinfoDimsStr); - - REPLACE_WITH_STR(model, "__OUTPUT_BOXES_DIMS__", outputBoxesDimsStr); - REPLACE_WITH_STR(model, "__OUTPUT_CLASSES_DIMS__", outputClassesDimsStr); - REPLACE_WITH_STR(model, "__OUTPUT_SCORES_DIMS__", outputScoresDimsStr); - - REPLACE_WITH_STR(model, "__LAYER_PARAMS__", layerParamsStr); - - return model; - } + + + + + + + + + )V0G0N"; + + const auto inputBoxesDimsStr = dimsToString(blobDims[InputBoxes]); + const auto inputDeltasDimsStr = dimsToString(blobDims[InputDeltas]); + const auto inputScoresDimsStr = dimsToString(blobDims[InputScores]); + const auto inputIMinfoDimsStr = dimsToString(blobDims[InputIMinfo]); + + const auto outputBoxesDimsStr = dimsToString(blobDims[OutputBoxes]); + const auto outputClassesDimsStr = dimsToString(blobDims[OutputClasses]); + const auto outputScoresDimsStr = dimsToString(blobDims[OutputScores]); + + const auto layerParamsStr = layerParamsToString(layerParams); + + REPLACE_WITH_STR(model, "__DATA_PRECISION__", dataPrecision.name()); + REPLACE_WITH_STR(model, "__CLASS_PRECISION__", classPrecision.name()); + + REPLACE_WITH_STR(model, "__INPUT_BOXES_DIMS__", inputBoxesDimsStr); + REPLACE_WITH_STR(model, "__INPUT_DELTAS_DIMS__", inputDeltasDimsStr); + REPLACE_WITH_STR(model, "__INPUT_SCORES_DIMS__", inputScoresDimsStr); + REPLACE_WITH_STR(model, "__INPUT_IM_INFO_DIMS__", inputIMinfoDimsStr); + + REPLACE_WITH_STR(model, "__OUTPUT_BOXES_DIMS__", outputBoxesDimsStr); + REPLACE_WITH_STR(model, "__OUTPUT_CLASSES_DIMS__", outputClassesDimsStr); + REPLACE_WITH_STR(model, "__OUTPUT_SCORES_DIMS__", outputScoresDimsStr); + + REPLACE_WITH_STR(model, "__LAYER_PARAMS__", layerParamsStr); + + return model; + } + static std::string layerParamsToString(const ExpDetectionOutputParams& layerParams) + { + std::string str; + + str += "deltas_weights=\""; + const char* sep = ""; + for (auto& w : layerParams.deltas_weights) { - std::string str; + str += sep + std::to_string(w); + sep = ","; + } + str += "\""; - str += "deltas_weights=\""; - const char* sep = ""; - for (auto& w : layerParams.deltas_weights) - { - str += sep + std::to_string(w); - sep = ","; - } - str += "\""; + str += " max_delta_log_wh=\"" + std::to_string(layerParams.max_delta_log_wh) + "\""; + str += " nms_threshold=\"" + std::to_string(layerParams.nms_threshold) + "\""; + str += " score_threshold=\"" + std::to_string(layerParams.score_threshold) + "\""; + str += " max_detections_per_image=\"" + std::to_string(layerParams.max_detections_per_image) + "\""; + str += " num_classes=\"" + std::to_string(layerParams.num_classes) + "\""; + str += " post_nms_count=\"" + std::to_string(layerParams.post_nms_count) + "\""; + str += " class_agnostic_box_regression=\"" + std::to_string(layerParams.class_agnostic_box_regression) + "\""; - str += " max_delta_log_wh=\"" + std::to_string(layerParams.max_delta_log_wh) + "\""; - str += " nms_threshold=\"" + std::to_string(layerParams.nms_threshold) + "\""; - str += " score_threshold=\"" + std::to_string(layerParams.score_threshold) + "\""; - str += " max_detections_per_image=\"" + std::to_string(layerParams.max_detections_per_image) + "\""; - str += " num_classes=\"" + std::to_string(layerParams.num_classes) + "\""; - str += " post_nms_count=\"" + std::to_string(layerParams.post_nms_count) + "\""; - str += " class_agnostic_box_regression=\"" + std::to_string(layerParams.class_agnostic_box_regression) + "\""; + return str; + } - return str; - } static std::string dimsToString(const SizeVector& dims) - { - std::string str; - for (auto& d : dims) - str += "" + std::to_string(d) + ""; - return str; - } + { + std::string str; + for (auto& d : dims) + str += "" + std::to_string(d) + ""; + return str; + } + static BlobDimsList calcBlobDims(const SizeParams& sizeParams) - { - const size_t numRois = sizeParams.numRois; - const size_t numClasses = sizeParams.numClasses; - const size_t maxDetections = sizeParams.maxDetections; + { + const size_t numRois = sizeParams.numRois; + const size_t numClasses = sizeParams.numClasses; + const size_t maxDetections = sizeParams.maxDetections; - BlobDimsList list(NumBlobs); + BlobDimsList list(NumBlobs); - list[InputBoxes] = SizeVector({numRois, 4}); - list[InputDeltas] = SizeVector({numRois, numClasses * 4}); - list[InputScores] = SizeVector({numRois, numClasses}); - list[InputIMinfo] = SizeVector({1, 3}); + list[InputBoxes] = SizeVector({numRois, 4}); + list[InputDeltas] = SizeVector({numRois, numClasses * 4}); + list[InputScores] = SizeVector({numRois, numClasses}); + list[InputIMinfo] = SizeVector({1, 3}); - list[OutputBoxes] = SizeVector({maxDetections, 4}); - list[OutputClasses] = SizeVector({maxDetections}); - list[OutputScores] = SizeVector({maxDetections}); + list[OutputBoxes] = SizeVector({maxDetections, 4}); + list[OutputClasses] = SizeVector({maxDetections}); + list[OutputScores] = SizeVector({maxDetections}); + + return list; + } - return list; - } static Layout defaultLayout(int ndims) + { + switch (ndims) { - switch (ndims) - { - case 5: return NCDHW; - case 4: return NCHW; - case 3: return CHW; - case 2: return NC; - case 1: return C; - } - return ANY; + case 5: return NCDHW; + case 4: return NCHW; + case 3: return CHW; + case 2: return NC; + case 1: return C; } + return ANY; + } }; class myriadTestsExpDetectionOutput_smoke: public ExpDetectionOutputTest diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_lstm_cell.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_lstm_cell.cpp index 1b779792952beb..95df481396d1ec 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_lstm_cell.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_lstm_cell.cpp @@ -50,25 +50,19 @@ TEST_F(myriadLayersTests_nightly, LSTMCellSequenceNet) { (++++networkInputsFull.begin())->second->setPrecision(InferenceEngine::Precision::FP16); networkOutputsFull.begin()->second->setPrecision(InferenceEngine::Precision::FP16); - InferenceEngine::IExecutableNetwork::Ptr exeNetworkFull; + InferenceEngine::ExecutableNetwork exeNetworkFull; std::map networkConfig; - StatusCode st; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetworkFull, full_network, networkConfig, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetworkFull->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(exeNetworkFull = _vpuPluginPtr->LoadNetwork(full_network, networkConfig)); + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetworkFull.CreateInferRequest()); InferenceEngine::Blob::Ptr inputBlob; - ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNInput", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob("RNNInput")); InferenceEngine::Blob::Ptr inputBlobHidden; - ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNInput_Hidden", inputBlobHidden, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inputBlobHidden = inferRequest.GetBlob("RNNInput_Hidden")); InferenceEngine::Blob::Ptr inputBlobCellState; - ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNInput_CellState", inputBlobCellState, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inputBlobCellState = inferRequest.GetBlob("RNNInput_CellState")); /* input tensors generating */ ie_fp16 *src_data_cell_state = static_cast(inputBlobCellState->buffer()); @@ -156,18 +150,14 @@ TEST_F(myriadLayersTests_nightly, LSTMCellSequenceNet) { } } - ASSERT_NO_THROW(st = inferRequest->SetBlob("RNNInput_Hidden", inputBlobHidden, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->SetBlob("RNNInput_CellState", inputBlobCellState, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->SetBlob("RNNInput", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.SetBlob("RNNInput_Hidden", inputBlobHidden)); + ASSERT_NO_THROW(inferRequest.SetBlob("RNNInput_CellState", inputBlobCellState)); + ASSERT_NO_THROW(inferRequest.SetBlob("RNNInput", inputBlob)); - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); + ASSERT_NO_THROW(inferRequest.Infer()); InferenceEngine::Blob::Ptr output; - ASSERT_NO_THROW(st = inferRequest->GetBlob("RNNOutput", output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(output = inferRequest.GetBlob("RNNOutput")); CompareCommonAbsolute(output, refOut0, ERROR_BOUND); } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_mvn_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_mvn_test.cpp index 69263ba7a3f8fb..53df1448f2d527 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_mvn_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_mvn_test.cpp @@ -54,8 +54,6 @@ TEST_F(myriadLayersTests_nightly, MVN_CHW_Input) )V0G0N"; - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -66,14 +64,11 @@ TEST_F(myriadLayersTests_nightly, MVN_CHW_Input) _outputsInfo = network.getOutputsInfo(); _outputsInfo["mvn"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, - {{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(YES)}}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, + {{InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(YES)}})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + auto tensorDesc = TensorDesc(Precision::FP16, _inputsInfo["data"]->getTensorDesc().getDims(), Layout::NCHW); auto inputNCHW = make_shared_blob(tensorDesc); ASSERT_NO_THROW(inputNCHW->allocate()); @@ -86,14 +81,9 @@ TEST_F(myriadLayersTests_nightly, MVN_CHW_Input) ASSERT_NO_THROW(GenRandomData(inputNCHW)); - ASSERT_NO_THROW(st = _inferRequest->SetBlob("data", inputNCHW, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->SetBlob("mvn", outputNCHW, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.SetBlob("data", inputNCHW)); + ASSERT_NO_THROW(_inferRequest.SetBlob("mvn", outputNCHW)); + ASSERT_NO_THROW(_inferRequest.Infer()); ASSERT_NO_FATAL_FAILURE(refMVN(inputNCHW, output_ref, 1, 1, 9.999999717180685e-10, true)); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_pool_nd_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_pool_nd_test.hpp index d90c7bcccf5172..fcf32625fb38df 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_pool_nd_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_pool_nd_test.hpp @@ -220,29 +220,20 @@ class PoolNDTest: public myriadLayerTestBaseWithParam // Infer // - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr inputValuesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputValuesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inputValuesBlob = _inferRequest.GetBlob("input")); + void* inputValuesBlobDataPtr = inputValuesBlob->buffer(); std::memcpy(inputValuesBlobDataPtr, inputBlobDataPtr, inputNum * sizeof(ie_fp16)); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputValuesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("pooling", outputValuesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputValuesBlob = _inferRequest.GetBlob("pooling")); + // // Check result // diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_clustered_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_clustered_test.cpp index 7c0c64b4d82784..9fea2f659c3c24 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_clustered_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_clustered_test.cpp @@ -211,8 +211,6 @@ TEST_F(myriadLayersTests_nightly, PriorBoxClustered) { SetSeed(DEFAULT_SEED_VALUE + 6); PriorBoxClusteredParams params; - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -226,31 +224,24 @@ TEST_F(myriadLayersTests_nightly, PriorBoxClustered) { _outputsInfo["data2_copy"]->setPrecision(Precision::FP16); _outputsInfo["priorboxclustered_copy"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr data1; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data1", data1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data1 = _inferRequest.GetBlob("data1")); + Blob::Ptr data2; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data2", data2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data2 = _inferRequest.GetBlob("data2")); + GenRandomData(data1); GenRandomData(data2); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputBlob; - ASSERT_NO_THROW(_inferRequest->GetBlob("priorboxclustered_copy", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("priorboxclustered_copy")); + _refBlob = make_shared_blob({Precision::FP16, outputBlob->getTensorDesc().getDims(), ANY}); _refBlob->allocate(); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_test.cpp index c0334fc710ffd6..ac1d81b3df651e 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_prior_box_test.cpp @@ -289,8 +289,6 @@ class myriadLayersPriorBoxTests_smoke : public myriadLayersTests_nightly { const PriorBoxParams& params, Precision outPrec = Precision::FP16) { SetSeed(DEFAULT_SEED_VALUE + 5); - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -304,31 +302,23 @@ class myriadLayersPriorBoxTests_smoke : public myriadLayersTests_nightly { _outputsInfo["data2_copy"]->setPrecision(Precision::FP16); _outputsInfo[outputName]->setPrecision(outPrec); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr data1; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data1", data1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data1 = _inferRequest.GetBlob("data1")); + Blob::Ptr data2; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data2", data2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data2 = _inferRequest.GetBlob("data2")); + GenRandomData(data1); GenRandomData(data2); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputBlob; - ASSERT_NO_THROW(_inferRequest->GetBlob(outputName.c_str(), outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob(outputName.c_str())); + _refBlob = make_shared_blob(TensorDesc(Precision::FP16, outputBlob->getTensorDesc().getDims(), ANY)); _refBlob->allocate(); @@ -1296,8 +1286,6 @@ TEST_F(myriadLayersTests_nightly, PriorBox_WithConcat) )V0G0N"; - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -1321,24 +1309,19 @@ TEST_F(myriadLayersTests_nightly, PriorBox_WithConcat) _outputsInfo["conv9_2_copy"]->setPrecision(Precision::FP16); _outputsInfo["mbox_priorbox_copy"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + + ASSERT_NO_THROW(_inferRequest.Infer()); + // TODO: uncomment this code when GraphTransformer will be updated // to optimize out extra copies in case of PriorBox+Concat pair. #if 0 { std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); + int count = 0; for (auto p : perfMap) { auto layerName = p.first; @@ -1353,9 +1336,8 @@ TEST_F(myriadLayersTests_nightly, PriorBox_WithConcat) #endif Blob::Ptr outputBlob; - ASSERT_NO_THROW(_inferRequest->GetBlob("mbox_priorbox_copy", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("mbox_priorbox_copy")); + auto conv4_3_norm_mbox_priorbox = make_shared_blob(TensorDesc(Precision::FP16, {1, 2, 23104}, Layout::ANY)); { conv4_3_norm_mbox_priorbox->allocate(); @@ -1836,8 +1818,6 @@ TEST_F(myriadLayersPriorBoxTests_smoke, TwoPriorBoxLayersWithUnusedInput) SetSeed(DEFAULT_SEED_VALUE + 5); - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -1852,34 +1832,26 @@ TEST_F(myriadLayersPriorBoxTests_smoke, TwoPriorBoxLayersWithUnusedInput) _outputsInfo["priorbox1"]->setPrecision(Precision::FP16); _outputsInfo["priorbox2"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr data1; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data1", data1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data1 = _inferRequest.GetBlob("data1")); + Blob::Ptr data2; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("data2", data2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data2 = _inferRequest.GetBlob("data2")); + GenRandomData(data1); GenRandomData(data2); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputBlob1; Blob::Ptr outputBlob2; - ASSERT_NO_THROW(_inferRequest->GetBlob("priorbox1", outputBlob1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(_inferRequest->GetBlob("priorbox2", outputBlob2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob1 = _inferRequest.GetBlob("priorbox1")); + ASSERT_NO_THROW(outputBlob2 = _inferRequest.GetBlob("priorbox2")); + _refBlob = make_shared_blob(TensorDesc(Precision::FP16, outputBlob1->getTensorDesc().getDims(), ANY)); _refBlob->allocate(); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_proposal_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_proposal_test.cpp index ef75f2dd5442fb..e32bc8bd70d881 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_proposal_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_proposal_test.cpp @@ -37,8 +37,6 @@ class myriadLayersTestsProposal_smoke : public myriadLayersTests_nightly { void InferProposalLayer() { SetSeed(DEFAULT_SEED_VALUE + 13); - StatusCode st; - REPLACE_WITH_STR(model, "__PRECISION__", precision.name()); REPLACE_WITH_STR(model, "__CLIP_BEFORE_NMS__", clip_before_nms); @@ -60,25 +58,18 @@ class myriadLayersTestsProposal_smoke : public myriadLayersTests_nightly { _outputsInfo["proposal"]->setPrecision(precision); _outputsInfo["proposal"]->setLayout(NC); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr rpn_cls_prob_reshape; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("rpn_cls_prob_reshape", rpn_cls_prob_reshape, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(rpn_cls_prob_reshape = _inferRequest.GetBlob("rpn_cls_prob_reshape")); + Blob::Ptr rpn_bbox_pred; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("rpn_bbox_pred", rpn_bbox_pred, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(rpn_bbox_pred = _inferRequest.GetBlob("rpn_bbox_pred")); + Blob::Ptr img_info; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("im_info", img_info, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(img_info = _inferRequest.GetBlob("im_info")); + // for rpn_cls_prob_reshape std::string inputTensor1Binary = TestDataHelpers::get_data_path() + cls_prob_file; ASSERT_TRUE(fromBinaryFile(inputTensor1Binary, rpn_cls_prob_reshape)); @@ -101,11 +92,8 @@ class myriadLayersTestsProposal_smoke : public myriadLayersTests_nightly { } - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(_inferRequest->GetBlob("proposal", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.Infer()); + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("proposal")); } void compareOutputSampleToRef(std::vector & gt_values, const float error_threshold) { diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_psroipooling_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_psroipooling_test.hpp index e2a3f5891e983d..06c988522abe73 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_psroipooling_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_psroipooling_test.hpp @@ -149,12 +149,8 @@ class myriadLayersTestsPSROIPooling_smoke: public myriadLayerTestBaseWithParam

setLayout(NCHW); } - InferenceEngine::StatusCode st = InferenceEngine::StatusCode::GENERAL_ERROR; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)); - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - ASSERT_NO_THROW(_exeNetwork->CreateInferRequest(_inferRequest, &_resp)) << _resp.msg; - ASSERT_EQ((int)InferenceEngine::StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_inferRequest, nullptr) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); ASSERT_NO_THROW(_inputsInfo = _cnnNetwork.getInputsInfo()); ASSERT_NO_THROW(_outputsInfo = _cnnNetwork.getOutputsInfo()); @@ -166,23 +162,18 @@ class myriadLayersTestsPSROIPooling_smoke: public myriadLayerTestBaseWithParam

getTensorDesc().getLayout(); Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob(inputInfo.first.c_str(), data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data = _inferRequest.GetBlob(inputInfo.first.c_str())); + if (inputInfo.first == _inputsInfo.begin()->first) - { GenRandomData(data); - } else - { genROIs(data, params, num_rois); - } + _inputMap[inputInfo.first] = data; } Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob(_outputsInfo.begin()->first.c_str(), data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(data = _inferRequest.GetBlob(_outputsInfo.begin()->first.c_str())); _outputMap[_outputsInfo.begin()->first] = data; } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reduce_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reduce_test.hpp index 451ef232958d10..453d50f35ff3e4 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reduce_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reduce_test.hpp @@ -416,23 +416,16 @@ class ReduceTest: public myriadLayerTestBaseWithParam _outputsInfo = network.getOutputsInfo(); _outputsInfo["reduce"]->setPrecision(dataPrecision); _outputsInfo["reduce"]->setLayout(vpu::deviceLayout(TensorDesc::getLayoutByDims(outputDims), layoutPreference)); - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr inputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("reduce_input", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inputBlob = _inferRequest.GetBlob("reduce_input")); + Blob::Ptr outputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("reduce", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("reduce")); + Blob::Ptr refBlob = nullptr; float compareThreshold = 0.0f; if (dataPrecision == Precision::FP16) { @@ -443,9 +436,8 @@ class ReduceTest: public myriadLayerTestBaseWithParam auto generateData = opIt->second.generateData; generateData(inputBlob); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + refBlob = make_shared_blob(outputBlob->getTensorDesc()); refBlob->allocate(); ref_reduce(inputBlob, axesBlob, refBlob, keepDims, layoutPreference, reduceOp); @@ -457,9 +449,8 @@ class ReduceTest: public myriadLayerTestBaseWithParam auto generateData = opIt->second.generateData; generateData(inputBlob); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + refBlob = make_shared_blob(outputBlob->getTensorDesc()); refBlob->allocate(); ref_reduce(inputBlob, axesBlob, refBlob, keepDims, layoutPreference, reduceOp); @@ -468,25 +459,11 @@ class ReduceTest: public myriadLayerTestBaseWithParam } }; -class myriadTestsReduceAnd_smoke: public ReduceTest -{ -}; - -class myriadTestsReduceMin_smoke: public ReduceTest -{ -}; - -class myriadTestsReduceMax_smoke: public ReduceTest -{ -}; - -class myriadTestsReduceSum_smoke: public ReduceTest -{ -}; - -class myriadTestsReduceMean_smoke: public ReduceTest -{ -}; +using myriadTestsReduceAnd_smoke = ReduceTest; +using myriadTestsReduceMin_smoke = ReduceTest; +using myriadTestsReduceMax_smoke = ReduceTest; +using myriadTestsReduceSum_smoke = ReduceTest; +using myriadTestsReduceMean_smoke = ReduceTest; // Tests are disabled due to hang: #-28315 diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.cpp index 0fee57bbf64ba4..8f4900509833db 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.cpp @@ -162,7 +162,6 @@ TEST_F(myriadLayersTests_nightly, graphTransformerNotThrowExceptionIfConvOutputI )V0G0N"; TBlob::Ptr weightsBlob(GenWeights(120)); - StatusCode st; ASSERT_NO_THROW(readNetwork(model, weightsBlob)); @@ -175,9 +174,8 @@ TEST_F(myriadLayersTests_nightly, graphTransformerNotThrowExceptionIfConvOutputI _outputsInfo["conv1/relu"]->setPrecision(Precision::FP16); _outputsInfo["deconv"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; -} + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); + } TEST_F(myriadLayersTests_nightly, ReLU_PostOp_Conflict) { const std::string model = R"V0G0N( @@ -274,8 +272,6 @@ TEST_F(myriadLayersTests_nightly, ReLU_PostOp_Conflict) { TBlob::Ptr weights(GenWeights(num_weights + num_bias)); - StatusCode st; - ASSERT_NO_THROW(readNetwork(model, weights)); const auto& network = _cnnNetwork; @@ -287,6 +283,5 @@ TEST_F(myriadLayersTests_nightly, ReLU_PostOp_Conflict) { _outputsInfo["relu"]->setPrecision(Precision::FP16); _outputsInfo["power"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(st, StatusCode::OK); + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, {})); } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.hpp index c603c23f890db2..dc03d73409741a 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_relu_test.hpp @@ -14,8 +14,6 @@ const std::string relu_param = "negative_slope"; class myriadLayersTestsReLUMergeWithBias_smoke : public myriadLayersTests_nightly { public: void RunTest(const std::string& model, size_t num_weights, size_t num_bias) { - StatusCode st; - TBlob::Ptr weights(GenWeights(num_weights + num_bias)); ASSERT_NO_THROW(readNetwork(model, weights)); @@ -28,23 +26,17 @@ class myriadLayersTestsReLUMergeWithBias_smoke : public myriadLayersTests_nightl _outputsInfo = network.getOutputsInfo(); _outputsInfo["relu"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, { {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)}, - {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} }, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)} })); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + + ASSERT_NO_THROW(_inferRequest.Infer()); + std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); + { auto reluAndBiasLayerIt = perfMap.find("relu+Bias"); ASSERT_TRUE(reluAndBiasLayerIt != perfMap.end()); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.cpp index 3fb187e1d10898..c4b9d0a021f145 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.cpp @@ -8,36 +8,29 @@ TEST_F(myriadEliminateReshapeTests_smoke, SplitConvConcat) { ASSERT_NO_THROW(_cnnNetwork = InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitConvConcat())); - StatusCode st; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, - { - { - InferenceEngine::MYRIAD_PERF_REPORT_MODE, - InferenceEngine::MYRIAD_PER_STAGE - }, - { - InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, - CONFIG_VALUE(NO) - }, - { - CONFIG_KEY(PERF_COUNT), - CONFIG_VALUE(YES) - } - }, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, + { + { + InferenceEngine::MYRIAD_PERF_REPORT_MODE, + InferenceEngine::MYRIAD_PER_STAGE + }, + { + InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, + CONFIG_VALUE(NO) + }, + { + CONFIG_KEY(PERF_COUNT), + CONFIG_VALUE(YES) + } + })); + + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + + ASSERT_NO_THROW(_inferRequest.Infer()); + std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); + auto layerInfo = perfMap["MobilenetV1/Logits/SpatialSqueeze"]; ASSERT_EQ(InferenceEngineProfileInfo::NOT_RUN, layerInfo.status); } @@ -192,8 +185,6 @@ TEST_F(myriadLayersTests_nightly, ReshapeAfterConcat_Eliminate) { )V0G0N"; - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -206,38 +197,30 @@ TEST_F(myriadLayersTests_nightly, ReshapeAfterConcat_Eliminate) { _outputsInfo = network.getOutputsInfo(); _outputsInfo["reshape_copy"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, { {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}, {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, CONFIG_VALUE(NO)}, - {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)} }, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES)} })); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr input1; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input1", input1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input1 = _inferRequest.GetBlob("input1")); GenRandomData(input1); Blob::Ptr input2; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input2", input2, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input2 = _inferRequest.GetBlob("input2")); GenRandomData(input2); Blob::Ptr input3; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input3", input3, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input3 = _inferRequest.GetBlob("input3")); GenRandomData(input3); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.Infer()); Blob::Ptr output; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("reshape_copy", output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(output = _inferRequest.GetBlob("reshape_copy")); + _refBlob = make_shared_blob({Precision::FP16, output->getTensorDesc().getDims(), Layout::ANY}); _refBlob->allocate(); { @@ -259,9 +242,8 @@ TEST_F(myriadLayersTests_nightly, ReshapeAfterConcat_Eliminate) { CompareCommonAbsolute(output, _refBlob, 0); std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); + auto layerInfo = perfMap["reshape"]; EXPECT_EQ(InferenceEngineProfileInfo::NOT_RUN, layerInfo.status); } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.hpp index 5166f5029bdf4e..d6f7c42de3c643 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_reshape_test.hpp @@ -208,8 +208,6 @@ TEST_P(myriadLayersTestsReshapeBeforeFC_smoke, OptimizeReshapeIfItIsPlacedBefore } std::string outputName = "fc6"; - StatusCode st = InferenceEngine::OK; - InferenceEngine::ResponseDesc resp; TBlob::Ptr weights(GenWeights(9280 / sizeof(ie_fp16))); Core ie; @@ -221,27 +219,21 @@ TEST_P(myriadLayersTestsReshapeBeforeFC_smoke, OptimizeReshapeIfItIsPlacedBefore auto outputsInfo = network.getOutputsInfo(); outputsInfo[outputName]->setPrecision(Precision::FP16); - InferenceEngine::IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network, + InferenceEngine::ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network, { {InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE}, {InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, HWConfigValue}, - {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}, &resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + {CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }})); - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); Blob::Ptr input; - ASSERT_NO_THROW(st = inferRequest->GetBlob("input", input, &resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << resp.msg; + ASSERT_NO_THROW(input = inferRequest.GetBlob("input")); + ASSERT_NO_THROW(inferRequest.Infer()); std::map perfMap; - ASSERT_NO_THROW(st = inferRequest->GetPerformanceCounts(perfMap, &resp)); - ASSERT_EQ(StatusCode::OK, st) << resp.msg; + ASSERT_NO_THROW(perfMap = inferRequest.GetPerformanceCounts()); auto layerInfo = perfMap["flatten_0"]; EXPECT_EQ(InferenceEngineProfileInfo::NOT_RUN, layerInfo.status); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_rfcn_test.cpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_rfcn_test.cpp index 8204fbf5882272..7ff0e233fd8ec0 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_rfcn_test.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_rfcn_test.cpp @@ -670,7 +670,7 @@ class myriadLayersRfcnTests_smoke: public myriadLayersTests_nightly { } } - void PrepareInputAndReference(const std::string& model_prior_network, const std::string& output_layer, StatusCode& st) + void PrepareInputAndReference(const std::string& model_prior_network, const std::string& output_layer) { SetSeed(DEFAULT_SEED_VALUE); @@ -692,22 +692,17 @@ class myriadLayersRfcnTests_smoke: public myriadLayersTests_nightly { std::map networkConfig; networkConfig["VPU_HW_STAGES_OPTIMIZATION"] = "NO"; - IExecutableNetwork::Ptr exeNetwork; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, network_part, networkConfig, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; + ExecutableNetwork exeNetwork; + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(network_part, networkConfig)); - IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); Blob::Ptr input0; - ASSERT_NO_THROW(st = inferRequest->GetBlob("input0", input0, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input0 = inferRequest.GetBlob("input0")); Blob::Ptr input1; - ASSERT_NO_THROW(st = inferRequest->GetBlob("input1", input1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input1 = inferRequest.GetBlob("input1")); // Allocate buffer input0_share = make_shared_blob({Precision::FP16, input0->getTensorDesc().getDims(), ANY}); @@ -729,14 +724,11 @@ class myriadLayersRfcnTests_smoke: public myriadLayersTests_nightly { std::copy(input0_share_data, input0_share_data + input0_share->size(), input0_data); std::copy(input1_share_data, input1_share_data + input1_share->size(), input1_data); - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = inferRequest->GetBlob(output_layer.c_str(), prior_network_output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(prior_network_output = inferRequest.GetBlob(output_layer.c_str())); } - void RunNetwork(const std::string& model, const std::string& output_layer, StatusCode& st) + void RunNetwork(const std::string& model, const std::string& output_layer) { ASSERT_NO_THROW(readNetwork(model)); @@ -754,23 +746,16 @@ class myriadLayersRfcnTests_smoke: public myriadLayersTests_nightly { std::map networkConfig; networkConfig["VPU_HW_STAGES_OPTIMIZATION"] = "NO"; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, networkConfig, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, networkConfig)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); Blob::Ptr input0; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input0", input0, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input0 = _inferRequest.GetBlob("input0")); Blob::Ptr input1; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input1", input1, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(input1 = _inferRequest.GetBlob("input1")); - ASSERT_NO_THROW(st = _inferRequest->GetBlob(output_layer.c_str(), outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob(output_layer.c_str())); _refBlob = make_shared_blob({Precision::FP16, outputBlob->getTensorDesc().getDims(), ANY}); _refBlob->allocate(); @@ -786,8 +771,7 @@ class myriadLayersRfcnTests_smoke: public myriadLayersTests_nightly { std::copy(input0_share_data, input0_share_data + input0_share->size(), input0_data); std::copy(input1_share_data, input1_share_data + input1_share->size(), input1_data); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.Infer()); } Blob::Ptr input0_share; @@ -798,15 +782,11 @@ class myriadLayersRfcnTests_smoke: public myriadLayersTests_nightly { TEST_F(myriadLayersRfcnTests_smoke, ReshapeRfcn) { - StatusCode st = GENERAL_ERROR; - std::string prior_network_output_layer = "cls_prob"; std::string test_network_output_layer = "cls_prob_reshape"; - ASSERT_NO_THROW(PrepareInputAndReference(model_to_softmax, prior_network_output_layer, st)); - ASSERT_EQ(StatusCode::OK, st) << "PrepareInputAndReference failed"; - ASSERT_NO_THROW(RunNetwork(model_to_reshape, test_network_output_layer, st)); - ASSERT_EQ(StatusCode::OK, st) << "RunNetwork failed"; + ASSERT_NO_THROW(PrepareInputAndReference(model_to_softmax, prior_network_output_layer)); + ASSERT_NO_THROW(RunNetwork(model_to_reshape, test_network_output_layer)); ASSERT_EQ(outputBlob->size(), prior_network_output->size()); CompareCommonAbsolute(outputBlob, prior_network_output, 0.0f); @@ -814,15 +794,11 @@ TEST_F(myriadLayersRfcnTests_smoke, ReshapeRfcn) TEST_F(myriadLayersRfcnTests_smoke, SoftmaxRfcn) { - StatusCode st = GENERAL_ERROR; - std::string prior_network_output_layer = "ave_cls_score_rois"; std::string test_network_output_layer = "cls_prob"; - ASSERT_NO_THROW(PrepareInputAndReference(model_to_pooling, prior_network_output_layer, st)); - ASSERT_EQ(StatusCode::OK, st) << "PrepareInputAndReference failed"; - ASSERT_NO_THROW(RunNetwork(model_to_softmax, test_network_output_layer, st)); - ASSERT_EQ(StatusCode::OK, st) << "RunNetwork failed"; + ASSERT_NO_THROW(PrepareInputAndReference(model_to_pooling, prior_network_output_layer)); + ASSERT_NO_THROW(RunNetwork(model_to_softmax, test_network_output_layer)); int param_axis = 1; ref_soft_max(prior_network_output, _refBlob, param_axis); @@ -832,15 +808,11 @@ TEST_F(myriadLayersRfcnTests_smoke, SoftmaxRfcn) TEST_F(myriadLayersRfcnTests_smoke, GlobalAvgPooling7x7Rfcn) { - StatusCode st = GENERAL_ERROR; - std::string prior_network_output_layer = "PSROIPooling"; std::string test_network_output_layer = "ave_cls_score_rois"; - ASSERT_NO_THROW(PrepareInputAndReference(model_to_psroipooling, prior_network_output_layer, st)); - ASSERT_EQ(StatusCode::OK, st) << "PrepareInputAndReference failed"; - ASSERT_NO_THROW(RunNetwork(model_to_pooling, test_network_output_layer, st)); - ASSERT_EQ(StatusCode::OK, st) << "RunNetwork failed"; + ASSERT_NO_THROW(PrepareInputAndReference(model_to_psroipooling, prior_network_output_layer)); + ASSERT_NO_THROW(RunNetwork(model_to_pooling, test_network_output_layer)); refGlobalAvgPooling7x7Rfcn(prior_network_output, _refBlob); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_align_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_align_test.hpp index a63434aadb6afa..397efdcc1f1376 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_align_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_align_test.hpp @@ -189,36 +189,26 @@ TEST_P(myriadLayersTestsROIAlign_smoke, ROIAlign) { _outputsInfo = network.getOutputsInfo(); _outputsInfo["roi_align"]->setPrecision(Precision::FP16); - StatusCode st = OK; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr roisBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("boxes", roisBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(roisBlob = _inferRequest.GetBlob("boxes")); genROIs(roisBlob, test_params, num_rois); Blob::Ptr featureMapBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("feature_map", featureMapBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(featureMapBlob = _inferRequest.GetBlob("feature_map")); GenRandomData(featureMapBlob); Blob::Ptr batchIndicesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("batch_indices", batchIndicesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(batchIndicesBlob = _inferRequest.GetBlob("batch_indices")); genBatchIndices(batchIndicesBlob, num_rois, num_batches); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("roi_align", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("roi_align")); + Blob::Ptr refOutputBlob = make_shared_blob({Precision::FP32, outputBlob->getTensorDesc().getDims(), outputBlob->getTensorDesc().getLayout()}); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_pooling_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_pooling_test.hpp index 68b89f87b7b68f..09a166a15ba79d 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_pooling_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_roi_pooling_test.hpp @@ -223,12 +223,8 @@ class myriadLayersTestsROIPooling_smoke: public myriadLayerTestBaseWithParamsetLayout(NCHW); } - InferenceEngine::StatusCode st = InferenceEngine::StatusCode::GENERAL_ERROR; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, {}, &_resp)); - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - ASSERT_NO_THROW(_exeNetwork->CreateInferRequest(_inferRequest, &_resp)) << _resp.msg; - ASSERT_EQ((int) InferenceEngine::StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_inferRequest, nullptr) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, {})); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); ASSERT_NO_THROW(_inputsInfo = _cnnNetwork.getInputsInfo()); ASSERT_NO_THROW(_outputsInfo = _cnnNetwork.getOutputsInfo()); @@ -237,25 +233,20 @@ class myriadLayersTestsROIPooling_smoke: public myriadLayerTestBaseWithParamgetTensorDesc().getLayout(); Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob(inpt.first.c_str(), data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(data = _inferRequest.GetBlob(inpt.first.c_str())); + SetSeed(3); if (inpt.first == _inputsInfo.begin()->first) - { GenRandomData(data); - } else - { genROIs(data, params, num_rois, method); - } + _inputMap[inpt.first] = data; } Blob::Ptr data; - ASSERT_NO_THROW(st = _inferRequest->GetBlob(_outputsInfo.begin()->first.c_str(), data, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(data = _inferRequest.GetBlob(_outputsInfo.begin()->first.c_str())); _outputMap[_outputsInfo.begin()->first] = data; } }; diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_elements_update_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_elements_update_test.hpp index a8ba6d5b07812e..0568d3bf4626fe 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_elements_update_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_elements_update_test.hpp @@ -124,35 +124,24 @@ class myriadLayersScatterElementsUpdateTest_smoke : // Create infer request and get its blobs pointers // - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr inputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inputBlob = _inferRequest.GetBlob("input")); + Blob::Ptr indicesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("indices", indicesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(indicesBlob = _inferRequest.GetBlob("indices")); + Blob::Ptr updatesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("updates", updatesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(updatesBlob = _inferRequest.GetBlob("updates")); + Blob::Ptr axisBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("axis", axisBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(axisBlob = _inferRequest.GetBlob("axis")); + Blob::Ptr outputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("scatter", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("scatter")); + Blob::Ptr referenceBlob; if (dataType == "I32") { referenceBlob = make_shared_blob(outputBlob->getTensorDesc()); @@ -202,9 +191,8 @@ class myriadLayersScatterElementsUpdateTest_smoke : outputBlob->getTensorDesc().setLayout(vpu::deviceLayout(outputLayout, layoutPreference)); referenceBlob->getTensorDesc().setLayout(vpu::deviceLayout(outputLayout, layoutPreference)); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + // // Check result // diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_update_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_update_test.hpp index 111e9a8b61b32e..f557e983f00672 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_update_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_scatter_update_test.hpp @@ -151,54 +151,42 @@ class myriadLayersScatterUpdateTest_smoke: _outputsInfo = network.getOutputsInfo(); _outputsInfo["scatter_update"]->setPrecision(Precision::FP16); - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr inputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("input", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inputBlob = _inferRequest.GetBlob("input")); + void* inputBlobData = inputBlob->buffer(); ASSERT_NE(inputBlobData, nullptr); std::copy(inputData.cbegin(), inputData.cend(), reinterpret_cast(inputBlobData)); Blob::Ptr indicesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("indices", indicesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(indicesBlob = _inferRequest.GetBlob("indices")); + void* indicesBlobData = indicesBlob->buffer(); ASSERT_NE(indicesBlobData, nullptr); std::copy(indicesData.cbegin(), indicesData.cend(), reinterpret_cast(indicesBlobData)); Blob::Ptr updatesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("updates", updatesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(updatesBlob = _inferRequest.GetBlob("updates")); + void* updatesBlobData = updatesBlob->buffer(); ASSERT_NE(updatesBlobData, nullptr); std::copy(updatesData.cbegin(), updatesData.cend(), reinterpret_cast(updatesBlobData)); Blob::Ptr axisBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("axis", axisBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(axisBlob = _inferRequest.GetBlob("axis")); + void* axisBlobData = axisBlob->buffer(); ASSERT_NE(axisBlobData, nullptr); std::copy(axisData.cbegin(), axisData.cend(), reinterpret_cast(axisBlobData)); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("scatter_update", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(outputBlob = _inferRequest.GetBlob("scatter_update")); + const void* outputBlobDataPtr = outputBlob->cbuffer(); const ie_fp16* outputBlobData = reinterpret_cast(outputBlobDataPtr); ASSERT_NE(outputBlobData, nullptr); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_strided_slice_test.h b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_strided_slice_test.h index da7cbdf0c6940b..4d5cb7141f1df7 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_strided_slice_test.h +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_strided_slice_test.h @@ -239,7 +239,6 @@ TEST_P(myriadLayersTestsStridedSlice_smoke, TestsStridedSlice) { outputsInfo["strided_slice"]->setPrecision(Precision::FP16); // Load network. - StatusCode st = GENERAL_ERROR; std::map config = { { InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO) } @@ -248,30 +247,22 @@ TEST_P(myriadLayersTestsStridedSlice_smoke, TestsStridedSlice) { config.insert({ InferenceEngine::MYRIAD_DISABLE_REORDER, CONFIG_VALUE(YES) }); } - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork( - _exeNetwork, network, config, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, config)); // Create InferRequest. - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = _exeNetwork.CreateInferRequest()); + // Input Data. InferenceEngine::Blob::Ptr inputBlob; - ASSERT_NO_THROW(st = inferRequest->GetBlob("input", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob("input")); GenRandomData(inputBlob); // Infer & get output blob. InferenceEngine::Blob::Ptr outputBlob; - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->GetBlob("strided_slice", outputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(outputBlob = inferRequest.GetBlob("strided_slice")); + // Output Reference. Blob::Ptr refBlob = InferenceEngine::make_shared_blob(outputBlob->getTensorDesc()); refBlob->allocate(); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_topk_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_topk_test.hpp index e4d0020ef5d7b4..61b8b484a2fdf8 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_topk_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_topk_test.hpp @@ -76,32 +76,22 @@ class TopKTest: public myriadLayerTestBaseWithParam _outputsInfo["topk.1"]->setLayout(defaultLayout(outputDims.size())); } - StatusCode st = OK; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, _config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, _config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + Blob::Ptr inputValuesBlob; - ASSERT_NO_THROW(st = _inferRequest->GetBlob("topk_input", inputValuesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(inputValuesBlob = _inferRequest.GetBlob("topk_input")); + GenRandomData(inputValuesBlob); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(_inferRequest.Infer()); + Blob::Ptr outputValuesBlob, outputIndicesBlob; if (outputValues) { - ASSERT_NO_THROW(st = _inferRequest->GetBlob("topk.0", outputValuesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(outputValuesBlob = _inferRequest.GetBlob("topk.0")); } if (outputIndices) { - ASSERT_NO_THROW(st = _inferRequest->GetBlob("topk.1", outputIndicesBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(outputIndicesBlob = _inferRequest.GetBlob("topk.1")); } const InferenceEngine::TensorDesc valuesDesc{dataPrecision, outputDims, defaultLayout(outputDims.size())}; diff --git a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_unsqueeze_test.hpp b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_unsqueeze_test.hpp index e28e4735b8b42e..551aac2bec62f6 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_unsqueeze_test.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/layers/myriad_layers_unsqueeze_test.hpp @@ -139,9 +139,6 @@ R"V0G0N( )V0G0N"; - InferenceEngine::StatusCode st = InferenceEngine::OK; - InferenceEngine::ResponseDesc resp; - InferenceEngine::TBlob *weights_raw = new InferenceEngine::TBlob( {InferenceEngine::Precision::U8, {indices.size() * sizeof(ie_fp16)}, diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_output_tests.hpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_output_tests.hpp index f14a3b93dc499c..6c8c084e9894cc 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_output_tests.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_output_tests.hpp @@ -18,8 +18,6 @@ class myriadGetOutput_nightly : }; TEST_P(myriadGetOutput_nightly, AddOutput) { - StatusCode st; - name_model_full = (*(std::get<0>(std::get<0>(GetParam())))); name_model_crop = (*(std::get<1>(std::get<0>(GetParam())))); name_output = std::get<1>(GetParam()); @@ -39,26 +37,19 @@ TEST_P(myriadGetOutput_nightly, AddOutput) { InferenceEngine::Blob::Ptr inputBlob; - InferenceEngine::IExecutableNetwork::Ptr exeNetwork; + InferenceEngine::ExecutableNetwork exeNetwork; std::map networkConfig; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetwork, crop_network, networkConfig, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(exeNetwork, nullptr) << _resp.msg; - - InferenceEngine::IInferRequest::Ptr inferRequest; - ASSERT_NO_THROW(st = exeNetwork->CreateInferRequest(inferRequest, &_resp)); + ASSERT_NO_THROW(exeNetwork = _vpuPluginPtr->LoadNetwork(crop_network, networkConfig)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferenceEngine::InferRequest inferRequest; + ASSERT_NO_THROW(inferRequest = exeNetwork.CreateInferRequest()); - ASSERT_NO_THROW(st = inferRequest->GetBlob(networkInputs.begin()->first.c_str(), inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inputBlob = inferRequest.GetBlob(networkInputs.begin()->first.c_str())); GenRandomData(inputBlob); InferenceEngine::Blob::Ptr output_crop; - ASSERT_NO_THROW(st = inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequest->GetBlob(networkOutputs.begin()->first.c_str(), output_crop, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequest.Infer()); + ASSERT_NO_THROW(output_crop = inferRequest.GetBlob(networkOutputs.begin()->first.c_str())); /*Full Network Infer */ @@ -66,31 +57,24 @@ TEST_P(myriadGetOutput_nightly, AddOutput) { full_network.addOutput(name_output, 0); - InferenceEngine::InputsDataMap networkInputsFull; - networkInputsFull = full_network.getInputsInfo(); - InferenceEngine::OutputsDataMap networkOutputsFull; - networkOutputsFull = full_network.getOutputsInfo(); + InferenceEngine::InputsDataMap networkInputsFull = full_network.getInputsInfo(); + InferenceEngine::OutputsDataMap networkOutputsFull = full_network.getOutputsInfo(); networkInputsFull.begin()->second->setPrecision(InferenceEngine::Precision::FP16); networkOutputsFull.begin()->second->setPrecision(InferenceEngine::Precision::FP16); (++networkOutputsFull.begin())->second->setPrecision(InferenceEngine::Precision::FP16); - InferenceEngine::IExecutableNetwork::Ptr exeNetworkFull; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(exeNetworkFull, full_network, networkConfig, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferenceEngine::ExecutableNetwork exeNetworkFull; + ASSERT_NO_THROW(exeNetworkFull = _vpuPluginPtr->LoadNetwork(full_network, networkConfig)); - InferenceEngine::IInferRequest::Ptr inferRequestFull; - ASSERT_NO_THROW(st = exeNetworkFull->CreateInferRequest(inferRequestFull, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + InferenceEngine::InferRequest inferRequestFull; + ASSERT_NO_THROW(inferRequestFull = exeNetworkFull.CreateInferRequest()); - ASSERT_NO_THROW(st = inferRequestFull->SetBlob("data", inputBlob, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequestFull.SetBlob("data", inputBlob)); InferenceEngine::Blob::Ptr output_full; - ASSERT_NO_THROW(st = inferRequestFull->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NO_THROW(st = inferRequestFull->GetBlob(name_output.c_str(), output_full, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequestFull.Infer()); + ASSERT_NO_THROW(output_full = inferRequestFull.GetBlob(name_output.c_str())); CompareCommonAbsolute(output_full, output_crop, 0.0f); } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_perf_count_tests.cpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_perf_count_tests.cpp index 87a02fb45cacc2..f3b86588fe80d1 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_perf_count_tests.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_get_perf_count_tests.cpp @@ -28,9 +28,7 @@ TEST_F(myriadGetPerformanceTests_nightly, CorrectTimings) { ASSERT_NO_THROW(_cnnNetwork = CNNNetwork(fnPtr)); - StatusCode st; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, { { CONFIG_KEY(PERF_COUNT), @@ -40,23 +38,18 @@ TEST_F(myriadGetPerformanceTests_nightly, CorrectTimings) { CONFIG_KEY(LOG_LEVEL), CONFIG_VALUE(LOG_WARNING) } - }, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + })); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); time_point start = Time::now(); - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - time_point end = Time::now(); + ASSERT_NO_THROW(_inferRequest.Infer()); + time_point end = Time::now(); double inferTime_mSec = (std::chrono::duration_cast(end - start)).count(); std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - long long stagesTime_uSec = 0; + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); + long long stagesTime_uSec = 0; for (const auto &i : perfMap) { stagesTime_uSec += i.second.realTime_uSec; } diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_extra_tests.hpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_extra_tests.hpp index 9a5460b4c3112d..f9fdb96b1ea521 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_extra_tests.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_extra_tests.hpp @@ -660,37 +660,28 @@ TEST_F(MyriadX_HW_Tests_nightly, With_3_FC_Layers) { GenRandomData(input); Blob::Ptr swOutput, hwOutput; - _inferRequest.reset(); - _exeNetwork.reset(); - - StatusCode st; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, - { - { - InferenceEngine::MYRIAD_PERF_REPORT_MODE, - InferenceEngine::MYRIAD_PER_STAGE - }, - { - InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, - CONFIG_VALUE(YES) - }, - }, - &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->SetBlob("input", input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + _inferRequest = {}; + _exeNetwork = {}; + + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, + { + { + InferenceEngine::MYRIAD_PERF_REPORT_MODE, + InferenceEngine::MYRIAD_PER_STAGE + }, + { + InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, + CONFIG_VALUE(YES) + }, + })); + + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(_inferRequest.SetBlob("input", input)); + ASSERT_NO_THROW(_inferRequest.Infer()); + std::vector results(sizeof(names) / sizeof(names[0])); for (size_t i = 0; i < sizeof(names) / sizeof(names[0]); ++i) { - ASSERT_NO_THROW(st = _inferRequest->GetBlob(names[i].c_str(), hwOutput, &_resp)); + ASSERT_NO_THROW(hwOutput = _inferRequest.GetBlob(names[i].c_str())); ASSERT_NE(hwOutput, nullptr); BufferWrapper res_ptr(hwOutput); results[i] = res_ptr[0]; diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_network_tests.hpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_network_tests.hpp index cd31caa4ad821c..35f4495f693ce9 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_network_tests.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_network_tests.hpp @@ -78,23 +78,15 @@ class MyriadX_HW_Networks_Tests_nightly : { InferenceEngine::MYRIAD_PERF_REPORT_MODE, InferenceEngine::MYRIAD_PER_STAGE } }; - StatusCode st; - - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - IInferRequest::Ptr inferRequests[NUM_REQUESTS]; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, config)); + + InferRequest inferRequests[NUM_REQUESTS]; Blob::Ptr outputs[NUM_REQUESTS]; for (int i = 0; i < NUM_REQUESTS; ++i) { - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(inferRequests[i], &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = inferRequests[i]->SetBlob(_cnnNetwork.getInputsInfo().begin()->first.c_str(), _input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = inferRequests[i]->GetBlob(_cnnNetwork.getOutputsInfo().begin()->first.c_str(), outputs[i], &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequests[i] = _exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(inferRequests[i].SetBlob(_cnnNetwork.getInputsInfo().begin()->first.c_str(), _input)); + ASSERT_NO_THROW(outputs[i] = inferRequests[i].GetBlob(_cnnNetwork.getOutputsInfo().begin()->first.c_str())); } std::vector allOutputs[NUM_REQUESTS]; @@ -104,13 +96,11 @@ class MyriadX_HW_Networks_Tests_nightly : for (int iterInd = 0; iterInd < numIters; ++iterInd) { for (int inferInd = 0; inferInd < NUM_REQUESTS; ++inferInd) { - ASSERT_NO_THROW(st = inferRequests[inferInd]->StartAsync(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(inferRequests[inferInd].StartAsync()); } for (int inferInd = 0; inferInd < NUM_REQUESTS; ++inferInd) { - ASSERT_NO_THROW(st = inferRequests[inferInd]->Wait(IInferRequest::RESULT_READY, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_EQ(StatusCode::OK, inferRequests[inferInd].Wait(IInferRequest::RESULT_READY)); } for (int inferInd = 0; inferInd < NUM_REQUESTS; ++inferInd) { diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp index 3d5b01e9352499..b1b82760b7a850 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp @@ -32,12 +32,9 @@ struct RunInfo { class MyriadX_HW_Tests_nightly : public myriadLayersTests_nightly { public: void CheckHWRun() { - StatusCode st; - std::map perfMap; - ASSERT_NO_THROW(st = _inferRequest->GetPerformanceCounts(perfMap, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - + ASSERT_NO_THROW(perfMap = _inferRequest.GetPerformanceCounts()); + std::vector> perfVec(perfMap.begin(), perfMap.end()); std::sort(perfVec.begin(), perfVec.end(), [=](const std::pair &pair1, @@ -120,10 +117,8 @@ class MyriadX_HW_Tests_nightly : public myriadLayersTests_nightly { const char* outputName, const RunInfo& runInfo, const std::string& logLevel = CONFIG_VALUE(LOG_NONE)) { - _inferRequest.reset(); - _exeNetwork.reset(); - - StatusCode st; + _inferRequest = {}; + _exeNetwork = {}; std::map config = { { InferenceEngine::MYRIAD_ENABLE_HW_ACCELERATION, runInfo.hwMode ? CONFIG_VALUE(YES) : CONFIG_VALUE(NO) }, @@ -134,20 +129,11 @@ class MyriadX_HW_Tests_nightly : public myriadLayersTests_nightly { { CONFIG_KEY(LOG_LEVEL), logLevel } }; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, config, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->SetBlob(inputName, input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->GetBlob(outputName, output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network, config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); + ASSERT_NO_THROW(_inferRequest.SetBlob(inputName, input)); + ASSERT_NO_THROW(output = _inferRequest.GetBlob(outputName)); + ASSERT_NO_THROW(_inferRequest.Infer()); } void CompareWithSW(float errorThreshold, vpu::LayoutPreference layoutPreference = vpu::LayoutPreference::ChannelMajor) { diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_infer_tests.cpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_infer_tests.cpp index cdfdff84711af2..df653d0a31b9ff 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_infer_tests.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_infer_tests.cpp @@ -48,8 +48,6 @@ TEST_F(myriadInferTests_nightly, NCHW_Input) { )V0G0N"; - StatusCode st; - ASSERT_NO_THROW(readNetwork(model)); const auto& network = _cnnNetwork; @@ -60,12 +58,8 @@ TEST_F(myriadInferTests_nightly, NCHW_Input) { _outputsInfo = network.getOutputsInfo(); _outputsInfo["power"]->setPrecision(Precision::FP16); - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - - ASSERT_NO_THROW(st = _exeNetwork->CreateInferRequest(_inferRequest, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(network)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); auto dims = _inputsInfo["data"]->getTensorDesc().getDims(); @@ -89,23 +83,12 @@ TEST_F(myriadInferTests_nightly, NCHW_Input) { inputNCHW->buffer().as()[tensorDescNCHW.offset(i)] = inputNHWC->cbuffer().as()[tensorDescNHWC.offset(i)]; } - ASSERT_NO_THROW(st = _inferRequest->SetBlob("data", inputNHWC, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->SetBlob("power", outputNHWC, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->SetBlob("data", inputNCHW, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->SetBlob("power", outputNCHW, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = _inferRequest->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.SetBlob("data", inputNHWC)); + ASSERT_NO_THROW(_inferRequest.SetBlob("power", outputNHWC)); + ASSERT_NO_THROW(_inferRequest.Infer()); + ASSERT_NO_THROW(_inferRequest.SetBlob("data", inputNCHW)); + ASSERT_NO_THROW(_inferRequest.SetBlob("power", outputNCHW)); + ASSERT_NO_THROW(_inferRequest.Infer()); CompareCommonAbsolute(outputNHWC, outputNCHW, 0.0); } @@ -222,8 +205,6 @@ TEST_F(myriadInferTests_nightly, AddOutputToConvWithReLU) { )V0G0N"; - StatusCode st; - TBlob::Ptr weights(GenWeights(8320 / sizeof(ie_fp16))); InferenceEngine::Core ie; @@ -241,23 +222,14 @@ TEST_F(myriadInferTests_nightly, AddOutputToConvWithReLU) { Blob::Ptr conv_output; { - IExecutableNetwork::Ptr conv_exe; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(conv_exe, conv_network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(conv_exe, nullptr) << _resp.msg; - - IInferRequest::Ptr conv_req; - ASSERT_NO_THROW(st = conv_exe->CreateInferRequest(conv_req, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = conv_req->SetBlob("input", input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = conv_req->GetBlob("conv", conv_output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = conv_req->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ExecutableNetwork conv_exe; + ASSERT_NO_THROW(conv_exe = _vpuPluginPtr->LoadNetwork(conv_network)); + + InferRequest conv_req; + ASSERT_NO_THROW(conv_req = conv_exe.CreateInferRequest()); + ASSERT_NO_THROW(conv_req.SetBlob("input", input)); + ASSERT_NO_THROW(conv_output = conv_req.GetBlob("conv")); + ASSERT_NO_THROW(conv_req.Infer()); } auto full_network = ie.ReadNetwork(full_model, weights); @@ -273,23 +245,14 @@ TEST_F(myriadInferTests_nightly, AddOutputToConvWithReLU) { Blob::Ptr full_output; { - IExecutableNetwork::Ptr full_exe; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(full_exe, full_network, {}, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - ASSERT_NE(full_exe, nullptr) << _resp.msg; - - IInferRequest::Ptr full_req; - ASSERT_NO_THROW(st = full_exe->CreateInferRequest(full_req, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = full_req->SetBlob("input", input, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = full_req->GetBlob("conv", full_output, &_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; - - ASSERT_NO_THROW(st = full_req->Infer(&_resp)); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ExecutableNetwork full_exe; + ASSERT_NO_THROW(full_exe = _vpuPluginPtr->LoadNetwork(full_network)); + + InferRequest full_req; + ASSERT_NO_THROW(full_req = full_exe.CreateInferRequest()); + ASSERT_NO_THROW(full_req.SetBlob("input", input)); + ASSERT_NO_THROW(full_output = full_req.GetBlob("conv")); + ASSERT_NO_THROW(full_req.Infer()); } CompareCommonAbsolute(full_output, conv_output, 0.0f); diff --git a/inference-engine/tests_deprecated/functional/vpu/common/myriad_merge_permute_tests.hpp b/inference-engine/tests_deprecated/functional/vpu/common/myriad_merge_permute_tests.hpp index c23e7c75f4913f..69a80f9e2156f5 100644 --- a/inference-engine/tests_deprecated/functional/vpu/common/myriad_merge_permute_tests.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/common/myriad_merge_permute_tests.hpp @@ -49,8 +49,7 @@ class myriadLayersMergePermuteNDTests_nightly: IE_ASSERT(generateNetAndInfer(NetworkInitParams().useHWOpt(CheckMyriadX()).runRefGraph(false))); - std::map perfMap; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); + auto perfMap = _inferRequest.GetPerformanceCounts(); executionMicroseconds = 0; for (const auto& perfPair : perfMap) { diff --git a/inference-engine/tests_deprecated/functional/vpu/graph_transformer/gt_functional_tests.cpp b/inference-engine/tests_deprecated/functional/vpu/graph_transformer/gt_functional_tests.cpp index ce355a8c5218da..6e17719a5f34d7 100644 --- a/inference-engine/tests_deprecated/functional/vpu/graph_transformer/gt_functional_tests.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/graph_transformer/gt_functional_tests.cpp @@ -53,8 +53,8 @@ void graphTransformerFunctionalTests::PrepareGraphCompilation() { // For the new network plugin tries to find new free device first (already booted or not booted), // then to reuse busy devices. If we release the executable network, it marks its device as free and booted. // Next network will find such device and will use it without boot, which is the fastest case. - _executableNetwork = ExecutableNetwork(); - _inferRequest = nullptr; + _executableNetwork = {}; + _inferRequest = {}; CreateModel(); } @@ -101,8 +101,7 @@ int64_t graphTransformerFunctionalTests::CompileAndInfer(Blob::Ptr& inputBlob, B IE_ASSERT(Infer()); - std::map perfMap; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); + auto perfMap = _inferRequest.GetPerformanceCounts(); int64_t executionMicroseconds = 0; for (const auto& perfPair : perfMap) { diff --git a/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_configs_tests.cpp b/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_configs_tests.cpp index 32f02380cbc63e..ec4259dbb0a8b5 100644 --- a/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_configs_tests.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_configs_tests.cpp @@ -21,45 +21,37 @@ typedef myriadLayerTestBaseWithParam myriadIncorrectModelsConfigsTests //------------------------------------------------------------------------------ TEST_P(myriadCorrectModelsConfigsTests_nightly, LoadNetworkWithCorrectConfig) { - InferenceEngine::ResponseDesc response; const auto &config = GetParam(); DISABLE_IF(!hasAppropriateStick(config)); InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat()); - InferenceEngine::IExecutableNetwork::Ptr executable; - InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response); - - ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg; + InferenceEngine::ExecutableNetwork executable; + ASSERT_NO_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config)); } TEST_P(myriadCorrectModelsConfigsTests_nightly, CreateInferRequestWithAvailableDevice) { - InferenceEngine::ResponseDesc response; const auto &config = GetParam(); DISABLE_IF(!hasAppropriateStick(config)); InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat()); - InferenceEngine::IExecutableNetwork::Ptr executable; - InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response); - ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg; + InferenceEngine::ExecutableNetwork executable; + ASSERT_NO_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config)); - InferenceEngine::IInferRequest::Ptr request; - sts = executable->CreateInferRequest(request, &response); - ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg; + InferenceEngine::InferRequest request; + ASSERT_NO_THROW(request = executable.CreateInferRequest()); } TEST_P(myriadCorrectModelsConfigsTests_nightly, CreateInferRequestWithUnavailableDevice) { - InferenceEngine::ResponseDesc response; const auto &config = GetParam(); DISABLE_IF(hasAppropriateStick(config)); InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat()); - InferenceEngine::IExecutableNetwork::Ptr executable; - InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response); - ASSERT_EQ(InferenceEngine::StatusCode::OK, sts) << response.msg; + InferenceEngine::ExecutableNetwork executable; + ASSERT_NO_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config)); - InferenceEngine::IInferRequest::Ptr request; - sts = executable->CreateInferRequest(request, &response); - ASSERT_EQ(InferenceEngine::StatusCode::GENERAL_ERROR, sts) << response.msg; + InferenceEngine::InferRequest request; + ASSERT_THROW(request = executable.CreateInferRequest(), + InferenceEngine::details::InferenceEngineException); } //------------------------------------------------------------------------------ @@ -67,14 +59,12 @@ TEST_P(myriadCorrectModelsConfigsTests_nightly, CreateInferRequestWithUnavailabl //------------------------------------------------------------------------------ TEST_P(myriadIncorrectModelsConfigsTests_nightly, LoadNetworkWithIncorrectConfig) { - InferenceEngine::ResponseDesc response; const auto &config = GetParam(); InferenceEngine::CNNNetwork net(ngraph::builder::subgraph::makeSplitConvConcat()); - InferenceEngine::IExecutableNetwork::Ptr executable; - InferenceEngine::StatusCode sts = _vpuPluginPtr->LoadNetwork(executable, net, config, &response); - - ASSERT_EQ(InferenceEngine::StatusCode::GENERAL_ERROR, sts) << response.msg; + InferenceEngine::ExecutableNetwork executable; + ASSERT_THROW(executable = _vpuPluginPtr->LoadNetwork(net, config), + InferenceEngine::details::InferenceEngineException); } //------------------------------------------------------------------------------ diff --git a/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_multiple_graph_tests.cpp b/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_multiple_graph_tests.cpp index ad6fadbda3bd18..552b09d86882ee 100644 --- a/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_multiple_graph_tests.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/myriad_tests/myriad_multiple_graph_tests.cpp @@ -17,12 +17,9 @@ typedef myriadLayerTestBaseWithParam myriadMultipleGraphsTests_night TEST_P(myriadMultipleGraphsTests_nightly, LoadGraphsOnDevice) { ASSERT_NO_THROW(_cnnNetwork = InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitConvConcat())); const int num_graphs = GetParam(); - StatusCode st; - std::vector exeNetwork(num_graphs); - std::map networkConfig; + std::vector exeNetworks(num_graphs); for (int i = 0; i < num_graphs; ++i) { - st = _vpuPluginPtr->LoadNetwork(exeNetwork[i], _cnnNetwork, networkConfig, &_resp); - ASSERT_EQ(StatusCode::OK, st) << _resp.msg; + ASSERT_NO_THROW(exeNetworks[i] = _vpuPluginPtr->LoadNetwork(_cnnNetwork)); } } diff --git a/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.cpp b/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.cpp index 9a5be0b1b58338..3bcbda4728713f 100644 --- a/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.cpp +++ b/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.cpp @@ -48,7 +48,7 @@ void vpuLayersTests::TearDown() { _cnnNetwork.serialize(xmlName, weightsName); std::string blobName = filename + ".blob"; - _exeNetwork->Export(blobName, nullptr); + ASSERT_NO_THROW(_exeNetwork.Export(blobName)); } } @@ -76,8 +76,7 @@ Blob::Ptr vpuLayersTests::getReferenceOutput() { } void vpuLayersTests::dumpPerformance() { - std::map perfMap; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); + auto perfMap = _inferRequest.GetPerformanceCounts(); std::vector > perfVec(perfMap.begin(), perfMap.end()); std::sort(perfVec.begin(), perfVec.end(), [=](const std::pair &pair1, @@ -96,8 +95,7 @@ void vpuLayersTests::dumpPerformance() { } bool vpuLayersTests::wasCustomLayerInferred() const { - auto perfMap = std::map{}; - _inferRequest->GetPerformanceCounts(perfMap, nullptr); + auto perfMap = _inferRequest.GetPerformanceCounts(); const auto isCustomLayer = [&](const std::pair& info) { return !strcmp(info.second.exec_type, "Custom"); }; @@ -143,7 +141,7 @@ void vpuLayersTests::genInputBlobs(bool lockLayout) { ASSERT_NE(genDataCallback, nullptr); genDataCallback(inputBlob); - ASSERT_EQ(InferenceEngine::StatusCode::OK, _inferRequest->SetBlob(input.first.c_str(), inputBlob, &_resp)) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.SetBlob(input.first.c_str(), inputBlob)); _inputMap[input.first] = inputBlob; genDataCallback = _genDataCallback; @@ -158,7 +156,7 @@ void vpuLayersTests::genOutputBlobs(bool lockLayout) { for (const auto& output : _outputsInfo) { auto outputBlob = allocateBlob(output.second, lockLayout); - ASSERT_EQ(InferenceEngine::StatusCode::OK, _inferRequest->SetBlob(output.first.c_str(), outputBlob, &_resp)) << _resp.msg; + ASSERT_NO_THROW(_inferRequest.SetBlob(output.first.c_str(), outputBlob)); _outputMap[output.first] = outputBlob; } @@ -186,12 +184,8 @@ void vpuLayersTests::createInferRequest(const NetworkParams& params) { config[InferenceEngine::MYRIAD_PERF_REPORT_MODE] = InferenceEngine::MYRIAD_PER_STAGE; config[InferenceEngine::MYRIAD_FORCE_DEPRECATED_CNN_CONVERSION] = CONFIG_VALUE(NO); // Make VPU plugin be able to use NGraph network. - InferenceEngine::StatusCode st = InferenceEngine::StatusCode::GENERAL_ERROR; - ASSERT_NO_THROW(st = _vpuPluginPtr->LoadNetwork(_exeNetwork, _cnnNetwork, config, &_resp)); - ASSERT_NE(_exeNetwork, nullptr) << _resp.msg; - ASSERT_NO_THROW(_exeNetwork->CreateInferRequest(_inferRequest, &_resp)) << _resp.msg; - ASSERT_EQ((int) InferenceEngine::StatusCode::OK, st) << _resp.msg; - ASSERT_NE(_inferRequest, nullptr) << _resp.msg; + ASSERT_NO_THROW(_exeNetwork = _vpuPluginPtr->LoadNetwork(_cnnNetwork, config)); + ASSERT_NO_THROW(_inferRequest = _exeNetwork.CreateInferRequest()); genInputBlobs(params._lockLayout); genOutputBlobs(params._lockLayout); @@ -246,13 +240,12 @@ void vpuLayersTests::readNetwork(const std::string& modelFilename, const std::st } bool vpuLayersTests::Infer() { - if (_inferRequest == nullptr || - _inputMap.empty() || - _outputMap.empty()) + if (_inputMap.empty() || _outputMap.empty()) return false; - const auto st = _inferRequest->Infer(&_resp); - EXPECT_EQ(InferenceEngine::StatusCode::OK, st) << _resp.msg; + + _inferRequest.Infer(); // dumpPerformance(); + if (!_config[InferenceEngine::MYRIAD_CUSTOM_LAYERS].empty()) { EXPECT_TRUE(wasCustomLayerInferred()) << "CustomBindings.xml has been provided but Custom layer was not inferred"; @@ -271,8 +264,8 @@ bool vpuLayersTests::generateNetAndInfer(const NetworkParams& params) { void vpuLayersTests::ResetGeneratedNet() { SetSeed(DEFAULT_SEED_VALUE); - _exeNetwork.reset(); - _inferRequest.reset(); + _exeNetwork = {}; + _inferRequest = {}; } void vpuLayersTests::ResetReferenceLayers() { diff --git a/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.hpp b/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.hpp index 2f4c8d47cb4371..869b2b3b38b7a3 100644 --- a/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.hpp +++ b/inference-engine/tests_deprecated/functional/vpu/vpu_base/vpu_layers_tests.hpp @@ -111,20 +111,19 @@ class vpuLayersTests : public TestsCommon { void createInferRequest(const NetworkParams& params); protected: - IECoreAdapter::Ptr _vpuPluginPtr; + IECoreAdapter::Ptr _vpuPluginPtr; std::map _config; IRVersion _irVersion = IRVersion::v7; InferenceEngine::CNNNetwork _cnnNetwork; - InferenceEngine::ResponseDesc _resp; InferenceEngine::InputsDataMap _inputsInfo; InferenceEngine::BlobMap _inputMap; InferenceEngine::BlobMap _outputMap; InferenceEngine::OutputsDataMap _outputsInfo; - InferenceEngine::IExecutableNetwork::Ptr _exeNetwork; - InferenceEngine::IInferRequest::Ptr _inferRequest; + InferenceEngine::ExecutableNetwork _exeNetwork; + InferenceEngine::InferRequest _inferRequest; InferenceEngine::Blob::Ptr _refBlob; VpuTestNet _testNet;