diff options
author | Jim Flynn <jim.flynn@arm.com> | 2019-12-13 14:43:24 +0000 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2020-01-24 14:49:52 +0000 |
commit | 829ad30a4f13bc0b9cb32bab5a4efeeeab541f76 (patch) | |
tree | 21fcbeca2f1f94c6a82863ae52aa8aa536f53106 /ArmnnDriverImpl.cpp | |
parent | 1bde8e31935ac375fd0aaa0dfddb0f7851c16087 (diff) | |
download | android-nn-driver-829ad30a4f13bc0b9cb32bab5a4efeeeab541f76.tar.gz |
IVGCVSW-4270 Change .dot file name to start with netId
* .dot file will start with the same number as the associated input
and output tensor dump files
Change-Id: Ic64539854c2b8c34a7034fa18a142b2dfe67df7d
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
IVGCVSW-4271 Add getSupportedOperations marker file
* Also fix segfault in previous graph dump code
Change-Id: I01915f47ae17d89ad3595430d073a17b1a1fda58
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'ArmnnDriverImpl.cpp')
-rw-r--r-- | ArmnnDriverImpl.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp index 9fe2c0e7..14af3c06 100644 --- a/ArmnnDriverImpl.cpp +++ b/ArmnnDriverImpl.cpp @@ -131,7 +131,7 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel( // Export the optimized network graph to a dot file if an output dump directory // has been specified in the drivers' arguments. - ExportNetworkGraphToDotFile<HalModel>(*optNet, options.GetRequestInputsAndOutputsDumpDir(), model); + std::string dotGraphFileName = ExportNetworkGraphToDotFile(*optNet, options.GetRequestInputsAndOutputsDumpDir()); // Load it into the runtime. armnn::NetworkId netId = 0; @@ -150,6 +150,12 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel( return ErrorStatus::NONE; } + // 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); + sp<ArmnnPreparedModel<HalPolicy>> preparedModel( new ArmnnPreparedModel<HalPolicy>( netId, @@ -191,7 +197,31 @@ Return<void> ArmnnDriverImpl<HalPolicy>::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<bool> result; |