CVS-48367: Enable HoldersTestOnImportedNetwork test on GNA (#4230)

This commit is contained in:
Ilya Lavrenov 2021-02-12 11:45:51 +03:00 committed by GitHub
parent 0e4650399c
commit 5fe882e550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 4 deletions

View File

@ -74,8 +74,8 @@ class GNAExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafe
using ExecutableNetworkInternal::Export;
void ExportImpl(std::ostream&) override {
THROW_IE_EXCEPTION_WITH_STATUS(NOT_IMPLEMENTED);
void Export(std::ostream& modelStream) override {
plg->Export(modelStream);
}
void SetConfig(const std::map<std::string, InferenceEngine::Parameter>& config) override {

View File

@ -1583,6 +1583,11 @@ InferenceEngine::ExecutableNetwork GNAPlugin::ImportNetwork(std::istream& networ
}
void GNAPlugin::Export(const std::string &fileName) {
std::fstream outStream(fileName, ios_base::out | ios_base::binary);
Export(outStream);
}
void GNAPlugin::Export(std::ostream &outStream) {
if (inputsDesc->ptr_inputs_global_id.empty() || outputsDesc.empty()) {
THROW_GNA_EXCEPTION << " network not loaded";
}
@ -1593,8 +1598,6 @@ void GNAPlugin::Export(const std::string &fileName) {
}
#endif
std::fstream outStream(fileName, ios_base::out | ios_base::binary);
// TODO: nnet group parameter looks only used in application - so can we move this line into load network.
IE_ASSERT(!inputsDataMap.empty());
auto inputDims = inputsDataMap.begin()->second->getTensorDesc().getDims();

View File

@ -128,6 +128,7 @@ class GNAPlugin : public InferenceEngine::IInferencePlugin {
void Wait(uint32_t sync, InferenceEngine::Blob &result) { THROW_GNA_EXCEPTION << "Not implemented"; }
void Export(const std::string &fileName);
void Export(std::ostream &networkModel);
InferenceEngine::ExecutableNetwork ImportNetwork(const std::string &modelFileName,
const std::map<std::string, std::string> &config) override {
THROW_GNA_EXCEPTION << "Not implemented";

View File

@ -27,4 +27,14 @@ namespace {
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTestImportNetwork,
::testing::Combine(
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(orders)),
HoldersTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, HoldersTestOnImportedNetwork,
::testing::Values(CommonTestUtils::DEVICE_GNA),
HoldersTestOnImportedNetwork::getTestCaseName);
} // namespace