diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-01-13 15:56:51 +0000 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-01-13 15:56:51 +0000 |
commit | b3021435ad91e494af01ca0778915877dc0780c0 (patch) | |
tree | 176bff8eafd8f6a2679d3569cbd640400b10a9ef /1.3 | |
parent | f36e10b8947fe5f0984e7428c2d5d5d7fe18007e (diff) | |
download | android-nn-driver-b3021435ad91e494af01ca0778915877dc0780c0.tar.gz |
IVGCVSW-4417 'Serialise ArmNN Model on android-nn-driver'
* Implemented serialization of the network on android-nn-driver
!armnn:4850
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I3caf07bd4d1d2a3068c58f0b344303c4cf977ca6
Diffstat (limited to '1.3')
-rw-r--r-- | 1.3/ArmnnDriverImpl.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/1.3/ArmnnDriverImpl.cpp b/1.3/ArmnnDriverImpl.cpp index 595df0a9..c9f0340d 100644 --- a/1.3/ArmnnDriverImpl.cpp +++ b/1.3/ArmnnDriverImpl.cpp @@ -136,6 +136,11 @@ Return<V1_3::ErrorStatus> ArmnnDriverImpl::prepareArmnnModel_1_3( return V1_3::ErrorStatus::NONE; } + // Serialize the network graph to a .armnn file if an output directory + // has been specified in the drivers' arguments. + auto serializedNetworkFileName = + SerializeNetwork(*modelConverter.GetINetwork(), options.GetRequestInputsAndOutputsDumpDir()); + // Optimize the network armnn::IOptimizedNetworkPtr optNet(nullptr, nullptr); armnn::OptimizerOptions OptOptions; @@ -206,11 +211,12 @@ Return<V1_3::ErrorStatus> ArmnnDriverImpl::prepareArmnnModel_1_3( return V1_3::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); + // Now that we have a networkId for the graph rename the exported files to use it + // so that we can associate the graph file and the input/output tensor exported files + RenameExportedFiles(serializedNetworkFileName, + dotGraphFileName, + options.GetRequestInputsAndOutputsDumpDir(), + netId); std::unique_ptr<ArmnnPreparedModel_1_3<hal_1_3::HalPolicy>> preparedModel( new ArmnnPreparedModel_1_3<hal_1_3::HalPolicy>( |