diff options
Diffstat (limited to 'include/armnn')
-rw-r--r-- | include/armnn/ILayerSupport.hpp | 6 | ||||
-rw-r--r-- | include/armnn/ILayerVisitor.hpp | 6 | ||||
-rw-r--r-- | include/armnn/INetwork.hpp | 5 | ||||
-rw-r--r-- | include/armnn/LayerSupport.hpp | 9 | ||||
-rw-r--r-- | include/armnn/LayerVisitorBase.hpp | 3 |
5 files changed, 29 insertions, 0 deletions
diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index 1b75810aca..dc843029c5 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -257,6 +257,12 @@ public: const TensorInfo& input1, const TensorInfo& output, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; + + virtual bool IsSwitchSupported(const TensorInfo& input0, + const TensorInfo& input1, + const TensorInfo& output0, + const TensorInfo& output1, + Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; }; // class ILayerSupport using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>; diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp index 3a4c39b7c6..eabad58366 100644 --- a/include/armnn/ILayerVisitor.hpp +++ b/include/armnn/ILayerVisitor.hpp @@ -341,6 +341,12 @@ public: virtual void VisitSubtractionLayer(const IConnectableLayer* layer, const char* name = nullptr) = 0; + /// Function a switch 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 VisitSwitchLayer(const IConnectableLayer* layer, + const char* name = nullptr) = 0; + }; } // namespace armnn diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index 8243b39c36..a15ceb1c15 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -399,6 +399,11 @@ public: /// @ return - Interface for configuring the layer. virtual IConnectableLayer* AddGatherLayer(const char* name = nullptr) = 0; + /// Adds a switch layer to the network. + /// @param name - Optional name for the layer. + /// @return - Interface for configuring the layer. + virtual IConnectableLayer* AddSwitchLayer(const char* name = nullptr) = 0; + virtual void Accept(ILayerVisitor& visitor) const = 0; protected: diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp index e23fdd0a75..c9fc264e0c 100644 --- a/include/armnn/LayerSupport.hpp +++ b/include/armnn/LayerSupport.hpp @@ -338,4 +338,13 @@ bool IsSubtractionSupported(const BackendId& backend, const TensorInfo& output, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); + +/// Deprecated in favor of IBackend and ILayerSupport interfaces +bool IsSwitchSupported(const BackendId& backend, + const TensorInfo& input0, + const TensorInfo& input1, + const TensorInfo& output0, + const TensorInfo& output1, + char* reasonIfUnsupported = nullptr, + size_t reasonIfUnsupportedMaxLength = 1024); } diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp index f4e0f438be..12eb225674 100644 --- a/include/armnn/LayerVisitorBase.hpp +++ b/include/armnn/LayerVisitorBase.hpp @@ -178,6 +178,9 @@ public: void VisitGatherLayer(const IConnectableLayer*, const char*) override { DefaultPolicy::Apply(); } + + void VisitSwitchLayer(const IConnectableLayer*, + const char*) override { DefaultPolicy::Apply(); } }; } //namespace armnn |