diff options
author | Jim Flynn <jim.flynn@arm.com> | 2019-12-16 11:50:29 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2019-12-18 10:03:43 +0000 |
commit | d2697984e7d7989f5a8154c46a1bf37d98479415 (patch) | |
tree | b66502b18ef6e0723b5021ab86be55ffea75c15a /Utils.hpp | |
parent | dbbcc3948190d874d80f1f095fcbda65d693519d (diff) | |
download | android-nn-driver-d2697984e7d7989f5a8154c46a1bf37d98479415.tar.gz |
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 <jim.flynn@arm.com>
Diffstat (limited to 'Utils.hpp')
-rw-r--r-- | Utils.hpp | 43 |
1 files changed, 5 insertions, 38 deletions
@@ -104,47 +104,14 @@ void DumpJsonProfilingIfRequired(bool gpuProfilingEnabled, armnn::NetworkId networkId, const armnn::IProfiler* profiler); -template <typename HalModel> -void ExportNetworkGraphToDotFile(const armnn::IOptimizedNetwork& optimizedNetwork, - const std::string& dumpDir, - const HalModel& model) -{ - // The dump directory must exist in advance. - if (dumpDir.empty()) - { - return; - } - - // Get the memory address of the model and convert it to a hex string (of at least a '0' character). - size_t modelAddress = uintptr_t(&model); - std::stringstream ss; - ss << std::uppercase << std::hex << std::setfill('0') << std::setw(1) << modelAddress; - std::string modelAddressHexString = ss.str(); - - // Set the name of the output .dot file. - const std::string fileName = boost::str(boost::format("%1%/networkgraph_%2%.dot") - % dumpDir - % modelAddressHexString); - - ALOGV("Exporting the optimized network graph to file: %s", fileName.c_str()); +std::string ExportNetworkGraphToDotFile(const armnn::IOptimizedNetwork& optimizedNetwork, + const std::string& dumpDir); - // Write the network graph to a dot file. - std::ofstream fileStream; - fileStream.open(fileName, std::ofstream::out | std::ofstream::trunc); - - if (!fileStream.good()) - { - ALOGW("Could not open file %s for writing", fileName.c_str()); - return; - } - - if (optimizedNetwork.SerializeToDot(fileStream) != armnn::Status::Success) - { - ALOGW("An error occurred when writing to file %s", fileName.c_str()); - } -} +void RenameGraphDotFile(const std::string& oldName, const std::string& dumpDir, const armnn::NetworkId networkId); /// Checks if a tensor info represents a dynamic tensor bool IsDynamicTensor(const armnn::TensorInfo& outputInfo); +std::string GetFileTimestamp(); + } // namespace armnn_driver |