From b3021435ad91e494af01ca0778915877dc0780c0 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Wed, 13 Jan 2021 15:56:51 +0000 Subject: 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 Change-Id: I3caf07bd4d1d2a3068c58f0b344303c4cf977ca6 --- 1.2/ArmnnDriverImpl.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to '1.2/ArmnnDriverImpl.cpp') diff --git a/1.2/ArmnnDriverImpl.cpp b/1.2/ArmnnDriverImpl.cpp index d5539bc6..2ef51db8 100644 --- a/1.2/ArmnnDriverImpl.cpp +++ b/1.2/ArmnnDriverImpl.cpp @@ -125,6 +125,11 @@ Return ArmnnDriverImpl::prepareArmnnModel_1_2( return V1_0::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; @@ -195,11 +200,12 @@ Return ArmnnDriverImpl::prepareArmnnModel_1_2( return V1_0::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> preparedModel( new ArmnnPreparedModel_1_2( -- cgit v1.2.1