From f36e10b8947fe5f0984e7428c2d5d5d7fe18007e Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Mon, 11 Jan 2021 16:34:01 +0000 Subject: IVGCVSW-5485 'Add CacheLoadedNetwork options to Android NN Driver' * Added Flatbuffers dependency to android-nn-driver * Added CacheLoadedNetwork options to android-nn-driver Options will be android.hardware.neuralnetworks@1.3-service-armnn -v -c GpuAcc -n arm-armnn -s -q & Signed-off-by: Sadik Armagan Change-Id: I2cdf0b84062cb1c6ad4346cd64b00161cfe85920 --- DriverOptions.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'DriverOptions.cpp') diff --git a/DriverOptions.cpp b/DriverOptions.cpp index 6f777e3c..c30a4406 100644 --- a/DriverOptions.cpp +++ b/DriverOptions.cpp @@ -36,6 +36,8 @@ DriverOptions::DriverOptions(armnn::Compute computeDevice, bool fp16Enabled) , m_EnableGpuProfiling(false) , m_fp16Enabled(fp16Enabled) , m_FastMathEnabled(false) + , m_ShouldExit(false) + , m_SaveCachedNetwork(false) { } @@ -47,6 +49,8 @@ DriverOptions::DriverOptions(const std::vector& backends, bool , m_EnableGpuProfiling(false) , m_fp16Enabled(fp16Enabled) , m_FastMathEnabled(false) + , m_ShouldExit(false) + , m_SaveCachedNetwork(false) { } @@ -58,6 +62,7 @@ DriverOptions::DriverOptions(int argc, char** argv) , m_fp16Enabled(false) , m_FastMathEnabled(false) , m_ShouldExit(false) + , m_SaveCachedNetwork(false) { std::string unsupportedOperationsAsString; std::string clTunedParametersModeAsString; @@ -112,6 +117,16 @@ DriverOptions::DriverOptions(int argc, char** argv) ("p,gpu-profiling", "Turns GPU profiling on", cxxopts::value(m_EnableGpuProfiling)->default_value("false")) + ("q,cached-network-file", "If non-empty, the given file will be used to load/save cached network. " + "If save-cached-network option is given will save the cached network to given file." + "If save-cached-network option is not given will load the cached network from given " + "file.", + cxxopts::value(m_CachedNetworkFilePath)->default_value("")) + + ("s,save-cached-network", "Enables saving the cached network to the file given with cached-network-file option." + " See also --cached-network-file", + cxxopts::value(m_SaveCachedNetwork)->default_value("false")) + ("t,cl-tuned-parameters-file", "If non-empty, the given file will be used to load/save CL tuned parameters. " "See also --cl-tuned-parameters-mode", -- cgit v1.2.1