aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCathal Corbett <cathal.corbett@arm.com>2021-12-06 17:06:12 +0000
committerCathal Corbett <cathal.corbett@arm.com>2021-12-09 15:48:23 +0000
commit5b0d887557b8fbc0594d789f8016c98cd8ee721d (patch)
tree7914a59b455408112b2ddb5fc42098d7dc1d2b5c
parent6f0dd6df4c57d226faf826d76b912fe169a8a0c6 (diff)
downloadarmnn-5b0d887557b8fbc0594d789f8016c98cd8ee721d.tar.gz
IVGCVSW-6611 ExNet prints inference time twice
* Created individual IRuntime sharedptr in ExecuteNetwork main() each time MainImpl() is called. Prevents additional runtime being created when the delegate is used. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: Ia4b508fbf2bbd25467c6235fed2f05662a7aecc0
-rw-r--r--tests/ExecuteNetwork/ExecuteNetwork.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp
index 540bfd4271..085721c6bb 100644
--- a/tests/ExecuteNetwork/ExecuteNetwork.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp
@@ -899,15 +899,13 @@ int main(int argc, const char* argv[])
return EXIT_FAILURE;
}
- // Create runtime
- std::shared_ptr<armnn::IRuntime> runtime(armnn::IRuntime::Create(ProgramOptions.m_RuntimeOptions));
-
std::string modelFormat = ProgramOptions.m_ExNetParams.m_ModelFormat;
// Forward to implementation based on the parser type
if (modelFormat.find("armnn") != std::string::npos)
{
#if defined(ARMNN_SERIALIZER)
+ std::shared_ptr<armnn::IRuntime> runtime(armnn::IRuntime::Create(ProgramOptions.m_RuntimeOptions));
return MainImpl<armnnDeserializer::IDeserializer, float>(ProgramOptions.m_ExNetParams, runtime);
#else
ARMNN_LOG(fatal) << "Not built with serialization support.";
@@ -917,6 +915,7 @@ int main(int argc, const char* argv[])
else if (modelFormat.find("onnx") != std::string::npos)
{
#if defined(ARMNN_ONNX_PARSER)
+ std::shared_ptr<armnn::IRuntime> runtime(armnn::IRuntime::Create(ProgramOptions.m_RuntimeOptions));
return MainImpl<armnnOnnxParser::IOnnxParser, float>(ProgramOptions.m_ExNetParams, runtime);
#else
ARMNN_LOG(fatal) << "Not built with Onnx parser support.";
@@ -928,10 +927,11 @@ int main(int argc, const char* argv[])
if (ProgramOptions.m_ExNetParams.m_TfLiteExecutor == ExecuteNetworkParams::TfLiteExecutor::ArmNNTfLiteParser)
{
#if defined(ARMNN_TF_LITE_PARSER)
- return MainImpl<armnnTfLiteParser::ITfLiteParser, float>(ProgramOptions.m_ExNetParams, runtime);
+ std::shared_ptr<armnn::IRuntime> runtime(armnn::IRuntime::Create(ProgramOptions.m_RuntimeOptions));
+ return MainImpl<armnnTfLiteParser::ITfLiteParser, float>(ProgramOptions.m_ExNetParams, runtime);
#else
- ARMNN_LOG(fatal) << "Not built with Tensorflow-Lite parser support.";
- return EXIT_FAILURE;
+ ARMNN_LOG(fatal) << "Not built with Tensorflow-Lite parser support.";
+ return EXIT_FAILURE;
#endif
}
else if (ProgramOptions.m_ExNetParams.m_TfLiteExecutor ==