aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2021-08-18 17:14:05 +0100
committerNikhil Raj Arm <nikhil.raj@arm.com>2021-08-20 09:10:22 +0000
commit4914d0c1f4cbb01fe276a7093af4cff13270b74a (patch)
treece6c4364bb596803148833af535215aa6ab6de90 /tests
parente369dbddae66c58f4b444c4b25871c10af19ed9d (diff)
downloadarmnn-4914d0c1f4cbb01fe276a7093af4cff13270b74a.tar.gz
IVGCVSW-6249 Add ProfilingDetails Macros to all workloads in Ref, Neon, CL
* Add functionality to only output network details in ExNet Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: I0c45e67193f308ce7b86f1bb1a918a266fefba2e
Diffstat (limited to 'tests')
-rw-r--r--tests/ExecuteNetwork/ExecuteNetwork.cpp5
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkParams.hpp1
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp9
-rw-r--r--tests/InferenceModel.hpp14
4 files changed, 24 insertions, 5 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp
index 64296d31b7..9a4864542f 100644
--- a/tests/ExecuteNetwork/ExecuteNetwork.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp
@@ -325,6 +325,7 @@ int MainImpl(const ExecuteNetworkParams& params,
inferenceModelParams.m_AsyncEnabled = params.m_Concurrent;
inferenceModelParams.m_ThreadPoolSize = params.m_ThreadPoolSize;
inferenceModelParams.m_OutputDetailsToStdOut = params.m_OutputDetailsToStdOut;
+ inferenceModelParams.m_OutputDetailsOnlyToStdOut = params.m_OutputDetailsOnlyToStdOut;
for(const std::string& inputName: params.m_InputNames)
{
@@ -769,7 +770,9 @@ int main(int argc, const char* argv[])
return EXIT_FAILURE;
}
- if (ProgramOptions.m_ExNetParams.m_OutputDetailsToStdOut && !ProgramOptions.m_ExNetParams.m_EnableProfiling)
+ if ((ProgramOptions.m_ExNetParams.m_OutputDetailsToStdOut ||
+ ProgramOptions.m_ExNetParams.m_OutputDetailsOnlyToStdOut)
+ && !ProgramOptions.m_ExNetParams.m_EnableProfiling)
{
ARMNN_LOG(fatal) << "You must enable profiling if you would like to output layer details";
return EXIT_FAILURE;
diff --git a/tests/ExecuteNetwork/ExecuteNetworkParams.hpp b/tests/ExecuteNetwork/ExecuteNetworkParams.hpp
index 97c605b0a7..e519b028a0 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkParams.hpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkParams.hpp
@@ -44,6 +44,7 @@ struct ExecuteNetworkParams
std::string m_ModelPath;
unsigned int m_NumberOfThreads;
bool m_OutputDetailsToStdOut;
+ bool m_OutputDetailsOnlyToStdOut;
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 1fd4b3d96d..927d804725 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
@@ -410,9 +410,14 @@ ProgramOptions::ProgramOptions() : m_CxxOptions{"ExecuteNetwork",
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.",
+ "Outputs layer tensor infos and descriptors to std out along with profiling events. Defaults to off.",
cxxopts::value<bool>(m_ExNetParams.m_OutputDetailsToStdOut)->default_value("false")
- ->implicit_value("true"));
+ ->implicit_value("true"))
+ ("output-network-details-only",
+ "Outputs layer tensor infos and descriptors to std out without profiling events. Defaults to off.",
+ cxxopts::value<bool>(m_ExNetParams.m_OutputDetailsOnlyToStdOut)->default_value("false")
+ ->implicit_value("true"));
+
}
catch (const std::exception& e)
{
diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp
index 1db287f453..b982df396d 100644
--- a/tests/InferenceModel.hpp
+++ b/tests/InferenceModel.hpp
@@ -101,6 +101,7 @@ struct Params
bool m_EnableFastMath;
bool m_SaveCachedNetwork;
bool m_OutputDetailsToStdOut;
+ bool m_OutputDetailsOnlyToStdOut;
std::string m_CachedNetworkFilePath;
unsigned int m_NumberOfThreads;
std::string m_MLGOTuningFilePath;
@@ -121,6 +122,7 @@ struct Params
, m_EnableFastMath(false)
, m_SaveCachedNetwork(false)
, m_OutputDetailsToStdOut(false)
+ , m_OutputDetailsOnlyToStdOut(false)
, m_CachedNetworkFilePath("")
, m_NumberOfThreads(0)
, m_MLGOTuningFilePath("")
@@ -406,7 +408,8 @@ public:
bool enableProfiling,
const std::string& dynamicBackendsPath,
const std::shared_ptr<armnn::IRuntime>& runtime = nullptr)
- : m_EnableProfiling(enableProfiling)
+ : m_EnableProfiling(enableProfiling),
+ m_ProfilingDetailsMethod(armnn::ProfilingDetailsMethod::Undefined)
, m_DynamicBackendsPath(dynamicBackendsPath)
{
if (runtime)
@@ -421,6 +424,12 @@ public:
m_Runtime = armnn::IRuntime::Create(options);
}
+ // Configure the Profiler if the the profiling details are opted for
+ if (params.m_OutputDetailsOnlyToStdOut)
+ m_ProfilingDetailsMethod = armnn::ProfilingDetailsMethod::DetailsOnly;
+ else if (params.m_OutputDetailsToStdOut)
+ m_ProfilingDetailsMethod = armnn::ProfilingDetailsMethod::DetailsWithEvents;
+
std::string invalidBackends;
if (!CheckRequestedBackendsAreValid(params.m_ComputeDevices, armnn::Optional<std::string&>(invalidBackends)))
{
@@ -492,7 +501,7 @@ public:
armnn::MemorySource::Undefined,
armnn::MemorySource::Undefined,
enableProfiling,
- params.m_OutputDetailsToStdOut);
+ m_ProfilingDetailsMethod);
std::string errorMessage;
ret = m_Runtime->LoadNetwork(m_NetworkIdentifier, std::move(optNet), errorMessage, networkProperties);
@@ -744,6 +753,7 @@ private:
std::vector<armnn::BindingPointInfo> m_InputBindings;
std::vector<armnn::BindingPointInfo> m_OutputBindings;
bool m_EnableProfiling;
+ armnn::ProfilingDetailsMethod m_ProfilingDetailsMethod;
std::string m_DynamicBackendsPath;
template<typename TContainer>