aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTeresa Charlin <teresa.charlinreyes@arm.com>2023-07-13 17:16:45 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2023-07-25 09:54:47 +0000
commit79a06a59bafadf736ca53c4240e87f9bbb657260 (patch)
treeb94b2063766b40b79bed8cb81f571ea05cfa9efb /include
parenta638f101bcb51008932f922fe0a5cef28633bc66 (diff)
downloadarmnn-79a06a59bafadf736ca53c4240e87f9bbb657260.tar.gz
IVGCVSW-7883 Front end and reference implementation for TILE
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Signed-off-by: Cian McGriskin <cian.mcgriskin@arm.com> Change-Id: I0afb2403fee11c5c1e58ea65e2525e99594d8f2d
Diffstat (limited to 'include')
-rw-r--r--include/armnn/BackendHelper.hpp5
-rw-r--r--include/armnn/Descriptors.hpp19
-rw-r--r--include/armnn/DescriptorsFwd.hpp1
-rw-r--r--include/armnn/INetwork.hpp27
-rw-r--r--include/armnn/Types.hpp3
-rw-r--r--include/armnn/backends/WorkloadData.hpp5
6 files changed, 49 insertions, 11 deletions
diff --git a/include/armnn/BackendHelper.hpp b/include/armnn/BackendHelper.hpp
index 6181ba5c40..b550f9f68e 100644
--- a/include/armnn/BackendHelper.hpp
+++ b/include/armnn/BackendHelper.hpp
@@ -422,6 +422,11 @@ public:
const TensorInfo& output1,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
+ bool IsTileSupported(const TensorInfo& input,
+ const TensorInfo& output,
+ const TileDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported = EmptyOptional());
+
bool IsTransposeConvolution2dSupported(
const TensorInfo& input,
const TensorInfo& output,
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 9ff894f1b0..3a571a66e8 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -1620,4 +1620,23 @@ struct BatchMatMulDescriptor : BaseDescriptor
const TensorShape& tensorShape);
};
+struct TileDescriptor : BaseDescriptor
+{
+ TileDescriptor()
+ : m_Multiples()
+ {}
+
+ explicit TileDescriptor(std::vector<uint32_t> multiples)
+ : m_Multiples(std::move(multiples))
+ {}
+
+ bool operator ==(const TileDescriptor& rhs) const
+ {
+ return m_Multiples == rhs.m_Multiples;
+ }
+
+ /// The vector to multiply the input shape by
+ std::vector<uint32_t> m_Multiples;
+};
+
} // namespace armnn
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index 2c25a49f00..be1a3f6782 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -49,6 +49,7 @@ struct SpaceToDepthDescriptor;
struct StackDescriptor;
struct StandInDescriptor;
struct StridedSliceDescriptor;
+struct TileDescriptor;
struct TransposeConvolution2dDescriptor;
struct TransposeDescriptor;
struct ViewsDescriptor;
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index e20dd1c348..830e0bac66 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -740,7 +740,7 @@ public:
/// @param name - Optional name for the layer.
/// @return - Interface for configuring the layer.
IConnectableLayer* AddGatherLayer(const GatherDescriptor& descriptor,
- const char* name = nullptr);
+ const char* name = nullptr);
/// Add GatherNd layer to the network.
/// @param name - Optional name for the layer.
@@ -764,23 +764,23 @@ public:
/// @param name - Optional name for the layer.
/// @return - Interface for configuring the layer.
IConnectableLayer* AddTransposeConvolution2dLayer(const TransposeConvolution2dDescriptor& descriptor,
- const ConstTensor& weights,
- const Optional<ConstTensor>& biases,
- const char* name = nullptr);
+ const ConstTensor& weights,
+ const Optional<ConstTensor>& biases,
+ const char* name = nullptr);
/// Adds a transpose layer to the network.
/// @param transposeDescriptor - TransposeDescriptor to configure the transpose.
/// @param name - Optional name for the layer.
/// @return - Interface for configuring the layer.
IConnectableLayer* AddTransposeLayer(const TransposeDescriptor& transposeDescriptor,
- const char* name = nullptr);
+ const char* name = nullptr);
/// Adds a stack layer to the network.
/// @param descriptor - Description of the stack layer.
/// @param name - Optional name for the layer.
/// @return - Interface for configuring the layer.
IConnectableLayer* AddStackLayer(const StackDescriptor& descriptor,
- const char* name = nullptr);
+ const char* name = nullptr);
/// Add a stand-in layer for a type unknown to the Arm NN framework.
/// Note: Due to the nature of this layer, no validation can be performed by the framework.
@@ -789,14 +789,14 @@ public:
/// @descriptor - Descriptor for the StandIn layer.
/// @return - Interface for configuring the layer.
IConnectableLayer* AddStandInLayer(const StandInDescriptor& descriptor,
- const char* name = nullptr);
+ const char* name = nullptr);
/// Add a QuantizedLstm layer to the network
/// @param params - The weights and biases for the Quantized LSTM cell
/// @param name - Optional name for the layer
/// @return - Interface for configuring the layer.
IConnectableLayer* AddQuantizedLstmLayer(const QuantizedLstmInputParams& params,
- const char* name = nullptr);
+ const char* name = nullptr);
/// Add a QLstm layer to the network
/// @param descriptor - Parameters for the QLstm operation
@@ -804,8 +804,8 @@ public:
/// @param name - Optional name for the layer
/// @return - Interface for configuring the layer.
IConnectableLayer* AddQLstmLayer(const QLstmDescriptor& descriptor,
- const LstmInputParams& params,
- const char* name = nullptr);
+ const LstmInputParams& params,
+ const char* name = nullptr);
/// Adds a Logical Binary layer to the network.
/// @param descriptor - Description of the Logical Binary layer.
@@ -842,6 +842,13 @@ public:
/// @return - Interface for configuring the layer
IConnectableLayer* AddReverseV2Layer(const char* name = nullptr);
+ /// Add a Tile layer to the network
+ /// @param descriptor - Parameters for the Tile operation
+ /// @param name - Optional name for the layer
+ /// @return - Interface for configuring the layer
+ IConnectableLayer* AddTileLayer(const TileDescriptor& descriptor,
+ const char* name = nullptr);
+
void ExecuteStrategy(IStrategy& strategy) const;
protected:
diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp
index f05f05b2a0..bf4458ee7f 100644
--- a/include/armnn/Types.hpp
+++ b/include/armnn/Types.hpp
@@ -474,6 +474,7 @@ using InferenceTimingPair = std::pair<HighResolutionClock, HighResolutionClock>;
X(BatchMatMul) \
X(ElementwiseBinary) \
X(ReverseV2) \
+ X(Tile) \
// New layers should be added at last position to minimize instability.
@@ -485,7 +486,7 @@ enum class LayerType
LIST_OF_LAYER_TYPE
#undef X
FirstLayer = Activation,
- LastLayer = ElementwiseBinary
+ LastLayer = Tile
};
const char* GetLayerTypeAsCString(LayerType type);
diff --git a/include/armnn/backends/WorkloadData.hpp b/include/armnn/backends/WorkloadData.hpp
index e7d5e0e689..21a597df8a 100644
--- a/include/armnn/backends/WorkloadData.hpp
+++ b/include/armnn/backends/WorkloadData.hpp
@@ -755,4 +755,9 @@ struct ReverseV2QueueDescriptor : QueueDescriptor
void Validate(const WorkloadInfo& workloadInfo) const;
};
+struct TileQueueDescriptor : QueueDescriptorWithParameters<TileDescriptor>
+{
+ void Validate(const WorkloadInfo& workloadInfo) const;
+};
+
} // namespace armnn