aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2021-08-09 16:49:18 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2021-08-10 14:07:27 +0000
commitf487486c843a38fced90229923433d09f99fc2e5 (patch)
tree63a2268196279a5c97c3b9dea86024f0bf4a751e /tests
parentbcd860a30eba22bb2ba0943ad705734ce0ec5b23 (diff)
downloadarmnn-f487486c843a38fced90229923433d09f99fc2e5.tar.gz
IVGCVSW-6292 Allow profiling details to be switched off during profiling
* Add switch for network details during profiling Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I8bd49fd58f0e0255598106e9ab36806ee78391d6
Diffstat (limited to 'tests')
-rw-r--r--tests/ExecuteNetwork/ExecuteNetwork.cpp7
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkParams.hpp1
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp7
-rw-r--r--tests/InferenceModel.hpp5
4 files changed, 18 insertions, 2 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp
index e757d2c992..64296d31b7 100644
--- a/tests/ExecuteNetwork/ExecuteNetwork.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp
@@ -324,6 +324,7 @@ int MainImpl(const ExecuteNetworkParams& params,
inferenceModelParams.m_MLGOTuningFilePath = params.m_MLGOTuningFilePath;
inferenceModelParams.m_AsyncEnabled = params.m_Concurrent;
inferenceModelParams.m_ThreadPoolSize = params.m_ThreadPoolSize;
+ inferenceModelParams.m_OutputDetailsToStdOut = params.m_OutputDetailsToStdOut;
for(const std::string& inputName: params.m_InputNames)
{
@@ -768,6 +769,12 @@ int main(int argc, const char* argv[])
return EXIT_FAILURE;
}
+ if (ProgramOptions.m_ExNetParams.m_OutputDetailsToStdOut && !ProgramOptions.m_ExNetParams.m_EnableProfiling)
+ {
+ ARMNN_LOG(fatal) << "You must enable profiling if you would like to output layer details";
+ return EXIT_FAILURE;
+ }
+
// Create runtime
std::shared_ptr<armnn::IRuntime> runtime(armnn::IRuntime::Create(ProgramOptions.m_RuntimeOptions));
diff --git a/tests/ExecuteNetwork/ExecuteNetworkParams.hpp b/tests/ExecuteNetwork/ExecuteNetworkParams.hpp
index fe0c446087..97c605b0a7 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkParams.hpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkParams.hpp
@@ -43,6 +43,7 @@ struct ExecuteNetworkParams
std::string m_ModelFormat;
std::string m_ModelPath;
unsigned int m_NumberOfThreads;
+ bool m_OutputDetailsToStdOut;
std::vector<std::string> m_OutputNames;
std::vector<std::string> m_OutputTensorFiles;
std::vector<std::string> m_OutputTypes;
diff --git a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
index 6ac64ffff2..1fd4b3d96d 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
@@ -407,7 +407,12 @@ ProgramOptions::ProgramOptions() : m_CxxOptions{"ExecuteNetwork",
("u,counter-capture-period",
"If profiling is enabled in 'file-only' mode this is the capture period that will be used in the test",
- cxxopts::value<uint32_t>(m_RuntimeOptions.m_ProfilingOptions.m_CapturePeriod)->default_value("150"));
+ cxxopts::value<uint32_t>(m_RuntimeOptions.m_ProfilingOptions.m_CapturePeriod)->default_value("150"))
+
+ ("output-network-details",
+ "Outputs layer tensor infos and descriptors to std out. Defaults to off.",
+ cxxopts::value<bool>(m_ExNetParams.m_OutputDetailsToStdOut)->default_value("false")
+ ->implicit_value("true"));
}
catch (const std::exception& e)
{
diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp
index 4d2b167522..1db287f453 100644
--- a/tests/InferenceModel.hpp
+++ b/tests/InferenceModel.hpp
@@ -100,6 +100,7 @@ struct Params
bool m_InferOutputShape;
bool m_EnableFastMath;
bool m_SaveCachedNetwork;
+ bool m_OutputDetailsToStdOut;
std::string m_CachedNetworkFilePath;
unsigned int m_NumberOfThreads;
std::string m_MLGOTuningFilePath;
@@ -119,6 +120,7 @@ struct Params
, m_InferOutputShape(false)
, m_EnableFastMath(false)
, m_SaveCachedNetwork(false)
+ , m_OutputDetailsToStdOut(false)
, m_CachedNetworkFilePath("")
, m_NumberOfThreads(0)
, m_MLGOTuningFilePath("")
@@ -489,7 +491,8 @@ public:
armnn::INetworkProperties networkProperties(params.m_AsyncEnabled,
armnn::MemorySource::Undefined,
armnn::MemorySource::Undefined,
- enableProfiling);
+ enableProfiling,
+ params.m_OutputDetailsToStdOut);
std::string errorMessage;
ret = m_Runtime->LoadNetwork(m_NetworkIdentifier, std::move(optNet), errorMessage, networkProperties);