Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [diff] [blame] | 1 | // |
Teresa Charlin | 50de4fa | 2021-05-31 18:47:33 +0100 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include <array> |
Matthew Bentham | 47bfac4 | 2019-03-25 12:30:56 +0000 | [diff] [blame] | 8 | #include <functional> |
janeil01 | c4946c7 | 2019-11-07 09:32:28 +0000 | [diff] [blame] | 9 | #include <stdint.h> |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 10 | #include <chrono> |
Jim Flynn | 44db7c3 | 2019-03-22 15:58:39 +0000 | [diff] [blame] | 11 | #include "BackendId.hpp" |
| 12 | #include "Exceptions.hpp" |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 13 | #include "Deprecated.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
Matthew Jackson | dba634f | 2019-08-15 15:14:18 +0100 | [diff] [blame] | 18 | constexpr unsigned int MaxNumOfTensorDimensions = 5U; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 19 | |
Ryan OShea | 2bbfaa7 | 2020-02-12 16:15:27 +0000 | [diff] [blame] | 20 | /// The lowest performance data capture interval we support is 10 miliseconds. |
Colm Donelan | 0270524 | 2019-11-14 14:19:07 +0000 | [diff] [blame] | 21 | constexpr unsigned int LOWEST_CAPTURE_PERIOD = 10000u; |
| 22 | |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 23 | /// Variable to control expire rate of priority queue |
| 24 | constexpr unsigned int EXPIRE_RATE = 3U; |
| 25 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 26 | /// @enum Status enumeration |
| 27 | /// @var Status::Successful |
| 28 | /// @var Status::Failure |
| 29 | enum class Status |
| 30 | { |
| 31 | Success = 0, |
| 32 | Failure = 1 |
| 33 | }; |
| 34 | |
| 35 | enum class DataType |
| 36 | { |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 37 | Float16 = 0, |
| 38 | Float32 = 1, |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 39 | QAsymmU8 = 2, |
ruoyan01 | 20e984f | 2018-12-12 18:11:25 +0000 | [diff] [blame] | 40 | Signed32 = 3, |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 41 | Boolean = 4, |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 42 | QSymmS16 = 5, |
Derek Lamberti | d466a54 | 2020-01-22 15:37:29 +0000 | [diff] [blame] | 43 | QuantizedSymm8PerAxis ARMNN_DEPRECATED_ENUM_MSG("Per Axis property inferred by number of scales in TensorInfo") = 6, |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 44 | QSymmS8 = 7, |
Ryan OShea | 9add120 | 2020-02-07 10:06:33 +0000 | [diff] [blame] | 45 | QAsymmS8 = 8, |
Narumol Prangnawarat | c3bf6ef | 2020-02-28 12:45:21 +0000 | [diff] [blame] | 46 | BFloat16 = 9, |
Inki Dae | d4619e2 | 2020-09-10 15:33:54 +0900 | [diff] [blame] | 47 | Signed64 = 10, |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 48 | |
Derek Lamberti | 41e92b0 | 2020-01-21 13:43:21 +0000 | [diff] [blame] | 49 | QuantisedAsymm8 ARMNN_DEPRECATED_ENUM_MSG("Use DataType::QAsymmU8 instead.") = QAsymmU8, |
| 50 | QuantisedSymm16 ARMNN_DEPRECATED_ENUM_MSG("Use DataType::QSymmS16 instead.") = QSymmS16 |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
Derek Lamberti | 0cff163 | 2018-09-18 16:02:25 +0100 | [diff] [blame] | 53 | enum class DataLayout |
| 54 | { |
| 55 | NCHW = 1, |
| 56 | NHWC = 2 |
| 57 | }; |
| 58 | |
Keith Davis | 4914d0c | 2021-08-18 17:14:05 +0100 | [diff] [blame^] | 59 | /// Define the behaviour of the internal profiler when outputting network details |
| 60 | enum class ProfilingDetailsMethod |
| 61 | { |
| 62 | Undefined = 0, |
| 63 | DetailsWithEvents = 1, |
| 64 | DetailsOnly = 2 |
| 65 | }; |
| 66 | |
| 67 | |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 68 | enum class QosExecPriority |
| 69 | { |
| 70 | Low = 0, |
| 71 | Medium = 1, |
| 72 | High = 2 |
| 73 | }; |
| 74 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 75 | enum class ActivationFunction |
| 76 | { |
| 77 | Sigmoid = 0, |
| 78 | TanH = 1, |
| 79 | Linear = 2, |
| 80 | ReLu = 3, |
Colm Donelan | 03fbeaf | 2020-02-26 15:39:23 +0000 | [diff] [blame] | 81 | BoundedReLu = 4, ///< min(a, max(b, input)) ReLu1 & ReLu6. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 82 | SoftReLu = 5, |
| 83 | LeakyReLu = 6, |
| 84 | Abs = 7, |
| 85 | Sqrt = 8, |
David Monahan | 3b3c381 | 2020-02-25 09:03:29 +0000 | [diff] [blame] | 86 | Square = 9, |
Colm Donelan | 03fbeaf | 2020-02-26 15:39:23 +0000 | [diff] [blame] | 87 | Elu = 10, |
| 88 | HardSwish = 11 |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 89 | }; |
| 90 | |
Narumol Prangnawarat | 8d001d4 | 2019-09-09 15:01:18 +0100 | [diff] [blame] | 91 | enum class ArgMinMaxFunction |
| 92 | { |
| 93 | Min = 0, |
| 94 | Max = 1 |
| 95 | }; |
| 96 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 97 | enum class ComparisonOperation |
| 98 | { |
| 99 | Equal = 0, |
| 100 | Greater = 1, |
| 101 | GreaterOrEqual = 2, |
| 102 | Less = 3, |
| 103 | LessOrEqual = 4, |
| 104 | NotEqual = 5 |
| 105 | }; |
| 106 | |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 107 | enum class LogicalBinaryOperation |
| 108 | { |
| 109 | LogicalAnd = 0, |
| 110 | LogicalOr = 1 |
| 111 | }; |
| 112 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 113 | enum class UnaryOperation |
| 114 | { |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 115 | Abs = 0, |
| 116 | Exp = 1, |
| 117 | Sqrt = 2, |
| 118 | Rsqrt = 3, |
| 119 | Neg = 4, |
Teresa Charlin | 50de4fa | 2021-05-31 18:47:33 +0100 | [diff] [blame] | 120 | LogicalNot = 5, |
| 121 | Log = 6, |
| 122 | Sin = 7 |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 123 | }; |
| 124 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 125 | enum class PoolingAlgorithm |
| 126 | { |
| 127 | Max = 0, |
| 128 | Average = 1, |
| 129 | L2 = 2 |
| 130 | }; |
| 131 | |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 132 | enum class ReduceOperation |
| 133 | { |
| 134 | Sum = 0, |
| 135 | Max = 1, |
| 136 | Mean = 2, |
| 137 | Min = 3 |
| 138 | }; |
| 139 | |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 140 | enum class ResizeMethod |
| 141 | { |
| 142 | Bilinear = 0, |
| 143 | NearestNeighbor = 1 |
| 144 | }; |
| 145 | |
Teresa Charlin | 11f6ace | 2020-06-23 18:30:57 +0100 | [diff] [blame] | 146 | enum class Dimensionality |
| 147 | { |
| 148 | NotSpecified = 0, |
| 149 | Specified = 1, |
| 150 | Scalar = 2 |
| 151 | }; |
| 152 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 153 | /// |
| 154 | /// The padding method modifies the output of pooling layers. |
| 155 | /// In both supported methods, the values are ignored (they are |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 156 | /// not even zeroes, which would make a difference for max pooling |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 157 | /// a tensor with negative values). The difference between |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 158 | /// IgnoreValue and Exclude is that the former counts the padding |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 159 | /// fields in the divisor of Average and L2 pooling, while |
| 160 | /// Exclude does not. |
| 161 | /// |
| 162 | enum class PaddingMethod |
| 163 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 164 | /// The padding fields count, but are ignored |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 165 | IgnoreValue = 0, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 166 | /// The padding fields don't count and are ignored |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 167 | Exclude = 1 |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 168 | }; |
| 169 | |
| 170 | enum class NormalizationAlgorithmChannel |
| 171 | { |
| 172 | Across = 0, |
| 173 | Within = 1 |
| 174 | }; |
| 175 | |
| 176 | enum class NormalizationAlgorithmMethod |
| 177 | { |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 178 | /// Krichevsky 2012: Local Brightness Normalization |
| 179 | LocalBrightness = 0, |
| 180 | /// Jarret 2009: Local Contrast Normalization |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 181 | LocalContrast = 1 |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 182 | }; |
| 183 | |
| 184 | enum class OutputShapeRounding |
| 185 | { |
| 186 | Floor = 0, |
| 187 | Ceiling = 1 |
| 188 | }; |
| 189 | |
Teresa Charlin | cdc0149 | 2020-06-09 18:00:20 +0100 | [diff] [blame] | 190 | /// |
| 191 | /// The ShapeInferenceMethod modify how the output shapes are treated. |
| 192 | /// When ValidateOnly is selected, the output shapes are inferred from the input parameters of the layer |
| 193 | /// and any mismatch is reported. |
| 194 | /// When InferAndValidate is selected 2 actions must be performed: (1)infer output shape from inputs and (2)validate the |
| 195 | /// shapes as in ValidateOnly. This option has been added to work with tensors which rank or dimension sizes are not |
| 196 | /// specified explicitly, however this information can be calculated from the inputs. |
| 197 | /// |
| 198 | enum class ShapeInferenceMethod |
| 199 | { |
| 200 | /// Validate all output shapes |
| 201 | ValidateOnly = 0, |
| 202 | /// Infer missing output shapes and validate all output shapes |
| 203 | InferAndValidate = 1 |
| 204 | }; |
| 205 | |
Francis Murtagh | 73d3e2e | 2021-04-29 14:23:04 +0100 | [diff] [blame] | 206 | /// Define the Memory Source to reduce copies |
| 207 | enum class MemorySource : uint32_t |
| 208 | { |
| 209 | Undefined = 0, |
| 210 | Malloc = 1, |
| 211 | DmaBuf = 2, |
| 212 | DmaBufProtected = 4 |
| 213 | }; |
| 214 | |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 215 | /// Each backend should implement an IBackend. |
| 216 | class IBackend |
| 217 | { |
| 218 | protected: |
| 219 | IBackend() {} |
| 220 | virtual ~IBackend() {} |
| 221 | |
| 222 | public: |
| 223 | virtual const BackendId& GetId() const = 0; |
| 224 | }; |
| 225 | |
| 226 | using IBackendSharedPtr = std::shared_ptr<IBackend>; |
| 227 | using IBackendUniquePtr = std::unique_ptr<IBackend, void(*)(IBackend* backend)>; |
| 228 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 229 | /// BackendCapability class |
| 230 | enum class BackendCapability : uint32_t |
| 231 | { |
| 232 | /// Constant weights can be accessed through the descriptors, |
| 233 | /// On the other hand, non-const weights can be accessed through inputs. |
| 234 | NonConstWeights, |
| 235 | |
Sadik Armagan | aede8ca | 2021-03-31 16:12:13 +0100 | [diff] [blame] | 236 | /// Asynchronous Execution. |
| 237 | AsyncExecution, |
| 238 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 239 | // add new enum values here |
| 240 | }; |
| 241 | |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 242 | /// Device specific knowledge to be passed to the optimizer. |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 243 | class IDeviceSpec |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 244 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 245 | protected: |
Matteo Martincigh | 9c5d33a | 2019-02-07 17:52:41 +0000 | [diff] [blame] | 246 | IDeviceSpec() {} |
| 247 | virtual ~IDeviceSpec() {} |
Narumol Prangnawarat | 8710676 | 2019-05-03 15:54:39 +0100 | [diff] [blame] | 248 | public: |
| 249 | virtual const BackendIdSet& GetSupportedBackends() const = 0; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 250 | }; |
| 251 | |
| 252 | /// Type of identifiers for bindable layers (inputs, outputs). |
| 253 | using LayerBindingId = int; |
| 254 | |
| 255 | class PermutationVector |
| 256 | { |
| 257 | public: |
| 258 | using ValueType = unsigned int; |
| 259 | using SizeType = unsigned int; |
| 260 | using ArrayType = std::array<ValueType, MaxNumOfTensorDimensions>; |
| 261 | using ConstIterator = typename ArrayType::const_iterator; |
| 262 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 263 | /// @param dimMappings - Indicates how to translate tensor elements from a given source into the target destination, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 264 | /// when source and target potentially have different memory layouts. |
| 265 | /// |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 266 | /// E.g. For a 4-d tensor laid out in a memory with the format (Batch Element, Height, Width, Channels), |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 267 | /// which is to be passed as an input to ArmNN, each source dimension is mapped to the corresponding |
| 268 | /// ArmNN dimension. The Batch dimension remains the same (0 -> 0). The source Height dimension is mapped |
| 269 | /// to the location of the ArmNN Height dimension (1 -> 2). Similar arguments are made for the Width and |
| 270 | /// Channels (2 -> 3 and 3 -> 1). This will lead to @ref m_DimMappings pointing to the following array: |
| 271 | /// [ 0, 2, 3, 1 ]. |
| 272 | /// |
| 273 | /// Note that the mapping should be reversed if considering the case of ArmNN 4-d outputs (Batch Element, |
| 274 | /// Channels, Height, Width) being written to a destination with the format mentioned above. We now have |
| 275 | /// 0 -> 0, 2 -> 1, 3 -> 2, 1 -> 3, which, when reordered, lead to the following @ref m_DimMappings contents: |
| 276 | /// [ 0, 3, 1, 2 ]. |
| 277 | /// |
| 278 | PermutationVector(const ValueType *dimMappings, SizeType numDimMappings); |
| 279 | |
| 280 | PermutationVector(std::initializer_list<ValueType> dimMappings); |
| 281 | |
| 282 | ValueType operator[](SizeType i) const { return m_DimMappings.at(i); } |
| 283 | |
| 284 | SizeType GetSize() const { return m_NumDimMappings; } |
| 285 | |
| 286 | ConstIterator begin() const { return m_DimMappings.begin(); } |
Colm Donelan | 41e764c | 2021-05-27 16:43:25 +0100 | [diff] [blame] | 287 | /** |
| 288 | * |
| 289 | * @return pointer one past the end of the number of mapping not the length of m_DimMappings. |
| 290 | */ |
| 291 | ConstIterator end() const { return m_DimMappings.begin() + m_NumDimMappings; } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 292 | |
| 293 | bool IsEqual(const PermutationVector& other) const |
| 294 | { |
Matthew Jackson | dba634f | 2019-08-15 15:14:18 +0100 | [diff] [blame] | 295 | if (m_NumDimMappings != other.m_NumDimMappings) return false; |
| 296 | for (unsigned int i = 0; i < m_NumDimMappings; ++i) |
| 297 | { |
| 298 | if (m_DimMappings[i] != other.m_DimMappings[i]) return false; |
| 299 | } |
| 300 | return true; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | bool IsInverse(const PermutationVector& other) const |
| 304 | { |
| 305 | bool isInverse = (GetSize() == other.GetSize()); |
| 306 | for (SizeType i = 0; isInverse && (i < GetSize()); ++i) |
| 307 | { |
| 308 | isInverse = (m_DimMappings[other.m_DimMappings[i]] == i); |
| 309 | } |
| 310 | return isInverse; |
| 311 | } |
| 312 | |
| 313 | private: |
| 314 | ArrayType m_DimMappings; |
| 315 | /// Number of valid entries in @ref m_DimMappings |
| 316 | SizeType m_NumDimMappings; |
| 317 | }; |
| 318 | |
janeil01 | 3fec1ea | 2019-11-07 09:47:20 +0000 | [diff] [blame] | 319 | namespace profiling { class ProfilingGuid; } |
| 320 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 321 | /// Define LayerGuid type. |
janeil01 | 3fec1ea | 2019-11-07 09:47:20 +0000 | [diff] [blame] | 322 | using LayerGuid = profiling::ProfilingGuid; |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 323 | |
Nattapat Chaimanowong | 6e94820 | 2019-03-22 14:01:46 +0000 | [diff] [blame] | 324 | class ITensorHandle; |
| 325 | |
Nattapat Chaimanowong | 317cae5 | 2019-03-28 10:29:12 +0000 | [diff] [blame] | 326 | /// Define the type of callback for the Debug layer to call |
| 327 | /// @param guid - guid of layer connected to the input of the Debug layer |
| 328 | /// @param slotIndex - index of the output slot connected to the input of the Debug layer |
| 329 | /// @param tensorHandle - TensorHandle for the input tensor to the Debug layer |
| 330 | using DebugCallbackFunction = std::function<void(LayerGuid guid, unsigned int slotIndex, ITensorHandle* tensorHandle)>; |
Nattapat Chaimanowong | 6e94820 | 2019-03-22 14:01:46 +0000 | [diff] [blame] | 331 | |
Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame] | 332 | /// Define a timer and associated inference ID for recording execution times |
| 333 | using HighResolutionClock = std::chrono::high_resolution_clock::time_point; |
| 334 | using InferenceTimingPair = std::pair<HighResolutionClock, HighResolutionClock>; |
janeil01 | c4946c7 | 2019-11-07 09:32:28 +0000 | [diff] [blame] | 335 | |
janeil01 | c4946c7 | 2019-11-07 09:32:28 +0000 | [diff] [blame] | 336 | |
Finn Williams | b454c5c | 2021-02-09 15:56:23 +0000 | [diff] [blame] | 337 | /// This list uses X macro technique. |
| 338 | /// See https://en.wikipedia.org/wiki/X_Macro for more info |
| 339 | #define LIST_OF_LAYER_TYPE \ |
| 340 | X(Activation) \ |
| 341 | X(Addition) \ |
| 342 | X(ArgMinMax) \ |
| 343 | X(BatchNormalization) \ |
Keith Davis | 3ae3f97 | 2021-05-21 16:33:48 +0100 | [diff] [blame] | 344 | X(BatchToSpaceNd) \ |
Finn Williams | b454c5c | 2021-02-09 15:56:23 +0000 | [diff] [blame] | 345 | X(Comparison) \ |
| 346 | X(Concat) \ |
| 347 | X(Constant) \ |
| 348 | X(ConvertBf16ToFp32) \ |
| 349 | X(ConvertFp16ToFp32) \ |
| 350 | X(ConvertFp32ToBf16) \ |
| 351 | X(ConvertFp32ToFp16) \ |
| 352 | X(Convolution2d) \ |
| 353 | X(Debug) \ |
| 354 | X(DepthToSpace) \ |
| 355 | X(DepthwiseConvolution2d) \ |
| 356 | X(Dequantize) \ |
| 357 | X(DetectionPostProcess) \ |
| 358 | X(Division) \ |
| 359 | X(ElementwiseUnary) \ |
| 360 | X(FakeQuantization) \ |
| 361 | X(Fill) \ |
| 362 | X(Floor) \ |
| 363 | X(FullyConnected) \ |
| 364 | X(Gather) \ |
| 365 | X(Input) \ |
| 366 | X(InstanceNormalization) \ |
| 367 | X(L2Normalization) \ |
| 368 | X(LogicalBinary) \ |
| 369 | X(LogSoftmax) \ |
| 370 | X(Lstm) \ |
| 371 | X(QLstm) \ |
| 372 | X(Map) \ |
| 373 | X(Maximum) \ |
| 374 | X(Mean) \ |
| 375 | X(MemCopy) \ |
| 376 | X(MemImport) \ |
| 377 | X(Merge) \ |
| 378 | X(Minimum) \ |
| 379 | X(Multiplication) \ |
| 380 | X(Normalization) \ |
| 381 | X(Output) \ |
| 382 | X(Pad) \ |
| 383 | X(Permute) \ |
| 384 | X(Pooling2d) \ |
| 385 | X(PreCompiled) \ |
| 386 | X(Prelu) \ |
| 387 | X(Quantize) \ |
| 388 | X(QuantizedLstm) \ |
| 389 | X(Reshape) \ |
| 390 | X(Rank) \ |
| 391 | X(Resize) \ |
| 392 | X(Reduce) \ |
| 393 | X(Slice) \ |
| 394 | X(Softmax) \ |
| 395 | X(SpaceToBatchNd) \ |
| 396 | X(SpaceToDepth) \ |
| 397 | X(Splitter) \ |
| 398 | X(Stack) \ |
| 399 | X(StandIn) \ |
| 400 | X(StridedSlice) \ |
| 401 | X(Subtraction) \ |
| 402 | X(Switch) \ |
| 403 | X(Transpose) \ |
| 404 | X(TransposeConvolution2d) \ |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 405 | X(Unmap) \ |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 406 | X(Cast) \ |
| 407 | X(Shape) \ |
| 408 | X(UnidirectionalSequenceLstm) \ |
| 409 | |
| 410 | // New layers should be added at last to minimize instability. |
Keith Davis | 3ae3f97 | 2021-05-21 16:33:48 +0100 | [diff] [blame] | 411 | |
Finn Williams | b454c5c | 2021-02-09 15:56:23 +0000 | [diff] [blame] | 412 | /// When adding a new layer, adapt also the LastLayer enum value in the |
| 413 | /// enum class LayerType below |
| 414 | enum class LayerType |
| 415 | { |
| 416 | #define X(name) name, |
| 417 | LIST_OF_LAYER_TYPE |
| 418 | #undef X |
| 419 | FirstLayer = Activation, |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 420 | LastLayer = UnidirectionalSequenceLstm |
Finn Williams | b454c5c | 2021-02-09 15:56:23 +0000 | [diff] [blame] | 421 | }; |
| 422 | |
| 423 | const char* GetLayerTypeAsCString(LayerType type); |
| 424 | |
David Beck | 9df2d95 | 2018-10-10 15:11:44 +0100 | [diff] [blame] | 425 | } // namespace armnn |