IVGCVSW-7235 Errors from LoadNetwork are being ignored in ArmNNExecutor.
In ArmNNExecutor::ArmNNExecutor the call to m_Runtime->LoadNetwork was
ignoring the Status result and continuing to execute with a failed
network. In addition throwing an exception from the constructor resulted
in a segmentation fault.
* Modify IExecutor to allow the constructor to mark itself as failed.
* Modify ArmNNExecutor to mark itself as failed when LoadNetwork returns
an error.
* Modify ExecuteNetwork to check the value of m_constructionFailed.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: Idf222cb2b66e1051875dc67046734f2b00b288d1
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp
index e9ebd0d..c6c8cc0 100644
--- a/tests/ExecuteNetwork/ExecuteNetwork.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp
@@ -55,13 +55,22 @@
}
std::vector<const void*> outputResults;
-
- auto executor = BuildExecutor(programOptions);
- if (!executor)
+ std::unique_ptr<IExecutor> executor;
+ try
{
+ executor = BuildExecutor(programOptions);
+ if (executor->m_constructionFailed)
+ {
+ return EXIT_FAILURE;
+ }
+ }
+ catch (const std::exception& e)
+ {
+ ARMNN_LOG(fatal) << e.what();
return EXIT_FAILURE;
}
+
executor->PrintNetworkInfo();
outputResults = executor->Execute();