diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-10-04 15:13:11 +0100 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2021-10-06 13:27:57 +0000 |
commit | b8a26d8f497f92643288a4c519af4d230ede1d7e (patch) | |
tree | 89b1ad2303b8a18d4491eb47ab16f37e53e33c37 /include/armnn/IRuntime.hpp | |
parent | bc3bb62c2d5b881ca7f0b3973a533134196fc802 (diff) | |
download | armnn-b8a26d8f497f92643288a4c519af4d230ede1d7e.tar.gz |
IVGCVSW-6300 'IMemoryOptimizerStrategy Add strategy library and add support in BackendRegistry'
* Updated IRuntime interface for providing custom memory optimizer strategy.
* Enabled selecting existing memory optimizer strategy by using BackendOptions
* Added MemoryOptimizerStrategyLibrary that sets one of the existing memory optimizer
strategies selected by user
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I037f8ac8efa79c0f71bd63e379101e3ad92d80c9
Diffstat (limited to 'include/armnn/IRuntime.hpp')
-rw-r--r-- | include/armnn/IRuntime.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index a46830c95a..ca9a0ceec2 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -15,6 +15,7 @@ #include "profiling/ILocalPacketHandler.hpp" #include <armnn/backends/ICustomAllocator.hpp> +#include <armnn/backends/IMemoryOptimizerStrategy.hpp> #include <memory> #include <map> @@ -106,6 +107,7 @@ public: , m_DynamicBackendsPath("") , m_ProtectedMode(false) , m_CustomAllocatorMap() + , m_MemoryOptimizerStrategyMap() {} /// If set, uses the GpuAcc tuned parameters from the given object when executing GPU workloads. @@ -135,6 +137,14 @@ public: /// @note Only supported for GpuAcc std::map<BackendId, std::shared_ptr<ICustomAllocator>> m_CustomAllocatorMap; + /// @brief A map to define a custom memory optimizer strategy for specific backend Ids. + /// + /// @details A Memory Optimizer Strategy provides a solution to an abstract representation of + /// a network's memory requirements. This can also be used to return a pre-computed solution + /// for a specific network. Set this if you want to implement a Custom Memory Optimizer Strategy + /// for a given backend. + std::map<BackendId, std::shared_ptr<IMemoryOptimizerStrategy>> m_MemoryOptimizerStrategyMap; + struct ExternalProfilingOptions { ExternalProfilingOptions() @@ -168,6 +178,7 @@ public: /// { /// {"TuningLevel", 2}, /// {"TuningFile", filename} + /// {"MemoryOptimizerStrategy", strategyname} /// } /// }); /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,6 +196,9 @@ public: /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// The following backend options are available: + /// AllBackends: + /// "MemoryOptimizerStrategy" : string [stategynameString] + /// (Existing Memory Optimizer Strategies: ConstLayerMemoryOptimizerStrategy) /// GpuAcc: /// "TuningLevel" : int [0..3] (0=UseOnly(default) | 1=RapidTuning | 2=NormalTuning | 3=ExhaustiveTuning) /// "TuningFile" : string [filenameString] |