aboutsummaryrefslogtreecommitdiff
path: root/ArmnnDriverImpl.cpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2019-12-16 11:50:29 +0000
committerJim Flynn <jim.flynn@arm.com>2019-12-16 16:58:07 +0000
commit14557e71d55e8d26d8c7f3e3912979b54e6e86ba (patch)
treece3fd2f12fce2f662f401be46ea5f958165c95cf /ArmnnDriverImpl.cpp
parent4d3a24bc3a4900db8a647881b0b3a7a6bf387751 (diff)
downloadandroid-nn-driver-14557e71d55e8d26d8c7f3e3912979b54e6e86ba.tar.gz
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.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp
index df04ef9c..cbb2e642 100644
--- a/ArmnnDriverImpl.cpp
+++ b/ArmnnDriverImpl.cpp
@@ -129,6 +129,10 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
return ErrorStatus::NONE;
}
+ // Export the optimized network graph to a dot file if an output dump directory
+ // has been specified in the drivers' arguments.
+ std::string dotGraphFileName = ExportNetworkGraphToDotFile(*optNet, options.GetRequestInputsAndOutputsDumpDir());
+
// Load it into the runtime.
armnn::NetworkId netId = 0;
try
@@ -146,9 +150,11 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
return ErrorStatus::NONE;
}
- // 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(), netId);
+ // 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<ArmnnPreparedModel<HalPolicy>> preparedModel(
new ArmnnPreparedModel<HalPolicy>(
@@ -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;