aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2019-10-03 10:04:30 -0700
committerJim Flynn Arm <jim.flynn@arm.com>2019-10-04 10:54:17 +0000
commit4951b8c62905ffec880bf304b00aac5cffc6c9ac (patch)
treeb28b0d8220220e0eae5972467f4be131aca5256a /tests
parentc6e5a6e9f146ecb95704d6fa80fae8465241f09e (diff)
downloadarmnn-4951b8c62905ffec880bf304b00aac5cffc6c9ac.tar.gz
IVGCVSW-3948 Adds External Profiling cmdline to ExecuteNetwork
Change-Id: If172bcb64e8202abbde4b8a6cee14f672bc259cd Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ExecuteNetwork/ExecuteNetwork.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp
index d97a19928c..2309a8b0eb 100644
--- a/tests/ExecuteNetwork/ExecuteNetwork.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp
@@ -30,6 +30,11 @@ int main(int argc, const char* argv[])
std::string dynamicBackendsPath;
std::string outputTensorFiles;
+ // external profiling parameters
+ std::string outgoingCaptureFile;
+ std::string incomingCaptureFile;
+ uint32_t counterCapturePeriod;
+
double thresholdTime = 0.0;
size_t subgraphId = 0;
@@ -95,7 +100,17 @@ int main(int argc, const char* argv[])
"inference time is greater than the threshold time, the test will fail. By default, no threshold "
"time is used.")
("print-intermediate-layers,p", po::bool_switch()->default_value(false),
- "If this option is enabled, the output of every graph layer will be printed.");
+ "If this option is enabled, the output of every graph layer will be printed.")
+ ("enable-external-profiling,a", po::bool_switch()->default_value(false),
+ "If enabled external profiling will be switched on")
+ ("outgoing-capture-file,j", po::value(&outgoingCaptureFile),
+ "If specified the outgoing external profiling packets will be captured in this binary file")
+ ("incoming-capture-file,k", po::value(&incomingCaptureFile),
+ "If specified the incoming external profiling packets will be captured in this binary file")
+ ("file-only-external-profiling,g", po::bool_switch()->default_value(false),
+ "If enabled then the 'file-only' test mode of external profiling will be enabled")
+ ("counter-capture-period,u", po::value<uint32_t>(&counterCapturePeriod)->default_value(150u),
+ "If profiling is enabled in 'file-only' mode this is the capture period that will be used in the test");
}
catch (const std::exception& e)
{
@@ -138,6 +153,8 @@ int main(int argc, const char* argv[])
bool enableFp16TurboMode = vm["fp16-turbo-mode"].as<bool>();
bool quantizeInput = vm["quantize-input"].as<bool>();
bool printIntermediate = vm["print-intermediate-layers"].as<bool>();
+ bool enableExternalProfiling = vm["enable-external-profiling"].as<bool>();
+ bool fileOnlyExternalProfiling = vm["file-only-external-profiling"].as<bool>();
// Check whether we have to load test cases from a file.
if (CheckOption(vm, "test-cases"))
@@ -163,6 +180,11 @@ int main(int argc, const char* argv[])
// Create runtime
armnn::IRuntime::CreationOptions options;
options.m_EnableGpuProfiling = enableProfiling;
+ options.m_ProfilingOptions.m_EnableProfiling = enableExternalProfiling;
+ options.m_ProfilingOptions.m_IncomingCaptureFile = incomingCaptureFile;
+ options.m_ProfilingOptions.m_OutgoingCaptureFile = outgoingCaptureFile;
+ options.m_ProfilingOptions.m_FileOnly = fileOnlyExternalProfiling;
+ options.m_ProfilingOptions.m_CapturePeriod = counterCapturePeriod;
std::shared_ptr<armnn::IRuntime> runtime(armnn::IRuntime::Create(options));