From 0b51d5ad533f8ecde71f957077690195eea29ffc Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Wed, 20 Jan 2021 15:58:29 +0000 Subject: 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 Change-Id: I353035afb442774bfeb1c62570a90755c2ceaf38 --- delegate/include/DelegateOptions.hpp | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'delegate/include/DelegateOptions.hpp') 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& backendOptions = {}, armnn::Optional logSeverityLevel = armnn::EmptyOptional()); + DelegateOptions(armnn::Compute computeDevice, + const armnn::OptimizerOptions& optimizerOptions, + const armnn::INetworkProperties& networkProperties = armnn::INetworkProperties(), + const armnn::Optional& logSeverityLevel = armnn::EmptyOptional(), + const armnn::Optional& func = armnn::EmptyOptional()); + + DelegateOptions(const std::vector& backends, + const armnn::OptimizerOptions& optimizerOptions, + const armnn::INetworkProperties& networkProperties = armnn::INetworkProperties(), + const armnn::Optional& logSeverityLevel = armnn::EmptyOptional(), + const armnn::Optional& func = armnn::EmptyOptional()); + const std::vector& GetBackends() const { return m_Backends; } void SetBackends(const std::vector& 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& 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 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 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 m_DebugCallbackFunc; }; } // namespace armnnDelegate -- cgit v1.2.1