From 549ae37b51facbdf940bff62b45b3b74c1bc63c9 Mon Sep 17 00:00:00 2001 From: Nina Drozd Date: Mon, 10 Sep 2018 14:26:44 +0100 Subject: IVGCVSW-1733 - set enableGpuProfiling in CreationOptions for Runtime if -e flag is set, false by default, use this globally same as concurrent flag, removed -e option from RunCsvTest options, this is passed in from main Change-Id: I246c2c40b1a113b896be0d41aba528e79ecdba0d --- tests/ExecuteNetwork/ExecuteNetwork.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'tests/ExecuteNetwork') diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index 2e61dfa930..ee207472d0 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -341,7 +341,7 @@ int RunTest(const std::string& modelFormat, } int RunCsvTest(const armnnUtils::CsvRow &csvRow, - const std::shared_ptr& runtime) + const std::shared_ptr& runtime, const bool enableProfiling) { std::string modelFormat; std::string modelPath; @@ -370,9 +370,7 @@ int RunCsvTest(const armnnUtils::CsvRow &csvRow, "This parameter is optional, depending on the network.") ("input-tensor-data,d", po::value(&inputTensorDataFilePath), "Path to a file containing the input data as a flat array separated by whitespace.") - ("output-name,o", po::value(&outputName), "Identifier of the output tensor in the network.") - ("event-based-profiling,e", po::bool_switch()->default_value(false), - "Enables built in profiler. If unset, defaults to off."); + ("output-name,o", po::value(&outputName), "Identifier of the output tensor in the network."); } catch (const std::exception& e) { @@ -415,9 +413,6 @@ int RunCsvTest(const armnnUtils::CsvRow &csvRow, boost::trim(inputTensorDataFilePath); boost::trim(outputName); - // Get the value of the switch arguments. - bool enableProfiling = vm["event-based-profiling"].as(); - // Get the preferred order of compute devices. std::vector computeDevices = vm["compute"].as>(); @@ -546,6 +541,8 @@ int main(int argc, const char* argv[]) // Create runtime armnn::IRuntime::CreationOptions options; + options.m_EnableGpuProfiling = enableProfiling; + std::shared_ptr runtime(armnn::IRuntime::Create(options)); const std::string executableName("ExecuteNetwork"); @@ -560,7 +557,8 @@ int main(int argc, const char* argv[]) for (auto& testCase : testCases) { testCase.values.insert(testCase.values.begin(), executableName); - results.push_back(std::async(std::launch::async, RunCsvTest, std::cref(testCase), std::cref(runtime))); + results.push_back(std::async(std::launch::async, RunCsvTest, std::cref(testCase), std::cref(runtime), + enableProfiling)); } // Check results @@ -578,7 +576,7 @@ int main(int argc, const char* argv[]) for (auto& testCase : testCases) { testCase.values.insert(testCase.values.begin(), executableName); - if (RunCsvTest(testCase, runtime) != EXIT_SUCCESS) + if (RunCsvTest(testCase, runtime, enableProfiling) != EXIT_SUCCESS) { return EXIT_FAILURE; } -- cgit v1.2.1