diff options
author | Narumol Prangnawarat <narumol.prangnawarat@arm.com> | 2021-01-20 15:58:29 +0000 |
---|---|---|
committer | Narumol Prangnawarat <narumol.prangnawarat@arm.com> | 2021-01-25 17:56:59 +0000 |
commit | 0b51d5ad533f8ecde71f957077690195eea29ffc (patch) | |
tree | d04aaecd63deb8c67f4cea001bc4ddac3181911c /delegate/include | |
parent | e5617954db782628ca49919a627d01ee0088fb67 (diff) | |
download | armnn-0b51d5ad533f8ecde71f957077690195eea29ffc.tar.gz |
IVGCVSW-5619 Add OptimizerOptions and NetworkProperties to ArmNN Delegate
* Add OptimizerOptions, NetworkProperties, DebugCallbackFunction
to DelegateOptions
* Enable OptimizerOptions when the network is being optimized
* Enable NetworkProperties when loading network
* Enable DebugCallbackFunction
* Add error message when loading network
* Log warning instead of error when operator is not supported but
could fallback to another backend
* Improve uint16_t CompareData
* Unit tests
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
Change-Id: I353035afb442774bfeb1c62570a90755c2ceaf38
Diffstat (limited to 'delegate/include')
-rw-r--r-- | delegate/include/DelegateOptions.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/delegate/include/DelegateOptions.hpp b/delegate/include/DelegateOptions.hpp index 6058061b3d..82de07607e 100644 --- a/delegate/include/DelegateOptions.hpp +++ b/delegate/include/DelegateOptions.hpp @@ -27,6 +27,18 @@ public: const std::vector<armnn::BackendOptions>& backendOptions = {}, armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional()); + DelegateOptions(armnn::Compute computeDevice, + const armnn::OptimizerOptions& optimizerOptions, + const armnn::INetworkProperties& networkProperties = armnn::INetworkProperties(), + const armnn::Optional<armnn::LogSeverity>& logSeverityLevel = armnn::EmptyOptional(), + const armnn::Optional<armnn::DebugCallbackFunction>& func = armnn::EmptyOptional()); + + DelegateOptions(const std::vector<armnn::BackendId>& backends, + const armnn::OptimizerOptions& optimizerOptions, + const armnn::INetworkProperties& networkProperties = armnn::INetworkProperties(), + const armnn::Optional<armnn::LogSeverity>& logSeverityLevel = armnn::EmptyOptional(), + const armnn::Optional<armnn::DebugCallbackFunction>& func = armnn::EmptyOptional()); + const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; } void SetBackends(const std::vector<armnn::BackendId>& backends) { m_Backends = backends; } @@ -45,6 +57,13 @@ public: bool IsLoggingEnabled() { return m_LoggingSeverity.has_value(); } + const armnn::OptimizerOptions& GetOptimizerOptions() const { return m_OptimizerOptions; } + + const armnn::Optional<armnn::DebugCallbackFunction>& GetDebugCallbackFunction() const + { return m_DebugCallbackFunc; } + + const armnn::INetworkProperties& GetNetworkProperties() const { return m_NetworkProperties; }; + private: /// Which backend to run Delegate on. /// Examples of possible values are: CpuRef, CpuAcc, GpuAcc. @@ -70,8 +89,31 @@ private: /// "KernelProfilingEnabled" : bool [true | false] std::vector<armnn::BackendOptions> m_BackendOptions; + /// OptimizerOptions + /// Reduce Fp32 data to Fp16 for faster processing + /// bool m_ReduceFp32ToFp16; + /// Add debug data for easier troubleshooting + /// bool m_Debug; + /// Reduce Fp32 data to Bf16 for faster processing + /// bool m_ReduceFp32ToBf16; + /// Infer output size when not available + /// ShapeInferenceMethod m_shapeInferenceMethod; + /// Enable Import + /// bool m_ImportEnabled; + /// Enable Model Options + /// ModelOptions m_ModelOptions; + armnn::OptimizerOptions m_OptimizerOptions; + + /// Network properties to enable memory import + armnn::INetworkProperties m_NetworkProperties; + /// Severity level for logging within ArmNN that will be used on creation of the delegate armnn::Optional<armnn::LogSeverity> m_LoggingSeverity; + + /// A callback function to debug layers performing custom computations on intermediate tensors. + /// If a function is not registered, and debug is enabled in OptimizerOptions, + /// debug will print information of the intermediate tensors. + armnn::Optional<armnn::DebugCallbackFunction> m_DebugCallbackFunc; }; } // namespace armnnDelegate |