aboutsummaryrefslogtreecommitdiff
path: root/delegate/include
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2020-12-15 10:42:38 +0000
committerJim Flynn <jim.flynn@arm.com>2021-01-22 11:48:34 +0000
commit2cd184763ff7f8767e751f2fe0c461714350aae6 (patch)
tree048a95b2b571bfa3ad03eceb5dd4ccd4d0a70c06 /delegate/include
parentd672f5d4386dc0545d2e484ce85b76d53edb6bc9 (diff)
downloadarmnn-2cd184763ff7f8767e751f2fe0c461714350aae6.tar.gz
IVGCVSW-5571 Expose the TfLite Delegate to the TfLite python API
* Implemented external delegate adaptor interface for TfLite * Activated armnn logging for delegate * Added logging info to indicate if gpu tuning is turned on * Added pytests to ensure functionality of the external delegate adaptor * Included the delegate directory into doxygen * Added documentation on how to use the external delegate in python Signed-off-by: Finn Williams <Finn.Williams@arm.com> Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Id3b4588fb0b9ac7e3f47ba2c19feead7beb58e18
Diffstat (limited to 'delegate/include')
-rw-r--r--delegate/include/DelegateOptions.hpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/delegate/include/DelegateOptions.hpp b/delegate/include/DelegateOptions.hpp
index daf20150be..6058061b3d 100644
--- a/delegate/include/DelegateOptions.hpp
+++ b/delegate/include/DelegateOptions.hpp
@@ -6,6 +6,8 @@
#pragma once
#include <armnn/ArmNN.hpp>
+#include <armnn/Logging.hpp>
+#include <armnn/Optional.hpp>
#include <set>
#include <string>
@@ -17,10 +19,13 @@ namespace armnnDelegate
class DelegateOptions
{
public:
- DelegateOptions(armnn::Compute computeDevice, const std::vector<armnn::BackendOptions>& backendOptions = {});
+ DelegateOptions(armnn::Compute computeDevice,
+ const std::vector<armnn::BackendOptions>& backendOptions = {},
+ armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional());
DelegateOptions(const std::vector<armnn::BackendId>& backends,
- const std::vector<armnn::BackendOptions>& backendOptions = {});
+ const std::vector<armnn::BackendOptions>& backendOptions = {},
+ armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional());
const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; }
@@ -28,6 +33,18 @@ public:
const std::vector<armnn::BackendOptions>& GetBackendOptions() const { return m_BackendOptions; }
+ /// Appends a backend option to the list of backend options
+ void AddBackendOption(const armnn::BackendOptions& option) { m_BackendOptions.push_back(option); }
+
+ /// Sets the severity level for logging within ArmNN that will be used on creation of the delegate
+ void SetLoggingSeverity(const armnn::LogSeverity& level) { m_LoggingSeverity = level; }
+ void SetLoggingSeverity(const std::string& level) { m_LoggingSeverity = armnn::StringToLogLevel(level); }
+
+ /// Returns the severity level for logging within ArmNN
+ armnn::LogSeverity GetLoggingSeverity() { return m_LoggingSeverity.value(); }
+
+ bool IsLoggingEnabled() { return m_LoggingSeverity.has_value(); }
+
private:
/// Which backend to run Delegate on.
/// Examples of possible values are: CpuRef, CpuAcc, GpuAcc.
@@ -52,6 +69,9 @@ private:
/// "TuningFile" : string [filenameString]
/// "KernelProfilingEnabled" : bool [true | false]
std::vector<armnn::BackendOptions> m_BackendOptions;
+
+ /// Severity level for logging within ArmNN that will be used on creation of the delegate
+ armnn::Optional<armnn::LogSeverity> m_LoggingSeverity;
};
} // namespace armnnDelegate