diff options
author | Finn Williams <Finn.Williams@arm.com> | 2021-02-12 14:26:23 +0000 |
---|---|---|
committer | Finn Williams <Finn.Williams@arm.com> | 2021-02-16 12:56:24 +0000 |
commit | f5ca16c90370d16442770a35f91a83c7d2f5ff9e (patch) | |
tree | 71f53053513615c32ee697eda3db4de6474f0f9e | |
parent | d5232963fb557c92438a56ee10f67d5fd60e8b43 (diff) | |
download | android-nn-driver-f5ca16c90370d16442770a35f91a83c7d2f5ff9e.tar.gz |
IVGCVSW-5686 Add GpuAcc MLGO tuning file configuration argument to nnapi
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I15ca7db703065b0c70766a18b1a9a213834f39e0
-rw-r--r-- | 1.2/ArmnnDriverImpl.cpp | 4 | ||||
-rw-r--r-- | 1.3/ArmnnDriverImpl.cpp | 4 | ||||
-rw-r--r-- | ArmnnDriverImpl.cpp | 5 | ||||
-rw-r--r-- | DriverOptions.cpp | 4 | ||||
-rw-r--r-- | DriverOptions.hpp | 2 |
5 files changed, 16 insertions, 3 deletions
diff --git a/1.2/ArmnnDriverImpl.cpp b/1.2/ArmnnDriverImpl.cpp index d35826e7..ccf82d0e 100644 --- a/1.2/ArmnnDriverImpl.cpp +++ b/1.2/ArmnnDriverImpl.cpp @@ -139,8 +139,10 @@ Return<V1_0::ErrorStatus> ArmnnDriverImpl::prepareArmnnModel_1_2( { { "FastMathEnabled", options.IsFastMathEnabled() }, { "SaveCachedNetwork", options.SaveCachedNetwork() }, - { "CachedNetworkFilePath", options.GetCachedNetworkFilePath() } + { "CachedNetworkFilePath", options.GetCachedNetworkFilePath() }, + { "MLGOTuningFilePath", options.GetClMLGOTunedParametersFile() } }); + armnn::BackendOptions cpuAcc("CpuAcc", { { "FastMathEnabled", options.IsFastMathEnabled() }, diff --git a/1.3/ArmnnDriverImpl.cpp b/1.3/ArmnnDriverImpl.cpp index 6a69765c..6d8fbe64 100644 --- a/1.3/ArmnnDriverImpl.cpp +++ b/1.3/ArmnnDriverImpl.cpp @@ -150,8 +150,10 @@ Return<V1_3::ErrorStatus> ArmnnDriverImpl::prepareArmnnModel_1_3( { { "FastMathEnabled", options.IsFastMathEnabled() }, { "SaveCachedNetwork", options.SaveCachedNetwork() }, - { "CachedNetworkFilePath", options.GetCachedNetworkFilePath() } + { "CachedNetworkFilePath", options.GetCachedNetworkFilePath() }, + { "MLGOTuningFilePath", options.GetClMLGOTunedParametersFile() } }); + armnn::BackendOptions cpuAcc("CpuAcc", { { "FastMathEnabled", options.IsFastMathEnabled() }, diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp index 5ce88da6..3e4aab3c 100644 --- a/ArmnnDriverImpl.cpp +++ b/ArmnnDriverImpl.cpp @@ -114,8 +114,11 @@ Return<V1_0::ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel( { { "FastMathEnabled", options.IsFastMathEnabled() }, { "SaveCachedNetwork", options.SaveCachedNetwork() }, - { "CachedNetworkFilePath", options.GetCachedNetworkFilePath() } + { "CachedNetworkFilePath", options.GetCachedNetworkFilePath() }, + { "MLGOTuningFilePath", options.GetClMLGOTunedParametersFile() } + }); + armnn::BackendOptions cpuAcc("CpuAcc", { { "FastMathEnabled", options.IsFastMathEnabled() }, diff --git a/DriverOptions.cpp b/DriverOptions.cpp index 3f9b76ee..42f7ea9e 100644 --- a/DriverOptions.cpp +++ b/DriverOptions.cpp @@ -106,6 +106,10 @@ DriverOptions::DriverOptions(int argc, char** argv) "the file accordingly.", cxxopts::value<std::string>(clTunedParametersModeAsString)->default_value("UseTunedParameters")) + ("g,mlgo-cl-tuned-parameters-file", + "If non-empty, the given file will be used to load/save MLGO CL tuned parameters. ", + cxxopts::value<std::string>(m_ClMLGOTunedParametersFile)->default_value("")) + ("n,service-name", "If non-empty, the driver service name to be registered", cxxopts::value<std::string>(m_ServiceName)->default_value("armnn")) diff --git a/DriverOptions.hpp b/DriverOptions.hpp index bab611ac..8b3f5743 100644 --- a/DriverOptions.hpp +++ b/DriverOptions.hpp @@ -28,6 +28,7 @@ public: const std::string& GetServiceName() const { return m_ServiceName; } const std::set<unsigned int>& GetForcedUnsupportedOperations() const { return m_ForcedUnsupportedOperations; } const std::string& GetClTunedParametersFile() const { return m_ClTunedParametersFile; } + const std::string& GetClMLGOTunedParametersFile() const { return m_ClMLGOTunedParametersFile; } armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const { return m_ClTunedParametersMode; } armnn::IGpuAccTunedParameters::TuningLevel GetClTuningLevel() const { return m_ClTuningLevel; } bool IsGpuProfilingEnabled() const { return m_EnableGpuProfiling; } @@ -47,6 +48,7 @@ private: std::string m_ServiceName; std::set<unsigned int> m_ForcedUnsupportedOperations; std::string m_ClTunedParametersFile; + std::string m_ClMLGOTunedParametersFile; armnn::IGpuAccTunedParameters::Mode m_ClTunedParametersMode; armnn::IGpuAccTunedParameters::TuningLevel m_ClTuningLevel; bool m_EnableGpuProfiling; |