aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2021-09-24 15:45:46 +0100
committerJan Eilers <jan.eilers@arm.com>2021-10-02 16:27:39 +0100
commit1b2654fb799c3d25ffcef4d31b5d026d359e2f8f (patch)
tree0397fdf24f286715e26a0e63bddaa0502f64caf7 /include
parentb63a31170aee1d28267d83a4bc67b57708fb6b05 (diff)
downloadarmnn-1b2654fb799c3d25ffcef4d31b5d026d359e2f8f.tar.gz
IVGCVSW-5985 Remove deprecated code
* Removes deprecated AddLayer, IsLayerSupported functions * Marks the whole LayerVisitor class as deprecated not just the constructor. This required to wrap all Accept functions in a no deprecate macro because the LayerVisitor is used as a parameter in there * Removes usage of deprecated LayerVisitor and replaces it with ExecuteStrategy. This required a few structural changes in the unit tests * Adds a default implementation for IStrategy called StrategyBase * Changes pyarmnn to use non deprecated constructor for INetworkProperties and adds related unit test * Marks usage of deprecated code in pyarmnn as deprecated. This required to extend INetworkProperties to allow backwards compatibility * Removes deprecated functions from CpuAcc, GpuAcc and Ref backends Note: This patch breaks compatibility with backends that are not updated in this patch !android-nn-driver:6325 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Id13b6f37a74d26eadeda2da1dc92915e725ed5a5
Diffstat (limited to 'include')
-rw-r--r--include/armnn/BackendHelper.hpp46
-rw-r--r--include/armnn/Deprecated.hpp4
-rw-r--r--include/armnn/Descriptors.hpp17
-rw-r--r--include/armnn/ILayerVisitor.hpp70
-rw-r--r--include/armnn/INetwork.hpp89
-rw-r--r--include/armnn/IRuntime.hpp4
-rw-r--r--include/armnn/LayerSupport.hpp23
-rw-r--r--include/armnn/LayerVisitorBase.hpp23
-rw-r--r--include/armnn/StrategyBase.hpp55
-rw-r--r--include/armnn/Types.hpp12
-rw-r--r--include/armnn/TypesUtils.hpp11
-rw-r--r--include/armnn/backends/IBackendInternal.hpp21
-rw-r--r--include/armnn/backends/ILayerSupport.hpp36
13 files changed, 100 insertions, 311 deletions
diff --git a/include/armnn/BackendHelper.hpp b/include/armnn/BackendHelper.hpp
index 80676deed2..0bd37dcf29 100644
--- a/include/armnn/BackendHelper.hpp
+++ b/include/armnn/BackendHelper.hpp
@@ -28,11 +28,6 @@ public:
bool IsBackendRegistered() const;
- ARMNN_DEPRECATED_MSG("Use IsElementwiseUnarySupported instead")
- bool IsAbsSupported(const TensorInfo& input,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsActivationSupported(const TensorInfo& input,
const TensorInfo& output,
const ActivationDescriptor& descriptor,
@@ -164,12 +159,6 @@ public:
const ElementwiseUnaryDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsComparisonSupported instead")
- bool IsEqualSupported(const TensorInfo& input0,
- const TensorInfo& input1,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsFakeQuantizationSupported(const TensorInfo& input,
const FakeQuantizationDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
@@ -190,24 +179,12 @@ public:
const FullyConnectedDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsGatherSupported with descriptor instead")
- bool IsGatherSupported(const TensorInfo& input0,
- const TensorInfo& input1,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsGatherSupported(const TensorInfo& input0,
const TensorInfo& input1,
const TensorInfo& output,
const GatherDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsComparisonSupported instead")
- bool IsGreaterSupported(const TensorInfo& input0,
- const TensorInfo& input1,
- const TensorInfo& ouput,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsInputSupported(const TensorInfo& input,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
@@ -272,12 +249,6 @@ public:
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsConcatSupported instead")
- bool IsMergerSupported(const std::vector<const TensorInfo*> inputs,
- const TensorInfo& output,
- const OriginsDescriptor& descriptor,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsMinimumSupported(const TensorInfo& input0,
const TensorInfo& input1,
const TensorInfo& output,
@@ -356,21 +327,11 @@ public:
const ReshapeDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsResizeSupported instead")
- bool IsResizeBilinearSupported(const TensorInfo& input,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsResizeSupported(const TensorInfo& input,
const TensorInfo& output,
const ResizeDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsElementwiseUnarySupported instead")
- bool IsRsqrtSupported(const TensorInfo& input,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsShapeSupported(const TensorInfo& input,
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
@@ -395,11 +356,6 @@ public:
const SpaceToDepthDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
- ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead")
- bool IsSplitterSupported(const TensorInfo& input,
- const ViewsDescriptor& descriptor,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional());
-
bool IsSplitterSupported(const TensorInfo& input,
const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
const ViewsDescriptor& descriptor,
@@ -489,7 +445,7 @@ Optional<const BackendOptions::BackendOption> GetCapability(const std::string& b
const armnn::BackendId& backend);
/// Convenience function to check a capability on a backend
-ARMNN_DEPRECATED_MSG("This function has been deprecated in favour of GetBackendCapability")
+ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated in favour of GetBackendCapability", "22.05")
bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability);
}
diff --git a/include/armnn/Deprecated.hpp b/include/armnn/Deprecated.hpp
index 2b9240fbc4..c493adb308 100644
--- a/include/armnn/Deprecated.hpp
+++ b/include/armnn/Deprecated.hpp
@@ -34,13 +34,15 @@
# define ARMNN_NO_DEPRECATE_WARN_END
#endif
-#define ARMNN_SUPRESS_DEPRECATE_WARNING(func) \
+#define ARMNN_SUPPRESS_DEPRECATE_WARNING(func) \
ARMNN_NO_DEPRECATE_WARN_BEGIN \
func; \
ARMNN_NO_DEPRECATE_WARN_END
#define ARMNN_DEPRECATED [[deprecated]]
#define ARMNN_DEPRECATED_MSG(message) [[deprecated(message)]]
+#define ARMNN_DEPRECATED_MSG_REMOVAL_DATE(message, removed_in_release) \
+[[deprecated("Expected to be removed in release " #removed_in_release ". " message)]]
#if defined(__GNUC__) && (__GNUC__ < 6)
# define ARMNN_DEPRECATED_ENUM
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 9a5128a127..b412bbdcc9 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -243,14 +243,6 @@ private:
uint32_t** m_ViewSizes;
};
-template <typename TensorShapeIt>
-ARMNN_DEPRECATED_MSG("Use CreateDescriptorForConcatenation instead")
-OriginsDescriptor CreateMergerDescriptorForConcatenation(TensorShapeIt first,
- TensorShapeIt last,
- unsigned int concatenationDimension)
-{
- return CreateDescriptorForConcatenation(first, last, concatenationDimension);
-}
/// @brief Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing
/// concatenation of a number of input tensors.
@@ -402,7 +394,7 @@ struct FullyConnectedDescriptor : BaseDescriptor
}
/// Get the number of views/inputs.
- ARMNN_DEPRECATED_MSG("Use GetNumInputs instead")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use GetNumInputs instead", "22.05")
uint32_t GetNumViews() const;
/// Get the number of views/inputs.
@@ -839,7 +831,10 @@ struct GatherDescriptor : BaseDescriptor
};
/// A ResizeBilinearDescriptor for the ResizeBilinearLayer.
-struct ResizeBilinearDescriptor : BaseDescriptor
+struct ARMNN_DEPRECATED_MSG_REMOVAL_DATE(
+ "ResizeBilinearDescriptor is not supported anymore. Use ResizeDescriptor instead.",
+ "22.08")
+ ResizeBilinearDescriptor : BaseDescriptor
{
ResizeBilinearDescriptor()
: m_TargetWidth(0)
@@ -849,6 +844,7 @@ struct ResizeBilinearDescriptor : BaseDescriptor
, m_HalfPixelCenters(false)
{}
+ ARMNN_NO_DEPRECATE_WARN_BEGIN
bool operator ==(const ResizeBilinearDescriptor& rhs) const
{
return m_TargetWidth == rhs.m_TargetWidth &&
@@ -857,6 +853,7 @@ struct ResizeBilinearDescriptor : BaseDescriptor
m_AlignCorners == rhs.m_AlignCorners &&
m_HalfPixelCenters == rhs.m_HalfPixelCenters;
}
+ ARMNN_NO_DEPRECATE_WARN_END
/// Target width value.
uint32_t m_TargetWidth;
diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp
index cceb545a3a..a57db3ce18 100644
--- a/include/armnn/ILayerVisitor.hpp
+++ b/include/armnn/ILayerVisitor.hpp
@@ -13,21 +13,13 @@
namespace armnn
{
-class ILayerVisitor
+class ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use ABI stable IStrategy instead.", "22.05") ILayerVisitor
{
protected:
- ARMNN_DEPRECATED_MSG("Use ABI stable IStrategy instead.")
ILayerVisitor() {}
virtual ~ILayerVisitor() {}
public:
- /// Function an absolute 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.
- ARMNN_DEPRECATED_MSG("Use VisitElementwiseUnaryLayer instead")
- virtual void VisitAbsLayer(const IConnectableLayer* layer,
- const char* name = nullptr) = 0;
/// Function that an activation 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.
@@ -93,13 +85,7 @@ public:
/// @param name - Optional name for the layer.
virtual void VisitConcatLayer(const IConnectableLayer* layer,
const OriginsDescriptor& concatDescriptor,
- const char* name = nullptr)
- {
- // default implementation to ease transition while MergerLayer is being deprecated
- ARMNN_NO_DEPRECATE_WARN_BEGIN
- VisitMergerLayer(layer, concatDescriptor, name);
- ARMNN_NO_DEPRECATE_WARN_END
- }
+ const char* name = nullptr) = 0;
/// Function a layer with no inputs and a single output, which always corresponds to
/// the passed in constant tensor should call back to when its Accept(ILayerVisitor&) function is invoked.
@@ -178,13 +164,6 @@ public:
const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor,
const char* name = nullptr) = 0;
- /// Function an Equal 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.
- ARMNN_DEPRECATED_MSG("Use VisitComparisonLayer instead")
- virtual void VisitEqualLayer(const IConnectableLayer* layer,
- const char* name = nullptr) = 0;
-
/// Function a fill 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 fillDescriptor - Description of the layer
@@ -216,7 +195,7 @@ public:
/// @param weights - Tensor for the weights data.
/// @param biases - Optional tensor for the bias data.
/// @param name - Optional name for the layer.
- ARMNN_DEPRECATED_MSG("Use VisitFullyConnectedLayer without ConstTensors")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use VisitFullyConnectedLayer without ConstTensors", "22.05")
virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
const FullyConnectedDescriptor& fullyConnectedDescriptor,
const ConstTensor& weights,
@@ -225,26 +204,12 @@ public:
/// Function a Gather 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.
- ARMNN_DEPRECATED_MSG("Use VisitGatherLayer with descriptor instead")
- virtual void VisitGatherLayer(const IConnectableLayer* layer,
- const char* name = nullptr) = 0;
-
- /// Function a Gather 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 gatherDescriptor - Parameters for the gather operation.
/// @param name - Optional name for the layer.
virtual void VisitGatherLayer(const IConnectableLayer* layer,
const GatherDescriptor& gatherDescriptor,
const char* name = nullptr) = 0;
- /// Function a Greater 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.
- ARMNN_DEPRECATED_MSG("Use VisitComparisonLayer instead")
- virtual void VisitGreaterLayer(const IConnectableLayer* layer,
- const char* name = nullptr) = 0;
-
/// Function that an InputLayer 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 id - User generated id to uniquely identify a particular input. The same id needs to be specified
@@ -318,18 +283,6 @@ public:
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 - MergerDescriptor (synonym for OriginsDescriptor) to configure the concatenation
- /// process. Number of Views must be equal to the number of inputs, and their order
- /// must match - e.g. first view corresponds to the first input, second view to the
- /// second input, etc....
- /// @param name - Optional name for the layer.
- ARMNN_DEPRECATED_MSG("Use VisitConcatLayer instead")
- virtual void VisitMergerLayer(const IConnectableLayer* layer,
- const MergerDescriptor& mergerDescriptor,
- const char* name = nullptr) = 0;
-
/// Function a Minimum 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.
@@ -437,15 +390,6 @@ public:
const ReshapeDescriptor& reshapeDescriptor,
const char* name = nullptr) = 0;
- /// Function that a resize bilinear 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 resizeDesc - Parameters for the resize operation.
- /// @param name - Optional name for the layer.
- ARMNN_DEPRECATED_MSG("Use VisitResizeLayer instead")
- virtual void VisitResizeBilinearLayer(const IConnectableLayer* layer,
- const ResizeBilinearDescriptor& resizeDesc,
- const char* name = nullptr) = 0;
-
/// Function that a resize 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 resizeDescriptor - Parameters for the resize operation.
@@ -454,14 +398,6 @@ public:
const ResizeDescriptor& resizeDescriptor,
const char* name = nullptr) = 0;
- /// Function a Reciprocal of square root 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.
- ARMNN_DEPRECATED_MSG("Use VisitElementwiseUnaryLayer instead")
- virtual void VisitRsqrtLayer(const IConnectableLayer* layer,
- const char* name = nullptr) = 0;
-
/// Function that a slice 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 sliceDescriptor - SliceDescriptor to configure the slice operation.
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index 8ec8de0600..a8e6cfc0e3 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -88,8 +88,17 @@ public:
/// Returns the unique id of the layer
virtual LayerGuid GetGuid() const = 0;
+ // The Accept function needs to be wrapped in a no warn macro to avoid deprecation warnings from
+ // the deprecated ILayerVisitor which is used in the function.
+ ARMNN_NO_DEPRECATE_WARN_BEGIN
/// Apply a visitor to this layer
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Accept is deprecated. The ILayerVisitor that works in conjunction with this "
+ "Accept function is deprecated. Use IStrategy in combination with "
+ "ExecuteStrategy instead, which is an ABI/API stable version of the "
+ "visitor pattern.",
+ "22.05")
virtual void Accept(ILayerVisitor& visitor) const = 0;
+ ARMNN_NO_DEPRECATE_WARN_END
/// Apply a visitor to this layer
virtual void ExecuteStrategy(IStrategy& strategy) const = 0;
@@ -230,12 +239,12 @@ public:
const Optional<ConstTensor>& biases,
const char* name = nullptr);
- ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This AddConvolution2dLayer overload is deprecated", "22.08")
IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
const ConstTensor& weights,
const char* name = nullptr);
- ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This AddConvolution2dLayer overload is deprecated", "22.08")
IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
const ConstTensor& weights,
const ConstTensor& biases,
@@ -271,19 +280,6 @@ public:
const Optional<ConstTensor>& biases,
const char* name = nullptr);
- ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
- IConnectableLayer* AddDepthwiseConvolution2dLayer(
- const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
- const ConstTensor& weights,
- const char* name = nullptr);
-
- ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
- IConnectableLayer* AddDepthwiseConvolution2dLayer(
- const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
- const ConstTensor& weights,
- const ConstTensor& biases,
- const char* name = nullptr);
-
/// Adds a Dequantize layer to the network.
/// @return - Interface for configuring the layer.
IConnectableLayer* AddDequantizeLayer(const char* name = nullptr);
@@ -337,13 +333,13 @@ public:
IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
const char* name = nullptr);
- ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This AddFullyConnectedLayer overload is deprecated", "22.05")
IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
const Optional<ConstTensor>& weights,
const Optional<ConstTensor>& biases,
const char* name = nullptr);
- ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This AddFullyConnectedLayer overload is deprecated", "22.05")
IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
const ConstTensor& weights,
const Optional<ConstTensor>& biases,
@@ -414,23 +410,6 @@ public:
/// @return - Interface for configuring the layer.
IConnectableLayer* AddMergeLayer(const char* name = nullptr);
- /// Adds a concat layer to the network.
- /// @param mergerDescriptor - MergerDescriptor (synonym for OriginsDescriptor) to configure the concatenation
- /// process. Number of Views must be equal to the number of inputs, and their order
- /// must match - e.g. first view corresponds to the first input, second view to the
- /// second input, etc....
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddConcatLayer instead")
- IConnectableLayer* AddMergerLayer(const MergerDescriptor& mergerDescriptor,
- const char* name = nullptr);
-
- /// Add absolute layer to the network.
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
- IConnectableLayer* AddAbsLayer(const char* name = nullptr);
-
/// Adds an addition layer to the network.
/// @param name - Optional name for the layer.
/// @return - Interface for configuring the layer.
@@ -460,14 +439,6 @@ public:
/// @return - Interface for configuring the layer.
IConnectableLayer* AddRankLayer(const char* name = nullptr);
- /// Adds a resize bilinear layer to the network.
- /// @param resizeDesc - Parameters for the resize operation.
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddResizeLayer instead")
- IConnectableLayer* AddResizeBilinearLayer(const ResizeBilinearDescriptor& resizeDesc,
- const char* name = nullptr);
-
/// Adds a resize layer to the network.
/// @param resizeDescriptor - Parameters for the resize operation.
/// @param name - Optional name for the layer.
@@ -608,30 +579,6 @@ public:
/// @return - Interface for configuring the layer.
IConnectableLayer* AddMinimumLayer(const char* name = nullptr);
- /// Add a Greater layer to the network.
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
- IConnectableLayer* AddGreaterLayer(const char* name = nullptr);
-
- /// Add a Equal layer to the network.
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
- IConnectableLayer* AddEqualLayer(const char* name = nullptr);
-
- /// Add Reciprocal of square root layer to the network.
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
- IConnectableLayer* AddRsqrtLayer(const char* name = nullptr);
-
- /// Add Gather layer to the network.
- /// @param name - Optional name for the layer.
- /// @return - Interface for configuring the layer.
- ARMNN_DEPRECATED_MSG("Use AddGatherLayer with descriptor instead")
- IConnectableLayer* AddGatherLayer(const char* name = nullptr);
-
/// Add Gather layer to the network.
/// @param descriptor - Description of the gather layer.
/// @param name - Optional name for the layer.
@@ -722,7 +669,17 @@ public:
IConnectableLayer* AddChannelShuffleLayer(const ChannelShuffleDescriptor& descriptor,
const char* name = nullptr);
+ // The Accept function needs to be wrapped in a no warn macro to avoid deprecation warnings from
+ // the deprecated ILayerVisitor which is used in the function.
+ ARMNN_NO_DEPRECATE_WARN_BEGIN
+ /// Apply a visitor to this layer
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Accept is deprecated. The ILayerVisitor that works in conjunction with this "
+ "Accept function is deprecated. Use IStrategy in combination with "
+ "ExecuteStrategy instead, which is an ABI/API stable version of the "
+ "visitor pattern.",
+ "22.05")
void Accept(ILayerVisitor& visitor) const;
+ ARMNN_NO_DEPRECATE_WARN_END
void ExecuteStrategy(IStrategy& strategy) const;
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index 908fe7692d..a46830c95a 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -31,7 +31,7 @@ using IRuntimePtr = std::unique_ptr<IRuntime, void(*)(IRuntime* runtime)>;
struct INetworkProperties
{
- ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor with MemorySource argument")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Please use INetworkProperties constructor with MemorySource argument", "22.02")
INetworkProperties(bool importEnabled = false,
bool exportEnabled = false,
bool asyncEnabled = false,
@@ -45,7 +45,7 @@ struct INetworkProperties
m_OutputSource(m_ExportEnabled ? MemorySource::Malloc : MemorySource::Undefined)
{}
- ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor without numThreads argument")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Please use INetworkProperties constructor without numThreads argument", "22.02")
INetworkProperties(bool asyncEnabled,
MemorySource inputSource,
MemorySource outputSource,
diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp
index 6f1eb0347b..03b706fafd 100644
--- a/include/armnn/LayerSupport.hpp
+++ b/include/armnn/LayerSupport.hpp
@@ -214,14 +214,6 @@ bool IsMergeSupported(const BackendId& backend,
char* reasonIfUnsupported = nullptr,
size_t reasonIfUnsupportedMaxLength = 1024);
-/// Deprecated in favor of IBackend and ILayerSupport interfaces
-ARMNN_DEPRECATED_MSG("Use IsConcatSupported instead")
-bool IsMergerSupported(const BackendId& backend,
- const std::vector<const TensorInfo*> inputs,
- const TensorInfo& output,
- const OriginsDescriptor& descriptor,
- char* reasonIfUnsupported = nullptr,
- size_t reasonIfUnsupportedMaxLength = 1024);
/// Deprecated in favor of IBackend and ILayerSupport interfaces
bool IsMinimumSupported(const BackendId& backend,
@@ -318,14 +310,6 @@ bool IsReshapeSupported(const BackendId& backend,
size_t reasonIfUnsupportedMaxLength = 1024);
/// Deprecated in favor of IBackend and ILayerSupport interfaces
-ARMNN_DEPRECATED_MSG("Use IsResizeSupported instead")
-bool IsResizeBilinearSupported(const BackendId& backend,
- const TensorInfo& input,
- const TensorInfo& output,
- char* reasonIfUnsupported = nullptr,
- size_t reasonIfUnsupportedMaxLength = 1024);
-
-/// Deprecated in favor of IBackend and ILayerSupport interfaces
bool IsResizeSupported(const BackendId& backend,
const TensorInfo& input,
const TensorInfo& output,
@@ -364,13 +348,6 @@ bool IsSpaceToDepthSupported(const BackendId& backend,
char* reasonIfUnsupported = nullptr,
size_t reasonIfUnsupportedMaxLength = 1024);
-ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead")
-bool IsSplitterSupported(const BackendId& backend,
- const TensorInfo& input,
- const ViewsDescriptor& descriptor,
- char* reasonIfUnsupported = nullptr,
- size_t reasonIfUnsupportedMaxLength = 1024);
-
/// Deprecated in favor of IBackend and ILayerSupport interfaces
bool IsSplitterSupported(const BackendId& backend,
const TensorInfo& input,
diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp
index 43fc7b976e..3d43725527 100644
--- a/include/armnn/LayerVisitorBase.hpp
+++ b/include/armnn/LayerVisitorBase.hpp
@@ -30,8 +30,6 @@ protected:
virtual ~LayerVisitorBase() {}
public:
- void VisitAbsLayer(const IConnectableLayer*,
- const char*) override { DefaultPolicy::Apply(__func__); }
void VisitActivationLayer(const IConnectableLayer*,
const ActivationDescriptor&,
@@ -99,9 +97,6 @@ public:
const ElementwiseUnaryDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
- void VisitEqualLayer(const IConnectableLayer*,
- const char*) override { DefaultPolicy::Apply(__func__); }
-
void VisitFillLayer(const IConnectableLayer*,
const FillDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
@@ -119,17 +114,10 @@ public:
const Optional<ConstTensor>&,
const char*) override { DefaultPolicy::Apply(__func__); }
- ARMNN_DEPRECATED_MSG("Use VisitGatherLayer with descriptor instead")
- void VisitGatherLayer(const IConnectableLayer*,
- const char*) override { DefaultPolicy::Apply(__func__); }
-
void VisitGatherLayer(const IConnectableLayer*,
const GatherDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
- void VisitGreaterLayer(const IConnectableLayer*,
- const char*) override { DefaultPolicy::Apply(__func__); }
-
void VisitInputLayer(const IConnectableLayer*,
LayerBindingId,
const char*) override { DefaultPolicy::Apply(__func__); }
@@ -165,10 +153,6 @@ public:
void VisitMergeLayer(const IConnectableLayer*,
const char*) override { DefaultPolicy::Apply(__func__); }
- void VisitMergerLayer(const IConnectableLayer*,
- const MergerDescriptor&,
- const char*) override { DefaultPolicy::Apply(__func__); }
-
void VisitMinimumLayer(const IConnectableLayer*,
const char*) override { DefaultPolicy::Apply(__func__); }
@@ -221,17 +205,10 @@ public:
const ReshapeDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
- void VisitResizeBilinearLayer(const IConnectableLayer*,
- const ResizeBilinearDescriptor&,
- const char*) override { DefaultPolicy::Apply(__func__); }
-
void VisitResizeLayer(const IConnectableLayer*,
const ResizeDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
- void VisitRsqrtLayer(const IConnectableLayer*,
- const char*) override { DefaultPolicy::Apply(__func__); }
-
void VisitSliceLayer(const IConnectableLayer*,
const SliceDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
diff --git a/include/armnn/StrategyBase.hpp b/include/armnn/StrategyBase.hpp
new file mode 100644
index 0000000000..78f393f44f
--- /dev/null
+++ b/include/armnn/StrategyBase.hpp
@@ -0,0 +1,55 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#pragma once
+
+
+#include <armnn/INetwork.hpp>
+#include <armnn/IStrategy.hpp>
+#include <armnn/utility/IgnoreUnused.hpp>
+
+namespace armnn
+{
+
+struct ThrowingStrategy
+{
+ void Apply(const std::string& errorMessage = "") { throw UnimplementedException(errorMessage); };
+};
+
+struct NoThrowStrategy
+{
+ void Apply(const std::string&) {};
+};
+
+/// Strategy base class with empty implementations.
+template <typename DefaultStrategy>
+class StrategyBase : public IStrategy
+{
+protected:
+ virtual ~StrategyBase() {};
+
+public:
+ virtual void ExecuteStrategy(const armnn::IConnectableLayer* layer,
+ const armnn::BaseDescriptor& descriptor,
+ const std::vector<armnn::ConstTensor>& constants,
+ const char* name,
+ const armnn::LayerBindingId id = 0) override
+ {
+ armnn::IgnoreUnused(descriptor, constants, id, name);
+ switch (layer->GetType())
+ {
+ default:
+ {
+ m_DefaultStrategy.Apply(GetLayerTypeAsCString(layer->GetType()));
+ }
+ }
+ }
+
+protected:
+ DefaultStrategy m_DefaultStrategy;
+
+};
+
+
+} // namespace armnn
diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp
index ef52368365..e713b8989e 100644
--- a/include/armnn/Types.hpp
+++ b/include/armnn/Types.hpp
@@ -40,14 +40,10 @@ enum class DataType
Signed32 = 3,
Boolean = 4,
QSymmS16 = 5,
- QuantizedSymm8PerAxis ARMNN_DEPRECATED_ENUM_MSG("Per Axis property inferred by number of scales in TensorInfo") = 6,
- QSymmS8 = 7,
- QAsymmS8 = 8,
- BFloat16 = 9,
- Signed64 = 10,
-
- QuantisedAsymm8 ARMNN_DEPRECATED_ENUM_MSG("Use DataType::QAsymmU8 instead.") = QAsymmU8,
- QuantisedSymm16 ARMNN_DEPRECATED_ENUM_MSG("Use DataType::QSymmS16 instead.") = QSymmS16
+ QSymmS8 = 6,
+ QAsymmS8 = 7,
+ BFloat16 = 8,
+ Signed64 = 9,
};
enum class DataLayout
diff --git a/include/armnn/TypesUtils.hpp b/include/armnn/TypesUtils.hpp
index b644daafd8..9bd9c8148f 100644
--- a/include/armnn/TypesUtils.hpp
+++ b/include/armnn/TypesUtils.hpp
@@ -149,9 +149,6 @@ constexpr unsigned int GetDataTypeSize(DataType dataType)
case DataType::QAsymmU8: return 1U;
case DataType::QAsymmS8: return 1U;
case DataType::QSymmS8: return 1U;
- ARMNN_NO_DEPRECATE_WARN_BEGIN
- case DataType::QuantizedSymm8PerAxis: return 1U;
- ARMNN_NO_DEPRECATE_WARN_END
case DataType::QSymmS16: return 2U;
case DataType::Boolean: return 1U;
default: return 0U;
@@ -201,9 +198,6 @@ constexpr const char* GetDataTypeName(DataType dataType)
case DataType::QAsymmU8: return "QAsymmU8";
case DataType::QAsymmS8: return "QAsymmS8";
case DataType::QSymmS8: return "QSymmS8";
- ARMNN_NO_DEPRECATE_WARN_BEGIN
- case DataType::QuantizedSymm8PerAxis: return "QSymm8PerAxis";
- ARMNN_NO_DEPRECATE_WARN_END
case DataType::QSymmS16: return "QSymm16";
case DataType::Signed32: return "Signed32";
case DataType::Boolean: return "Boolean";
@@ -268,12 +262,9 @@ constexpr bool IsQuantizedType()
constexpr bool IsQuantized8BitType(DataType dataType)
{
- ARMNN_NO_DEPRECATE_WARN_BEGIN
return dataType == DataType::QAsymmU8 ||
dataType == DataType::QAsymmS8 ||
- dataType == DataType::QSymmS8 ||
- dataType == DataType::QuantizedSymm8PerAxis;
- ARMNN_NO_DEPRECATE_WARN_END
+ dataType == DataType::QSymmS8;
}
constexpr bool IsQuantizedType(DataType dataType)
diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp
index 2045ba2fc0..f4fe678a5b 100644
--- a/include/armnn/backends/IBackendInternal.hpp
+++ b/include/armnn/backends/IBackendInternal.hpp
@@ -98,25 +98,6 @@ public:
using IMemoryManagerUniquePtr = std::unique_ptr<IMemoryManager>;
using IMemoryManagerSharedPtr = std::shared_ptr<IMemoryManager>;
- using GraphUniquePtr = std::unique_ptr<Graph>;
- using SubgraphViewUniquePtr = std::unique_ptr<SubgraphView>;
-
- ARMNN_NO_DEPRECATE_WARN_BEGIN
- using ISubGraphConverterPtr ARMNN_DEPRECATED_MSG("This type is no longer supported")
- = std::unique_ptr<ISubGraphConverter>;
- using SubGraphUniquePtr ARMNN_DEPRECATED_MSG("SubGraph is deprecated, use SubgraphView instead")
- = std::unique_ptr<SubGraph>;
-
- ARMNN_DEPRECATED_MSG("This method is no longer supported")
- virtual ISubGraphConverterPtr CreateSubGraphConverter(const std::shared_ptr<SubGraph>& subGraph) const;
-
- ARMNN_DEPRECATED_MSG("Use \"OptimizationViews OptimizeSubgraphView(const SubgraphView&)\" instead")
- virtual Optimizations GetOptimizations() const;
-
- ARMNN_DEPRECATED_MSG("Use \"OptimizationViews OptimizeSubgraphView(const SubgraphView&)\" instead")
- virtual SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, bool& optimizationAttempted) const;
- ARMNN_NO_DEPRECATE_WARN_END
-
virtual IMemoryManagerUniquePtr CreateMemoryManager() const;
virtual IWorkloadFactoryPtr CreateWorkloadFactory(
@@ -194,7 +175,7 @@ public:
};
/// Returns true if backend support the capability false otherwise
- ARMNN_DEPRECATED_MSG("This function has been deprecated in favour of GetCapability")
+ ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated in favour of GetCapability", "22.05")
virtual bool HasCapability(BackendCapability /*capabilityClass*/) const { return false; }
/// Signals the backend to use a custom memory allocator provided by the user
diff --git a/include/armnn/backends/ILayerSupport.hpp b/include/armnn/backends/ILayerSupport.hpp
index 3744f316b1..2fbb081fbf 100644
--- a/include/armnn/backends/ILayerSupport.hpp
+++ b/include/armnn/backends/ILayerSupport.hpp
@@ -27,10 +27,6 @@ protected:
virtual ~ILayerSupport() {}
public:
- virtual bool IsAbsSupported(const TensorInfo& input,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
virtual bool IsActivationSupported(const TensorInfo& input,
const TensorInfo& output,
const ActivationDescriptor& descriptor,
@@ -162,11 +158,6 @@ public:
const ElementwiseUnaryDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
- virtual bool IsEqualSupported(const TensorInfo& input0,
- const TensorInfo& input1,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
virtual bool IsFakeQuantizationSupported(const TensorInfo& input,
const FakeQuantizationDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
@@ -190,19 +181,9 @@ public:
virtual bool IsGatherSupported(const TensorInfo& input0,
const TensorInfo& input1,
const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
- virtual bool IsGatherSupported(const TensorInfo& input0,
- const TensorInfo& input1,
- const TensorInfo& output,
const GatherDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
- virtual bool IsGreaterSupported(const TensorInfo& input0,
- const TensorInfo& input1,
- const TensorInfo& ouput,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
virtual bool IsInputSupported(const TensorInfo& input,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
@@ -267,11 +248,6 @@ public:
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,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
virtual bool IsMinimumSupported(const TensorInfo& input0,
const TensorInfo& input1,
const TensorInfo& ouput,
@@ -350,19 +326,11 @@ public:
const ReshapeDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
- virtual bool IsResizeBilinearSupported(const TensorInfo& input,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
virtual bool IsResizeSupported(const TensorInfo& input,
const TensorInfo& output,
const ResizeDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
- virtual bool IsRsqrtSupported(const TensorInfo& input,
- const TensorInfo& output,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
virtual bool IsShapeSupported(const TensorInfo& input,
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
@@ -388,10 +356,6 @@ public:
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
virtual bool IsSplitterSupported(const TensorInfo& input,
- const ViewsDescriptor& descriptor,
- Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
-
- virtual bool IsSplitterSupported(const TensorInfo& input,
const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
const ViewsDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;