diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/armnn/ILayerSupport.hpp | 5 | ||||
-rw-r--r-- | include/armnn/ILayerVisitor.hpp | 8 | ||||
-rw-r--r-- | include/armnn/INetwork.hpp | 5 | ||||
-rw-r--r-- | include/armnn/LayerSupport.hpp | 8 | ||||
-rw-r--r-- | include/armnn/LayerVisitorBase.hpp | 3 |
5 files changed, 28 insertions, 1 deletions
diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index fe440719b0..1b75810aca 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -171,6 +171,11 @@ public: const TensorInfo& output, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsMergeSupported(const TensorInfo& input0, + const TensorInfo& input1, + const TensorInfo& output, + Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, const TensorInfo& output, const OriginsDescriptor& descriptor, diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp index e23cf5e6dd..3a4c39b7c6 100644 --- a/include/armnn/ILayerVisitor.hpp +++ b/include/armnn/ILayerVisitor.hpp @@ -199,6 +199,12 @@ public: const MeanDescriptor& meanDescriptor, const char* name = nullptr) = 0; + /// Function that a merge layer should call back to when its Accept(ILayerVisitor&) function is invoked. + /// @param layer - pointer to the layer which is calling back to this visit function. + /// @param name - Optional name for the layer. + virtual void VisitMergeLayer(const IConnectableLayer* layer, + const char* name = nullptr) = 0; + /// Function that a merger layer should call back to when its Accept(ILayerVisitor&) function is invoked. /// @param layer - pointer to the layer which is calling back to this visit function. /// @param mergerDescriptor - WindowsDescriptor to configure the merging process. Number of Views must be equal to @@ -337,4 +343,4 @@ public: }; -} // namespace armnn
\ No newline at end of file +} // namespace armnn diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index 5a9d4f246e..8243b39c36 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -235,6 +235,11 @@ public: virtual IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor , const char* name = nullptr) = 0; + /// Adds a merge layer to the network. + /// @param name - Optional name for the layer. + /// @return - Interface for configuring the layer. + virtual IConnectableLayer* AddMergeLayer(const char* name = nullptr) = 0; + /// Adds a merger layer to the network. /// @param mergerDescriptor - WindowsDescriptor to configure the merging process. Number of Views must be equal to /// the number of inputs, and their order must match - e.g. first view corresponds to diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp index 7c6bc1372a..e23fdd0a75 100644 --- a/include/armnn/LayerSupport.hpp +++ b/include/armnn/LayerSupport.hpp @@ -204,6 +204,14 @@ bool IsMemCopySupported(const BackendId& backend, size_t reasonIfUnsupportedMaxLength = 1024); /// Deprecated in favor of IBackend and ILayerSupport interfaces +bool IsMergeSupported(const BackendId& backend, + const TensorInfo& input0, + const TensorInfo& input1, + const TensorInfo& output, + char* reasonIfUnsupported = nullptr, + size_t reasonIfUnsupportedMaxLength = 1024); + +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsMergerSupported(const BackendId& backend, const std::vector<const TensorInfo*> inputs, const TensorInfo& output, diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp index a5459e1a32..f4e0f438be 100644 --- a/include/armnn/LayerVisitorBase.hpp +++ b/include/armnn/LayerVisitorBase.hpp @@ -87,6 +87,9 @@ public: const ViewsDescriptor&, const char*) override { DefaultPolicy::Apply(); } + void VisitMergeLayer(const IConnectableLayer*, + const char*) override { DefaultPolicy::Apply(); } + void VisitMergerLayer(const IConnectableLayer*, const OriginsDescriptor&, const char*) override { DefaultPolicy::Apply(); } |