From e6488719f58b5dd0e8e23d40b8a4c1337d07e9fd Mon Sep 17 00:00:00 2001 From: David Beck Date: Tue, 16 Oct 2018 11:32:20 +0100 Subject: IVGCVSW-1998 : indicate deprecated functions and types in the public API Change-Id: I60644cead5087c2012b663512fb9448dd31523af --- include/armnn/BackendId.hpp | 15 ++++++++++++++- include/armnn/LayerSupport.hpp | 28 ++++++++++++++++++++++++++++ include/armnn/TypesUtils.hpp | 2 ++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp index d1f06beba7..d2479ebb2c 100644 --- a/include/armnn/BackendId.hpp +++ b/include/armnn/BackendId.hpp @@ -14,7 +14,7 @@ namespace armnn // // The Compute enum is now deprecated and it is now -// replaced by BackendId +// being replaced by BackendId // enum class Compute { @@ -27,6 +27,8 @@ enum class Compute Undefined = 5 }; +/// Deprecated function that will be removed together with +/// the Compute enum constexpr char const* GetComputeDeviceAsCString(Compute compute) { switch (compute) @@ -38,6 +40,8 @@ constexpr char const* GetComputeDeviceAsCString(Compute compute) } } +/// Deprecated function that will be removed together with +/// the Compute enum inline std::ostream& operator<<(std::ostream& os, const std::vector& compute) { for (const Compute& comp : compute) { @@ -46,6 +50,8 @@ inline std::ostream& operator<<(std::ostream& os, const std::vector& co return os; } +/// Deprecated function that will be removed together with +/// the Compute enum inline std::ostream& operator<<(std::ostream& os, const std::set& compute) { for (const Compute& comp : compute) { @@ -54,6 +60,8 @@ inline std::ostream& operator<<(std::ostream& os, const std::set& compu return os; } +/// Deprecated function that will be removed together with +/// the Compute enum inline std::ostream& operator<<(std::ostream& os, const Compute& compute) { os << GetComputeDeviceAsCString(compute); @@ -65,6 +73,9 @@ class BackendId final public: BackendId(const std::string& id) : m_Id{id} {} BackendId(const char* id) : m_Id{id} {} + + /// Deprecated function that will be removed together with + /// the Compute enum BackendId(Compute compute) : m_Id{GetComputeDeviceAsCString(compute)} {} operator std::string() const { return m_Id; } @@ -75,6 +86,8 @@ public: return *this; } + /// Deprecated function that will be removed together with + /// the Compute enum BackendId& operator=(Compute compute) { BackendId temp{compute}; diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp index 8af8240f03..281807cf79 100644 --- a/include/armnn/LayerSupport.hpp +++ b/include/armnn/LayerSupport.hpp @@ -12,6 +12,7 @@ namespace armnn { +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsActivationSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -19,6 +20,7 @@ bool IsActivationSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsAdditionSupported(const BackendId& backend, const TensorInfo& input0, const TensorInfo& input1, @@ -26,6 +28,7 @@ bool IsAdditionSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsBatchNormalizationSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -37,23 +40,27 @@ bool IsBatchNormalizationSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsConstantSupported(const BackendId& backend, const TensorInfo& output, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsConvertFp16ToFp32Supported(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 IsConvertFp32ToFp16Supported(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 IsConvolution2dSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -63,6 +70,7 @@ bool IsConvolution2dSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsDepthwiseConvolutionSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -72,6 +80,7 @@ bool IsDepthwiseConvolutionSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsDivisionSupported(const BackendId& backend, const TensorInfo& input0, const TensorInfo& input1, @@ -79,6 +88,7 @@ bool IsDivisionSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsSubtractionSupported(const BackendId& backend, const TensorInfo& input0, const TensorInfo& input1, @@ -86,11 +96,13 @@ bool IsSubtractionSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsInputSupported(const BackendId& backend, const TensorInfo& input, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsFullyConnectedSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -100,6 +112,7 @@ bool IsFullyConnectedSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsL2NormalizationSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -107,6 +120,7 @@ bool IsL2NormalizationSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsLstmSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& outputStateIn, const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer, const TensorInfo& outputStateOut, const TensorInfo& cellStateOut, @@ -122,12 +136,14 @@ bool IsLstmSupported(const BackendId& backend, const TensorInfo& input, const Te const TensorInfo* cellToOutputWeights, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsMergerSupported(const BackendId& backend, const std::vector inputs, const OriginsDescriptor& descriptor, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsMultiplicationSupported(const BackendId& backend, const TensorInfo& input0, const TensorInfo& input1, @@ -135,6 +151,7 @@ bool IsMultiplicationSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsNormalizationSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -142,11 +159,13 @@ bool IsNormalizationSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsOutputSupported(const BackendId& backend, const TensorInfo& output, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsPermuteSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -154,6 +173,7 @@ bool IsPermuteSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsPooling2dSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -161,11 +181,13 @@ bool IsPooling2dSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsResizeBilinearSupported(const BackendId& backend, const TensorInfo& input, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsSoftmaxSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -173,29 +195,34 @@ bool IsSoftmaxSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces 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 IsFakeQuantizationSupported(const BackendId& backend, const TensorInfo& input, const FakeQuantizationDescriptor& descriptor, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsReshapeSupported(const BackendId& backend, const TensorInfo& input, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsFloorSupported(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 IsMeanSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, @@ -203,6 +230,7 @@ bool IsMeanSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsPadSupported(const BackendId& backend, const TensorInfo& input, const TensorInfo& output, diff --git a/include/armnn/TypesUtils.hpp b/include/armnn/TypesUtils.hpp index a9755bd112..c7dd856aad 100644 --- a/include/armnn/TypesUtils.hpp +++ b/include/armnn/TypesUtils.hpp @@ -98,6 +98,8 @@ constexpr bool StrEqual(const char* strA, const char (&strB)[N]) return isEqual; } +/// Deprecated function that will be removed together with +/// the Compute enum constexpr armnn::Compute ParseComputeDevice(const char* str) { if (armnn::StrEqual(str, "CpuAcc")) -- cgit v1.2.1