diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/armnn/Exceptions.hpp | 10 | ||||
-rw-r--r-- | include/armnn/IRuntime.hpp | 21 |
2 files changed, 29 insertions, 2 deletions
diff --git a/include/armnn/Exceptions.hpp b/include/armnn/Exceptions.hpp index 1740a8c47d..f8e0b430a6 100644 --- a/include/armnn/Exceptions.hpp +++ b/include/armnn/Exceptions.hpp @@ -115,6 +115,16 @@ class RuntimeException : public Exception using Exception::Exception; }; +class MemoryImportException : public Exception +{ + using Exception::Exception; +}; + +class MemoryExportException : public Exception +{ + using Exception::Exception; +}; + template <typename ExceptionType> void ConditionalThrow(bool condition, const std::string& message) { diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index 41e1c47c5c..68965cffa5 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -23,6 +23,18 @@ class IGpuAccTunedParameters; class IRuntime; using IRuntimePtr = std::unique_ptr<IRuntime, void(*)(IRuntime* runtime)>; +struct INetworkProperties +{ + INetworkProperties(bool importEnabled = false, bool exportEnabled = false) + : m_ImportEnabled(importEnabled), + m_ExportEnabled(exportEnabled) {} + + const bool m_ImportEnabled; + const bool m_ExportEnabled; + + virtual ~INetworkProperties() {} +}; + class IRuntime { public: @@ -82,7 +94,12 @@ public: /// @return armnn::Status virtual Status LoadNetwork(NetworkId& networkIdOut, IOptimizedNetworkPtr network, - std::string & errorMessage) = 0; + std::string& errorMessage) = 0; + + virtual Status LoadNetwork(NetworkId& networkIdOut, + IOptimizedNetworkPtr network, + std::string& errorMessage, + const INetworkProperties& networkProperties) = 0; virtual TensorInfo GetInputTensorInfo(NetworkId networkId, LayerBindingId layerId) const = 0; virtual TensorInfo GetOutputTensorInfo(NetworkId networkId, LayerBindingId layerId) const = 0; @@ -163,4 +180,4 @@ protected: virtual ~IGpuAccTunedParameters() {}; }; -} +} // namespace armnn |