From d7fcafaaaa917db458be362060e1b7855cad8083 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Thu, 23 Apr 2020 17:55:18 +0100 Subject: IVGCVSW-4722 Add missing m_TimelineEnabled bool to ConnectionAcknowledgedCommandHandler * Added timeline bool to ConnectionAcknowledgedCommandHandler * Added option to enable timeline profiling in ExecuteNetwork * Added CommandHandler stub to allow gatordMock to ignore packets Signed-off-by: Finn Williams Change-Id: I314f9411e0079cba8f103d3b8a89f2bf38bb21ab --- tests/ExecuteNetwork/ExecuteNetwork.cpp | 39 +++++++++++++++++---------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'tests/ExecuteNetwork/ExecuteNetwork.cpp') diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index 9252a463cb..7dc9b65385 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -109,6 +109,8 @@ int main(int argc, const char* argv[]) "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") + ("timeline-profiling", po::bool_switch()->default_value(false), + "If enabled timeline profiling will be switched on, requires external profiling") ("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), @@ -168,6 +170,7 @@ int main(int argc, const char* argv[]) bool enableExternalProfiling = vm["enable-external-profiling"].as(); bool fileOnlyExternalProfiling = vm["file-only-external-profiling"].as(); bool parseUnsupported = vm["parse-unsupported"].as(); + bool timelineEnabled = vm["timeline-profiling"].as(); if (enableBf16TurboMode && enableFp16TurboMode) { @@ -175,6 +178,23 @@ int main(int argc, const char* argv[]) return EXIT_FAILURE; } + // Create runtime + armnn::IRuntime::CreationOptions options; + options.m_EnableGpuProfiling = enableProfiling; + options.m_DynamicBackendsPath = dynamicBackendsPath; + 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; + options.m_ProfilingOptions.m_FileFormat = fileFormat; + options.m_ProfilingOptions.m_TimelineEnabled = timelineEnabled; + + if (timelineEnabled && !enableExternalProfiling) + { + ARMNN_LOG(fatal) << "Timeline profiling requires external profiling to be turned on"; + return EXIT_FAILURE; + } // Check whether we have to load test cases from a file. if (CheckOption(vm, "test-cases")) @@ -196,17 +216,7 @@ int main(int argc, const char* argv[]) ARMNN_LOG(fatal) << "Given file \"" << testCasesFile << "\" has no test cases"; return EXIT_FAILURE; } - // Create runtime - armnn::IRuntime::CreationOptions options; - options.m_EnableGpuProfiling = enableProfiling; - options.m_DynamicBackendsPath = dynamicBackendsPath; - 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; - options.m_ProfilingOptions.m_FileFormat = fileFormat; std::shared_ptr runtime(armnn::IRuntime::Create(options)); const std::string executableName("ExecuteNetwork"); @@ -276,15 +286,6 @@ int main(int argc, const char* argv[]) return EXIT_FAILURE; } // Create runtime - armnn::IRuntime::CreationOptions options; - options.m_EnableGpuProfiling = enableProfiling; - options.m_DynamicBackendsPath = dynamicBackendsPath; - 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; - options.m_ProfilingOptions.m_FileFormat = fileFormat; std::shared_ptr runtime(armnn::IRuntime::Create(options)); return RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames, -- cgit v1.2.1