From 537a0b676a7499fbf160d9947d78a65d79c9b444 Mon Sep 17 00:00:00 2001 From: arovir01 Date: Mon, 8 Oct 2018 12:01:04 +0100 Subject: [PATCH] IVGCVSW-1983: Order the IsLayerSupported functions alphabetically in ILayerSupport Change-Id: I342d7f6f3772534d3665f40079e36c3d4131f483 --- include/armnn/ILayerSupport.hpp | 51 +++++++++++++-------------- src/backends/ILayerSupport.cpp | 78 ++++++++++++++++++++--------------------- 2 files changed, 64 insertions(+), 65 deletions(-) diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index c595075..58adea8 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -70,12 +70,12 @@ public: const TensorInfo& output, Optional reasonIfUnsupported = EmptyOptional()) const; - virtual bool IsSubtractionSupported(const TensorInfo& input0, - const TensorInfo& input1, - const TensorInfo& output, - Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsFakeQuantizationSupported(const TensorInfo& input, + const FakeQuantizationDescriptor& descriptor, + Optional reasonIfUnsupported = EmptyOptional()) const; - virtual bool IsInputSupported(const TensorInfo& input, + virtual bool IsFloorSupported(const TensorInfo& input, + const TensorInfo& output, Optional reasonIfUnsupported = EmptyOptional()) const; virtual bool IsFullyConnectedSupported(const TensorInfo& input, @@ -85,6 +85,9 @@ public: const FullyConnectedDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsInputSupported(const TensorInfo& input, + Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsL2NormalizationSupported(const TensorInfo& input, const TensorInfo& output, const L2NormalizationDescriptor& descriptor, @@ -117,6 +120,11 @@ public: const TensorInfo* cellToOutputWeights, Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsMeanSupported(const TensorInfo& input, + const TensorInfo& output, + const MeanDescriptor& descriptor, + Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsMergerSupported(const std::vector inputs, const OriginsDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const; @@ -134,6 +142,11 @@ public: virtual bool IsOutputSupported(const TensorInfo& output, Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsPadSupported(const TensorInfo& input, + const TensorInfo& output, + const PadDescriptor& descriptor, + Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsPermuteSupported(const TensorInfo& input, const TensorInfo& output, const PermuteDescriptor& descriptor, @@ -144,6 +157,9 @@ public: const Pooling2dDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsReshapeSupported(const TensorInfo& input, + Optional reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsResizeBilinearSupported(const TensorInfo& input, Optional reasonIfUnsupported = EmptyOptional()) const; @@ -156,27 +172,10 @@ public: const ViewsDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const; - virtual bool IsFakeQuantizationSupported(const TensorInfo& input, - const FakeQuantizationDescriptor& descriptor, - Optional reasonIfUnsupported = EmptyOptional()) const; - - virtual bool IsReshapeSupported(const TensorInfo& input, - Optional reasonIfUnsupported = EmptyOptional()) const; - - virtual bool IsFloorSupported(const TensorInfo& input, - const TensorInfo& output, - Optional reasonIfUnsupported = EmptyOptional()) const; - - virtual bool IsMeanSupported(const TensorInfo& input, - const TensorInfo& output, - const MeanDescriptor& descriptor, - Optional reasonIfUnsupported = EmptyOptional()) const; - - virtual bool IsPadSupported(const TensorInfo& input, - const TensorInfo& output, - const PadDescriptor& descriptor, - Optional reasonIfUnsupported = EmptyOptional()) const; - + virtual bool IsSubtractionSupported(const TensorInfo& input0, + const TensorInfo& input1, + const TensorInfo& output, + Optional reasonIfUnsupported = EmptyOptional()) const; }; // class ILayerSupport } // namespace armnn diff --git a/src/backends/ILayerSupport.cpp b/src/backends/ILayerSupport.cpp index 286f125..beefa87 100644 --- a/src/backends/ILayerSupport.cpp +++ b/src/backends/ILayerSupport.cpp @@ -28,7 +28,7 @@ bool DefaultLayerSupport(const char* func, return false; } -} +} // anonymous namespace bool ILayerSupport::IsActivationSupported(const TensorInfo& input, const TensorInfo& output, @@ -106,15 +106,15 @@ bool ILayerSupport::IsDivisionSupported(const TensorInfo& input0, return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } -bool ILayerSupport::IsSubtractionSupported(const TensorInfo& input0, - const TensorInfo& input1, - const TensorInfo& output, - Optional reasonIfUnsupported) const +bool ILayerSupport::IsFakeQuantizationSupported(const TensorInfo& input, + const FakeQuantizationDescriptor& descriptor, + Optional reasonIfUnsupported) const { return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } -bool ILayerSupport::IsInputSupported(const TensorInfo& input, +bool ILayerSupport::IsFloorSupported(const TensorInfo& input, + const TensorInfo& output, Optional reasonIfUnsupported) const { return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); @@ -130,6 +130,12 @@ bool ILayerSupport::IsFullyConnectedSupported(const TensorInfo& input, return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } +bool ILayerSupport::IsInputSupported(const TensorInfo& input, + Optional reasonIfUnsupported) const +{ + return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); +} + bool ILayerSupport::IsL2NormalizationSupported(const TensorInfo& input, const TensorInfo& output, const L2NormalizationDescriptor& descriptor, @@ -168,6 +174,14 @@ bool ILayerSupport::IsLstmSupported(const TensorInfo& input, return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } +bool ILayerSupport::IsMeanSupported(const TensorInfo& input, + const TensorInfo& output, + const MeanDescriptor& descriptor, + Optional reasonIfUnsupported) const +{ + return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); +} + bool ILayerSupport::IsMergerSupported(const std::vector inputs, const OriginsDescriptor& descriptor, Optional reasonIfUnsupported) const @@ -197,6 +211,14 @@ bool ILayerSupport::IsOutputSupported(const TensorInfo& output, return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } +bool ILayerSupport::IsPadSupported(const TensorInfo& input, + const TensorInfo& output, + const PadDescriptor& descriptor, + Optional reasonIfUnsupported) const +{ + return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); +} + bool ILayerSupport::IsPermuteSupported(const TensorInfo& input, const TensorInfo& output, const PermuteDescriptor& descriptor, @@ -213,6 +235,12 @@ bool ILayerSupport::IsPooling2dSupported(const TensorInfo& input, return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } +bool ILayerSupport::IsReshapeSupported(const TensorInfo& input, + Optional reasonIfUnsupported) const +{ + return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); +} + bool ILayerSupport::IsResizeBilinearSupported(const TensorInfo& input, Optional reasonIfUnsupported) const { @@ -234,40 +262,12 @@ bool ILayerSupport::IsSplitterSupported(const TensorInfo& input, return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } -bool ILayerSupport::IsFakeQuantizationSupported(const TensorInfo& input, - const FakeQuantizationDescriptor& descriptor, - Optional reasonIfUnsupported) const -{ - return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); -} - -bool ILayerSupport::IsReshapeSupported(const TensorInfo& input, - Optional reasonIfUnsupported) const -{ - return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); -} - -bool ILayerSupport::IsFloorSupported(const TensorInfo& input, - const TensorInfo& output, - Optional reasonIfUnsupported) const -{ - return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); -} - -bool ILayerSupport::IsMeanSupported(const TensorInfo& input, - const TensorInfo& output, - const MeanDescriptor& descriptor, - Optional reasonIfUnsupported) const -{ - return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); -} - -bool ILayerSupport::IsPadSupported(const TensorInfo& input, - const TensorInfo& output, - const PadDescriptor& descriptor, - Optional reasonIfUnsupported) const +bool ILayerSupport::IsSubtractionSupported(const TensorInfo& input0, + const TensorInfo& input1, + const TensorInfo& output, + Optional reasonIfUnsupported) const { return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); } -} +} // namespace armnn -- 2.7.4