aboutsummaryrefslogtreecommitdiff
path: root/DriverOptions.cpp
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2021-01-11 16:34:01 +0000
committerSadik Armagan <sadik.armagan@arm.com>2021-01-11 16:34:01 +0000
commitf36e10b8947fe5f0984e7428c2d5d5d7fe18007e (patch)
treec531059e65941665de3931983c81f6ab256c75b7 /DriverOptions.cpp
parent1312959112045a46b1c9d2d5f68c47d8194ce865 (diff)
downloadandroid-nn-driver-f36e10b8947fe5f0984e7428c2d5d5d7fe18007e.tar.gz
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 <file_path> & Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I2cdf0b84062cb1c6ad4346cd64b00161cfe85920
Diffstat (limited to 'DriverOptions.cpp')
-rw-r--r--DriverOptions.cpp15
1 files changed, 15 insertions, 0 deletions
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<armnn::BackendId>& 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<bool>(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<std::string>(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<bool>(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",