diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2019-04-05 15:25:46 +0100 |
---|---|---|
committer | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-04-05 17:11:02 +0100 |
commit | eff363d58992fb6384053259f9e1ee773f8cd4df (patch) | |
tree | e0bce8c4694ee15e016951f9168afbf9b75a9c79 /include/armnn | |
parent | 1f88630874fe346cd0cca8d8e38e0fb96cc1a3f4 (diff) | |
download | armnn-eff363d58992fb6384053259f9e1ee773f8cd4df.tar.gz |
IVGCVSW-2914 Add Switch Layer and no-op factory method
Change-Id: I6a6ece708a49e8a97c83a3e7fec11c88af1e1cfa
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
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 |