From 4189cc5ca4bb12e02c5e7f86ec6079f76d845b59 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Wed, 11 Nov 2020 18:01:48 +0000 Subject: IVGCVSW-5504 'TfLiteDelegate: Introduce FP16 and BackendOptions' * Added BackendOptions creations of armnn_delegate * Included armnn/third-party the armnn_delegate unit tests * Updated the CreateConstTensor function Signed-off-by: Sadik Armagan Change-Id: I8e2099a465766b905bff701413307e5850b68e42 --- delegate/include/DelegateOptions.hpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'delegate/include') diff --git a/delegate/include/DelegateOptions.hpp b/delegate/include/DelegateOptions.hpp index 0c8173d15f..daf20150be 100644 --- a/delegate/include/DelegateOptions.hpp +++ b/delegate/include/DelegateOptions.hpp @@ -17,19 +17,41 @@ namespace armnnDelegate class DelegateOptions { public: - DelegateOptions(armnn::Compute computeDevice); + DelegateOptions(armnn::Compute computeDevice, const std::vector& backendOptions = {}); - DelegateOptions(const std::vector& backends); + DelegateOptions(const std::vector& backends, + const std::vector& backendOptions = {}); const std::vector& GetBackends() const { return m_Backends; } void SetBackends(const std::vector& backends) { m_Backends = backends; } + const std::vector& GetBackendOptions() const { return m_BackendOptions; } + private: /// Which backend to run Delegate on. /// Examples of possible values are: CpuRef, CpuAcc, GpuAcc. /// CpuRef as default. std::vector m_Backends = { armnn::Compute::CpuRef }; + + /// Pass backend specific options to Delegate + /// + /// For example, tuning can be enabled on GpuAcc like below + /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /// m_BackendOptions.emplace_back( + /// BackendOptions{"GpuAcc", + /// { + /// {"TuningLevel", 2}, + /// {"TuningFile", filename} + /// } + /// }); + /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /// The following backend options are available: + /// GpuAcc: + /// "TuningLevel" : int [0..3] (0=UseOnly(default) | 1=RapidTuning | 2=NormalTuning | 3=ExhaustiveTuning) + /// "TuningFile" : string [filenameString] + /// "KernelProfilingEnabled" : bool [true | false] + std::vector m_BackendOptions; }; } // namespace armnnDelegate -- cgit v1.2.1