From d2697984e7d7989f5a8154c46a1bf37d98479415 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Mon, 16 Dec 2019 11:50:29 +0000 Subject: IVGCVSW-4271 Add getSupportedOperations marker file * Also fix segfault in previous graph dump code * Cherry picked from 19.08 (https://jira.arm.com/browse/IVGCVSW-4297) Change-Id: Id4f2e89f5126b7962b4439370e6dd3edcee96f51 Signed-off-by: Jim Flynn --- ArmnnDriverImpl.cpp | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'ArmnnDriverImpl.cpp') diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp index 46c4e577..cbb2e642 100644 --- a/ArmnnDriverImpl.cpp +++ b/ArmnnDriverImpl.cpp @@ -131,7 +131,7 @@ Return ArmnnDriverImpl::prepareModel( // Export the optimized network graph to a dot file if an output dump directory // has been specified in the drivers' arguments. - ExportNetworkGraphToDotFile(*optNet, options.GetRequestInputsAndOutputsDumpDir(), model); + std::string dotGraphFileName = ExportNetworkGraphToDotFile(*optNet, options.GetRequestInputsAndOutputsDumpDir()); // Load it into the runtime. armnn::NetworkId netId = 0; @@ -150,7 +150,13 @@ Return ArmnnDriverImpl::prepareModel( return ErrorStatus::NONE; } - sp> preparedModel( + // Now that we have a networkId for the graph rename the dump file to use it + // so that we can associate the graph file and the input/output tensor dump files + RenameGraphDotFile(dotGraphFileName, + options.GetRequestInputsAndOutputsDumpDir(), + netId); + + unique_ptr> preparedModel( new ArmnnPreparedModel( netId, runtime.get(), @@ -180,7 +186,7 @@ Return ArmnnDriverImpl::prepareModel( } } - NotifyCallbackAndCheck(cb, ErrorStatus::NONE, preparedModel); + NotifyCallbackAndCheck(cb, ErrorStatus::NONE, preparedModel.release()); return ErrorStatus::NONE; } @@ -191,7 +197,31 @@ Return ArmnnDriverImpl::getSupportedOperations(const armnn::IRu const HalModel& model, HalGetSupportedOperations_cb cb) { - ALOGV("ArmnnDriverImpl::getSupportedOperations()"); + std::stringstream ss; + ss << "ArmnnDriverImpl::getSupportedOperations()"; + std::string fileName; + std::string timestamp; + if (!options.GetRequestInputsAndOutputsDumpDir().empty()) + { + timestamp = GetFileTimestamp(); + fileName = boost::str(boost::format("%1%/%2%_getSupportedOperations.txt") + % options.GetRequestInputsAndOutputsDumpDir() + % timestamp); + ss << " : " << fileName; + } + ALOGV(ss.str().c_str()); + + if (!options.GetRequestInputsAndOutputsDumpDir().empty()) + { + //dump the marker file + std::ofstream fileStream; + fileStream.open(fileName, std::ofstream::out | std::ofstream::trunc); + if (fileStream.good()) + { + fileStream << timestamp << std::endl; + } + fileStream.close(); + } vector result; -- cgit v1.2.1