2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "NeonWorkloadFactoryHelper.hpp"
8 #include <test/TensorHelpers.hpp>
9 #include <test/UnitTests.hpp>
11 #include <backendsCommon/CpuTensorHandle.hpp>
12 #include <neon/NeonLayerSupport.hpp>
13 #include <neon/NeonWorkloadFactory.hpp>
14 #include <reference/RefWorkloadFactory.hpp>
15 #include <backendsCommon/test/ActivationFixture.hpp>
16 #include <backendsCommon/test/LayerTests.hpp>
17 #include <backendsCommon/test/PermuteTestImpl.hpp>
18 #include <backendsCommon/test/TensorCopyUtils.hpp>
19 #include <backendsCommon/test/TransposeConvolution2dTestImpl.hpp>
20 #include <backendsCommon/test/WorkloadTestUtils.hpp>
22 #include <boost/test/unit_test.hpp>
24 BOOST_AUTO_TEST_SUITE(Compute_ArmComputeNeon)
26 using namespace armnn;
28 using FactoryType = NeonWorkloadFactory;
30 // ============================================================================
34 ARMNN_AUTO_TEST_CASE(SimpleConvolution1d, Convolution1dTest, true)
36 ARMNN_AUTO_TEST_CASE(SimpleConvolution2d, SimpleConvolution2d3x5Test, true, DataLayout::NCHW)
37 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dNhwc, SimpleConvolution2d3x5Test, true, DataLayout::NHWC)
38 ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8, SimpleConvolution2d3x3Uint8Test, true, DataLayout::NCHW)
39 ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8Nhwc, SimpleConvolution2d3x3Uint8Test, true, DataLayout::NHWC)
40 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2d, SimpleConvolution2d3x5Test, false, DataLayout::NCHW)
41 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dNhwc, SimpleConvolution2d3x5Test, false, DataLayout::NHWC)
42 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dStride2x2Nhwc,
43 SimpleConvolution2d3x3Stride2x2Test, false, DataLayout::NHWC)
45 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquare, SimpleConvolution2d3x3Test, false, DataLayout::NCHW)
46 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPadding, Convolution2dAsymmetricPaddingTest, DataLayout::NCHW)
48 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquareNhwc, SimpleConvolution2d3x3Test, false, DataLayout::NHWC)
49 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPaddingNhwc,
50 Convolution2dAsymmetricPaddingTest,
53 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dSquareNhwc, SimpleConvolution2d3x3NhwcTest, false)
55 ARMNN_AUTO_TEST_CASE(Convolution2d3x3Dilation3x3,
56 Convolution2d3x3Dilation3x3Test<DataType::Float32, DataType::Float32>,
59 ARMNN_AUTO_TEST_CASE(Convolution2d3x3Dilation3x3Nhwc,
60 Convolution2d3x3Dilation3x3Test<DataType::Float32, DataType::Float32>,
63 ARMNN_AUTO_TEST_CASE(Convolution2d3x3Dilation3x3Uint8,
64 Convolution2d3x3Dilation3x3Test<DataType::QuantisedAsymm8, DataType::Signed32>,
67 ARMNN_AUTO_TEST_CASE(Convolution2d3x3Dilation3x3NhwcUint8,
68 Convolution2d3x3Dilation3x3Test<DataType::QuantisedAsymm8, DataType::Signed32>,
71 ARMNN_AUTO_TEST_CASE(Convolution2d2x3x3Dilation3x3,
72 Convolution2d2x3x3Dilation3x3Test<DataType::Float32, DataType::Float32>,
75 ARMNN_AUTO_TEST_CASE(Convolution2d2x3x3Dilation3x3Nhwc,
76 Convolution2d2x3x3Dilation3x3Test<DataType::Float32, DataType::Float32>,
79 ARMNN_AUTO_TEST_CASE(Convolution2d2x3x3Dilation3x3Uint8,
80 Convolution2d2x3x3Dilation3x3Test<DataType::QuantisedAsymm8, DataType::Signed32>,
83 ARMNN_AUTO_TEST_CASE(Convolution2d2x3x3Dilation3x3NhwcUint8,
84 Convolution2d2x3x3Dilation3x3Test<DataType::QuantisedAsymm8, DataType::Signed32>,
87 ARMNN_AUTO_TEST_CASE(Convolution2d2x2Dilation2x2Padding2x2Stride3x3,
88 Convolution2d2x2Dilation2x2Padding2x2Stride3x3Test
89 <DataType::Float32, DataType::Float32>,
92 ARMNN_AUTO_TEST_CASE(Convolution2d2x2Dilation2x2Padding2x2Stride3x3Nhwc,
93 Convolution2d2x2Dilation2x2Padding2x2Stride3x3Test
94 <DataType::Float32, DataType::Float32>,
97 ARMNN_AUTO_TEST_CASE(Convolution2d2x2Dilation2x2Padding2x2Stride3x3Uint8,
98 Convolution2d2x2Dilation2x2Padding2x2Stride3x3Test
99 <DataType::QuantisedAsymm8, DataType::Signed32>,
102 ARMNN_AUTO_TEST_CASE(Convolution2d2x2Dilation2x2Padding2x2Stride3x3NhwcUint8,
103 Convolution2d2x2Dilation2x2Padding2x2Stride3x3Test
104 <DataType::QuantisedAsymm8, DataType::Signed32>,
107 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dMult4,
108 DepthwiseConvolution2dMult4Test<armnn::DataType::Float32, armnn::DataType::Float32>,
110 armnn::DataLayout::NCHW)
111 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dMult2,
112 DepthwiseConvolution2dMult2Test<armnn::DataType::Float32, armnn::DataType::Float32>,
114 armnn::DataLayout::NCHW)
116 // Depthwise Convolution
117 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1,
118 DepthwiseConvolution2dDepthMul1Test, true, DataLayout::NCHW)
119 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1,
120 DepthwiseConvolution2dDepthMul1Test, false, DataLayout::NCHW)
121 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8,
122 DepthwiseConvolution2dDepthMul1Uint8Test, true, DataLayout::NCHW)
123 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8,
124 DepthwiseConvolution2dDepthMul1Uint8Test, false, DataLayout::NCHW)
126 // NHWC Depthwise Convolution
127 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1NHhwc,
128 DepthwiseConvolution2dDepthMul1Test, true, DataLayout::NHWC)
129 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Nhwc,
130 DepthwiseConvolution2dDepthMul1Test, false, DataLayout::NHWC)
131 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8Nhwc,
132 DepthwiseConvolution2dDepthMul1Uint8Test, true, DataLayout::NHWC)
133 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8Nhwc,
134 DepthwiseConvolution2dDepthMul1Uint8Test, false, DataLayout::NHWC)
136 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthNhwc, DepthwiseConvolution2dDepthNhwcTest, false)
137 ARMNN_AUTO_TEST_CASE(SimpleDepthwiseConvolution2d3x3Dilation3x3Nhwc,
138 SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTest)
141 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetric,
142 DepthwiseConvolution2dAsymmetricTest, true, DataLayout::NCHW)
143 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetric,
144 DepthwiseConvolution2dAsymmetricTest, false, DataLayout::NCHW)
145 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetricNhwc,
146 DepthwiseConvolution2dAsymmetricTest, true, DataLayout::NHWC)
147 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetricNhwc,
148 DepthwiseConvolution2dAsymmetricTest, false, DataLayout::NHWC)
150 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul64, DepthwiseConvolution2dDepthMul64Test);
155 DepthwiseConvolution2dDescriptor MakeDepthwiseConv2dDesc(uint32_t strideX, uint32_t strideY,
156 uint32_t depthMultiplier = 1, uint32_t padLeft = 0, uint32_t padRight = 0,
157 uint32_t padTop = 0, uint32_t padBottom = 0)
159 boost::ignore_unused(depthMultiplier);
161 DepthwiseConvolution2dDescriptor desc;
163 desc.m_PadLeft = padLeft;
164 desc.m_PadRight = padRight;
166 desc.m_PadTop = padTop;
167 desc.m_PadBottom = padBottom;
168 desc.m_StrideX = strideX;
169 desc.m_StrideY = strideY;
170 desc.m_BiasEnabled = false;
175 TensorInfo CreateOutputTensorInfo(const TensorInfo& inputInfo,
176 const TensorInfo& weightsInfo,
177 const DepthwiseConvolution2dDescriptor& descriptor,
180 const TensorShape& inputShape = inputInfo.GetShape();
181 const TensorShape& filterShape = weightsInfo.GetShape();
183 unsigned int inWidth = inputShape[3];
184 unsigned int inHeight = inputShape[2];
185 unsigned int inBatchSize = inputShape[0];
187 unsigned int filterWidth = filterShape[3];
188 unsigned int readWidth = (inWidth + descriptor.m_PadLeft + descriptor.m_PadRight) - (filterWidth);
189 unsigned int outWidth = 1u + (readWidth / descriptor.m_StrideX);
191 unsigned int filterHeight = filterShape[2];
192 unsigned int readHeight = (inHeight + descriptor.m_PadTop + descriptor.m_PadBottom) - (filterHeight);
193 unsigned int outHeight = 1u + (readHeight / descriptor.m_StrideY);
194 unsigned int depthMultiplier = filterShape[0];
196 unsigned int outChannels = filterShape[1] * depthMultiplier;
197 unsigned int outBatchSize = inBatchSize;
199 TensorShape outputShape({outBatchSize, outChannels, outHeight, outWidth});
200 return TensorInfo(outputShape, dataType);
204 BOOST_AUTO_TEST_CASE(DepthwiseConv2dUtils)
206 const DataType dataType = DataType::Float32;
208 TensorInfo inputInfo({1, 1, 10, 10 }, dataType);
209 TensorInfo outputInfo;
210 TensorInfo weightsInfo3x3({ 1, 1, 3, 3 }, dataType);
211 TensorInfo biasesInfo;
213 DepthwiseConvolution2dDescriptor descriptor;
214 NeonLayerSupport layerSupport;
216 // Strides supported: 1,2,3
217 descriptor = MakeDepthwiseConv2dDesc(1, 1);
218 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
219 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
220 weightsInfo3x3, biasesInfo));
222 descriptor = MakeDepthwiseConv2dDesc(1, 2);
223 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
224 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
225 weightsInfo3x3, biasesInfo));
227 descriptor = MakeDepthwiseConv2dDesc(1, 3);
228 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
229 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
230 weightsInfo3x3, biasesInfo));
232 descriptor = MakeDepthwiseConv2dDesc(2, 1);
233 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
234 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
235 weightsInfo3x3, biasesInfo));
237 descriptor = MakeDepthwiseConv2dDesc(2, 2);
238 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
239 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
240 weightsInfo3x3, biasesInfo));
242 descriptor = MakeDepthwiseConv2dDesc(2, 3);
243 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
244 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
245 weightsInfo3x3, biasesInfo));
247 descriptor = MakeDepthwiseConv2dDesc(3, 1);
248 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
249 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
250 weightsInfo3x3, biasesInfo));
252 descriptor = MakeDepthwiseConv2dDesc(3, 2);
253 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
254 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
255 weightsInfo3x3, biasesInfo));
257 descriptor = MakeDepthwiseConv2dDesc(3, 3);
258 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
259 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
260 weightsInfo3x3, biasesInfo));
262 // Supported stride 4
263 descriptor = MakeDepthwiseConv2dDesc(4, 1);
264 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
265 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
266 weightsInfo3x3, biasesInfo));
268 // Supported weights shape 1x1
269 TensorInfo weightsInfo1x1({ 1, 1, 1, 1 }, DataType::Float32);
270 descriptor = MakeDepthwiseConv2dDesc(1, 1);
271 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo1x1, descriptor, dataType);
272 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
273 weightsInfo1x1, biasesInfo));
275 // Supported shape 2x2
276 TensorInfo weightsInfo2x2({ 1, 1, 2, 2 }, DataType::Float32);
277 descriptor = MakeDepthwiseConv2dDesc(1, 1);
278 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo2x2, descriptor, dataType);
279 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
280 weightsInfo2x2, biasesInfo));
282 // Asymmetric padding
283 descriptor = MakeDepthwiseConv2dDesc(1, 1, 1, 1, 2, 1, 2);
284 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
285 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
286 weightsInfo3x3, biasesInfo));
290 ARMNN_AUTO_TEST_CASE(DequantizeSimpleUint8, DequantizeSimpleUint8Test)
291 ARMNN_AUTO_TEST_CASE(DequantizeOffsetUint8, DequantizeOffsetUint8Test)
294 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true)
295 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true)
297 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2d, SimpleMaxPooling2dTest, DataLayout::NCHW)
298 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dNhwc, SimpleMaxPooling2dTest, DataLayout::NHWC)
299 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8, SimpleMaxPooling2dUint8Test, DataLayout::NCHW)
300 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8Nhwc, SimpleMaxPooling2dUint8Test, DataLayout::NHWC)
302 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest, DataLayout::NCHW)
303 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dTest, DataLayout::NCHW)
304 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test, DataLayout::NCHW)
305 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8Nhwc, SimpleAveragePooling2dUint8Test, DataLayout::NHWC)
307 ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest)
308 ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test)
310 ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest, DataLayout::NCHW)
311 ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2dNeon, SimpleL2Pooling2dTest, DataLayout::NHWC)
312 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test, DataLayout::NCHW)
314 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test)
315 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test)
316 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test)
317 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test)
318 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test)
319 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test)
320 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test)
321 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test)
322 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test)
323 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test)
325 // Ignore padding values for pooling but count padding fields into the divisor
326 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest)
327 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test)
328 ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test)
329 ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test)
331 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest)
332 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test)
333 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest)
334 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8,
335 IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test)
336 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test)
337 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test)
338 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2,
339 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, false)
340 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding,
341 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
344 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest)
345 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test)
346 ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test)
347 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test)
350 ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
353 ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
354 ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
357 ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
358 ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
361 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
362 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
363 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f)
364 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f)
366 ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1, Simple3dSoftmaxTest, 1.0f)
367 ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1Uint8, Simple3dSoftmaxUint8Test, 1.0f)
369 ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1, Simple4dSoftmaxTest, 1.0f)
370 ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1Uint8, Simple4dSoftmaxUint8Test, 1.0f)
373 ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHWAsymmQ8, SpaceToDepthNCHWAsymmQ8Test)
374 ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWCAsymmQ8, SpaceToDepthNHWCAsymmQ8Test)
376 ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWC1Float32, SpaceToDepthNHWCFloat32Test1)
377 ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHW1Float32, SpaceToDepthNCHWFloat32Test1)
379 ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWC2Float32, SpaceToDepthNHWCFloat32Test2)
380 ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHW2Float32, SpaceToDepthNCHWFloat32Test2)
382 ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWCQSymm16, SpaceToDepthNHWCQSymm16Test)
383 ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHWQSymm16, SpaceToDepthNCHWQSymm16Test)
386 ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest)
387 ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
389 ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
390 ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
393 ARMNN_AUTO_TEST_CASE(SimpleConcat, ConcatTest)
394 ARMNN_AUTO_TEST_CASE(ConcatUint8, ConcatUint8Test)
395 ARMNN_AUTO_TEST_CASE(ConcatUint8DifferentInputOutputQParam,
396 ConcatDifferentInputOutputQParamTest<DataType::QuantisedAsymm8>, false)
399 ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
400 ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false)
401 ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true)
402 ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false)
403 ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true)
404 ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedTest<DataType::QuantisedAsymm8>, false)
405 ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedTest<DataType::QuantisedAsymm8>, true)
408 ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)
409 ARMNN_AUTO_TEST_CASE(Add5d, Addition5dTest)
410 ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest)
411 ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest)
414 ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest)
415 ARMNN_AUTO_TEST_CASE(SubBroadcast1Element, SubtractionBroadcast1ElementTest)
416 ARMNN_AUTO_TEST_CASE(SubBroadcast, SubtractionBroadcastTest)
417 ARMNN_AUTO_TEST_CASE(SubtractionUint8, SubtractionUint8Test)
418 ARMNN_AUTO_TEST_CASE(SubBroadcastUint8, SubtractionBroadcastUint8Test)
419 ARMNN_AUTO_TEST_CASE(SubBroadcast1ElementUint8, SubtractionBroadcast1ElementUint8Test)
422 ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest)
423 ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest)
424 ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest)
425 ARMNN_AUTO_TEST_CASE(MultiplicationUint8, MultiplicationUint8Test)
426 ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1ElementUint8, MultiplicationBroadcast1ElementUint8Test)
427 ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVectorUint8, MultiplicationBroadcast1DVectorUint8Test)
428 ARMNN_AUTO_TEST_CASE(Multiplication5d, Multiplication5dTest)
431 ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest)
432 ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest)
435 ARMNN_AUTO_TEST_CASE(Constant, ConstantTest)
436 ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantUint8SimpleQuantizationScaleNoOffsetTest)
439 ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest)
440 ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test)
442 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test)
443 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test)
444 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test)
445 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test)
447 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest)
448 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test)
449 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest)
450 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test)
452 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test)
453 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test)
454 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test)
455 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test)
456 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test, false)
457 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test, false)
459 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest)
460 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test)
461 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest)
462 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test)
463 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest, false)
464 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test, false)
466 ARMNN_AUTO_TEST_CASE(Concatenation4dDim0, Concatenation4dDim0Test)
467 ARMNN_AUTO_TEST_CASE(Concatenation4dDim1, Concatenation4dDim1Test)
468 ARMNN_AUTO_TEST_CASE(Concatenation4dDim3, Concatenation4dDim3Test, false)
469 ARMNN_AUTO_TEST_CASE(Concatenation4dDim0Uint8, Concatenation4dDim0Uint8Test)
470 ARMNN_AUTO_TEST_CASE(Concatenation4dDim1Uint8, Concatenation4dDim1Uint8Test)
471 ARMNN_AUTO_TEST_CASE(Concatenation4dDim3Uint8, Concatenation4dDim3Uint8Test, false)
473 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0, Concatenation4dDiffShapeDim0Test)
474 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1, Concatenation4dDiffShapeDim1Test)
475 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3, Concatenation4dDiffShapeDim3Test, false)
476 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0Uint8, Concatenation4dDiffShapeDim0Uint8Test)
477 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1Uint8, Concatenation4dDiffShapeDim1Uint8Test)
478 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3Uint8, Concatenation4dDiffShapeDim3Uint8Test, false)
480 ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest, DataLayout::NCHW)
481 ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest, DataLayout::NCHW)
482 ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest, DataLayout::NCHW)
483 ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest, DataLayout::NCHW)
485 ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dTest, DataLayout::NHWC)
486 ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dTest, DataLayout::NHWC)
487 ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dTest, DataLayout::NHWC)
488 ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dTest, DataLayout::NHWC)
490 ARMNN_AUTO_TEST_CASE(L2Normalization2dShape, L2Normalization2dShapeTest);
492 ARMNN_AUTO_TEST_CASE(L2NormalizationDefaultEpsilon, L2NormalizationDefaultEpsilonTest, DataLayout::NCHW)
493 ARMNN_AUTO_TEST_CASE(L2NormalizationNonDefaultEpsilon, L2NormalizationNonDefaultEpsilonTest, DataLayout::NCHW)
496 ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest<DataType::Float32>)
499 ARMNN_AUTO_TEST_CASE(SimpleGreater, GreaterSimpleTest)
500 ARMNN_AUTO_TEST_CASE(GreaterBroadcast1Element, GreaterBroadcast1ElementTest)
501 ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVector, GreaterBroadcast1DVectorTest)
502 ARMNN_AUTO_TEST_CASE(GreaterUint8, GreaterUint8Test)
503 ARMNN_AUTO_TEST_CASE(GreaterBroadcast1ElementUint8, GreaterBroadcast1ElementUint8Test)
504 ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVectorUint8, GreaterBroadcast1DVectorUint8Test)
507 ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeTest<armnn::DataType::Float32>)
508 ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeTest<armnn::DataType::QuantisedAsymm8>)
509 ARMNN_AUTO_TEST_CASE(Reshape5d, Reshape5dTest<armnn::DataType::Float32>)
512 ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest)
513 ARMNN_AUTO_TEST_CASE(PadFloat322dCustomPadding, PadFloat322dCustomPaddingTest)
514 ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest)
515 ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest)
517 ARMNN_AUTO_TEST_CASE(PadUint82d, PadUint82dTest)
518 ARMNN_AUTO_TEST_CASE(PadUint82dCustomPadding, PadUint82dCustomPaddingTest)
519 ARMNN_AUTO_TEST_CASE(PadUint83d, PadUint83dTest)
520 ARMNN_AUTO_TEST_CASE(PadUint84d, PadUint84dTest)
522 ARMNN_AUTO_TEST_CASE(Pad2dQSymm16, Pad2dTestCommon<DataType::QuantisedSymm16>, 2.0f, 0, 0.0f)
523 ARMNN_AUTO_TEST_CASE(Pad2dQSymm16CustomPadding, Pad2dTestCommon<DataType::QuantisedSymm16>, 2.0f, 0, 1.0f)
524 ARMNN_AUTO_TEST_CASE(Pad3dQSymm16, Pad3dTestCommon<DataType::QuantisedSymm16>, 2.0f, 0)
525 ARMNN_AUTO_TEST_CASE(Pad4dQSymm16, Pad4dTestCommon<DataType::QuantisedSymm16>, 2.0f, 0)
528 ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteTest<DataType::Float32>)
529 ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1Test, PermuteValueSet1Test<DataType::Float32>)
530 ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2Test, PermuteValueSet2Test<DataType::Float32>)
531 ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3Test, PermuteValueSet3Test<DataType::Float32>)
532 ARMNN_AUTO_TEST_CASE(SimplePermuteQASymm8, SimplePermuteTest<DataType::QuantisedAsymm8>)
533 ARMNN_AUTO_TEST_CASE(PermuteQASymm8ValueSet1Test, PermuteValueSet1Test<DataType::QuantisedAsymm8>)
534 ARMNN_AUTO_TEST_CASE(PermuteQASymm8ValueSet2Test, PermuteValueSet2Test<DataType::QuantisedAsymm8>)
535 ARMNN_AUTO_TEST_CASE(PermuteQASymm8ValueSet3Test, PermuteValueSet3Test<DataType::QuantisedAsymm8>)
538 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection,
539 LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest)
540 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection,
541 LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest)
542 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection,
543 LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest)
544 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNorm,
545 LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNormTest)
547 ARMNN_AUTO_TEST_CASE(QuantizedLstm, QuantizedLstmTest)
550 ARMNN_AUTO_TEST_CASE(MeanSimpleFloat32, MeanSimpleTest<DataType::Float32>)
551 ARMNN_AUTO_TEST_CASE(MeanSimpleAxisFloat32, MeanSimpleAxisTest<DataType::Float32>)
552 ARMNN_AUTO_TEST_CASE(MeanKeepDimsFloat32, MeanKeepDimsTest<DataType::Float32>)
553 ARMNN_AUTO_TEST_CASE(MeanMultipleDimsFloat32, MeanMultipleDimsTest<DataType::Float32>)
554 ARMNN_AUTO_TEST_CASE(MeanVts1Float32, MeanVts1Test<DataType::Float32>)
555 ARMNN_AUTO_TEST_CASE(MeanVts2Float32, MeanVts2Test<DataType::Float32>)
556 ARMNN_AUTO_TEST_CASE(MeanVts3Float32, MeanVts3Test<DataType::Float32>)
558 ARMNN_AUTO_TEST_CASE(MeanSimpleQuantisedAsymm8, MeanSimpleTest<DataType::QuantisedAsymm8>)
559 ARMNN_AUTO_TEST_CASE(MeanSimpleAxisQuantisedAsymm8, MeanSimpleAxisTest<DataType::QuantisedAsymm8>)
560 ARMNN_AUTO_TEST_CASE(MeanKeepDimsQuantisedAsymm8, MeanKeepDimsTest<DataType::QuantisedAsymm8>)
561 ARMNN_AUTO_TEST_CASE(MeanMultipleDimsQuantisedAsymm8, MeanMultipleDimsTest<DataType::QuantisedAsymm8>)
562 ARMNN_AUTO_TEST_CASE(MeanVts1QuantisedAsymm8, MeanVts1Test<DataType::QuantisedAsymm8>)
563 ARMNN_AUTO_TEST_CASE(MeanVts2QuantisedAsymm8, MeanVts2Test<DataType::QuantisedAsymm8>)
564 ARMNN_AUTO_TEST_CASE(MeanVts3QuantisedAsymm8, MeanVts3Test<DataType::QuantisedAsymm8>)
567 ARMNN_AUTO_TEST_CASE(SimpleMaximum, MaximumSimpleTest)
568 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1Element, MaximumBroadcast1ElementTest)
569 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVector, MaximumBroadcast1DVectorTest)
570 ARMNN_AUTO_TEST_CASE(MaximumUint8, MaximumUint8Test)
571 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1ElementUint8, MaximumBroadcast1ElementUint8Test)
572 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVectorUint8, MaximumBroadcast1DVectorUint8Test)
575 ARMNN_AUTO_TEST_CASE(SimpleMinimum1, MinimumBroadcast1ElementTest1)
576 ARMNN_AUTO_TEST_CASE(SimpleMinimum2, MinimumBroadcast1ElementTest2)
577 ARMNN_AUTO_TEST_CASE(Minimum1DVectorUint8, MinimumBroadcast1DVectorUint8Test)
580 ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
581 ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest)
582 ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest)
584 // Resize Bilinear - NCHW data layout
585 ARMNN_AUTO_TEST_CASE(SimpleResizeBilinear, SimpleResizeBilinearTest<DataType::Float32>, DataLayout::NCHW)
586 ARMNN_AUTO_TEST_CASE(ResizeBilinearNop, ResizeBilinearNopTest<DataType::Float32>, DataLayout::NCHW)
587 ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMin, ResizeBilinearSqMinTest<DataType::Float32>, DataLayout::NCHW)
588 ARMNN_AUTO_TEST_CASE(ResizeBilinearMin, ResizeBilinearMinTest<DataType::Float32>, DataLayout::NCHW)
589 ARMNN_AUTO_TEST_CASE(ResizeBilinearMag, ResizeBilinearMagTest<DataType::Float32>, DataLayout::NCHW)
591 ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8,
592 SimpleResizeBilinearTest<DataType::QuantisedAsymm8>,
594 ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8,
595 ResizeBilinearNopTest<DataType::QuantisedAsymm8>,
597 ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8,
598 ResizeBilinearSqMinTest<DataType::QuantisedAsymm8>,
600 ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8,
601 ResizeBilinearMinTest<DataType::QuantisedAsymm8>,
603 ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8,
604 ResizeBilinearMagTest<DataType::QuantisedAsymm8>,
607 // Resize Bilinear - NHWC data layout
608 ARMNN_AUTO_TEST_CASE(ResizeBilinearNopNhwc,
609 ResizeBilinearNopTest<DataType::Float32>,
611 ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearNhwc,
612 SimpleResizeBilinearTest<DataType::Float32>,
614 ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinNhwc,
615 ResizeBilinearSqMinTest<DataType::Float32>,
617 ARMNN_AUTO_TEST_CASE(ResizeBilinearMinNhwc,
618 ResizeBilinearMinTest<DataType::Float32>,
620 ARMNN_AUTO_TEST_CASE(ResizeBilinearMagNhwc,
621 ResizeBilinearMagTest<DataType::Float32>,
624 ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8Nhwc,
625 ResizeBilinearNopTest<DataType::QuantisedAsymm8>,
627 ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8Nhwc,
628 SimpleResizeBilinearTest<DataType::QuantisedAsymm8>,
630 ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8Nhwc,
631 ResizeBilinearSqMinTest<DataType::QuantisedAsymm8>,
633 ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8Nhwc,
634 ResizeBilinearMinTest<DataType::QuantisedAsymm8>,
636 ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8Nhwc,
637 ResizeBilinearMagTest<DataType::QuantisedAsymm8>,
640 // Resize NearestNeighbor - NCHW
641 ARMNN_AUTO_TEST_CASE(SimpleResizeNearestNeighbor,
642 SimpleResizeNearestNeighborTest<DataType::Float32>,
644 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborNop,
645 ResizeNearestNeighborNopTest<DataType::Float32>,
647 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborSqMin,
648 ResizeNearestNeighborSqMinTest<DataType::Float32>,
650 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMin,
651 ResizeNearestNeighborMinTest<DataType::Float32>,
653 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMag,
654 ResizeNearestNeighborMagTest<DataType::Float32>,
655 DataLayout::NCHW, 0.1f, 50, 0.1f, 50)
657 ARMNN_AUTO_TEST_CASE(SimpleResizeNearestNeighborUint8,
658 SimpleResizeNearestNeighborTest<DataType::QuantisedAsymm8>,
660 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborNopUint8,
661 ResizeNearestNeighborNopTest<DataType::QuantisedAsymm8>,
663 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborSqMinUint8,
664 ResizeNearestNeighborSqMinTest<DataType::QuantisedAsymm8>,
666 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMinUint8,
667 ResizeNearestNeighborMinTest<DataType::QuantisedAsymm8>,
669 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMagUint8,
670 ResizeNearestNeighborMagTest<DataType::QuantisedAsymm8>,
671 DataLayout::NCHW, 0.1f, 50, 0.1f, 50)
673 // Resize NearestNeighbor - NHWC
674 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborNopNhwc,
675 ResizeNearestNeighborNopTest<DataType::Float32>,
677 ARMNN_AUTO_TEST_CASE(SimpleResizeNearestNeighborNhwc,
678 SimpleResizeNearestNeighborTest<DataType::Float32>,
680 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborSqMinNhwc,
681 ResizeNearestNeighborSqMinTest<DataType::Float32>,
683 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMinNhwc,
684 ResizeNearestNeighborMinTest<DataType::Float32>,
686 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMagNhwc,
687 ResizeNearestNeighborMagTest<DataType::Float32>,
688 DataLayout::NHWC, 0.1f, 50, 0.1f, 50)
690 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborNopUint8Nhwc,
691 ResizeNearestNeighborNopTest<DataType::QuantisedAsymm8>,
693 ARMNN_AUTO_TEST_CASE(SimpleResizeNearestNeighborUint8Nhwc,
694 SimpleResizeNearestNeighborTest<DataType::QuantisedAsymm8>,
696 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborSqMinUint8Nhwc,
697 ResizeNearestNeighborSqMinTest<DataType::QuantisedAsymm8>,
699 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMinUint8Nhwc,
700 ResizeNearestNeighborMinTest<DataType::QuantisedAsymm8>,
702 ARMNN_AUTO_TEST_CASE(ResizeNearestNeighborMagUint8Nhwc,
703 ResizeNearestNeighborMagTest<DataType::QuantisedAsymm8>,
704 DataLayout::NHWC, 0.1f, 50, 0.1f, 50)
707 ARMNN_AUTO_TEST_CASE(StridedSlice4DFloat32, StridedSlice4DFloat32Test)
708 ARMNN_AUTO_TEST_CASE(StridedSlice4DReverseFloat32, StridedSlice4DReverseFloat32Test)
709 ARMNN_AUTO_TEST_CASE(StridedSliceSimpleStrideFloat32, StridedSliceSimpleStrideFloat32Test)
710 ARMNN_AUTO_TEST_CASE(StridedSliceSimpleRangeMaskFloat32, StridedSliceSimpleRangeMaskFloat32Test)
711 ARMNN_AUTO_TEST_CASE(StridedSliceShrinkAxisMaskFloat32, StridedSliceShrinkAxisMaskFloat32Test)
712 ARMNN_AUTO_TEST_CASE(StridedSlice3DFloat32, StridedSlice3DFloat32Test)
713 ARMNN_AUTO_TEST_CASE(StridedSlice3DReverseFloat32, StridedSlice3DReverseFloat32Test)
714 ARMNN_AUTO_TEST_CASE(StridedSlice2DFloat32, StridedSlice2DFloat32Test)
715 ARMNN_AUTO_TEST_CASE(StridedSlice2DReverseFloat32, StridedSlice2DReverseFloat32Test)
717 ARMNN_AUTO_TEST_CASE(StridedSlice4DUint8, StridedSlice4DUint8Test)
718 ARMNN_AUTO_TEST_CASE(StridedSlice4DReverseUint8, StridedSlice4DReverseUint8Test)
719 ARMNN_AUTO_TEST_CASE(StridedSliceSimpleStrideUint8, StridedSliceSimpleStrideUint8Test)
720 ARMNN_AUTO_TEST_CASE(StridedSliceSimpleRangeMaskUint8, StridedSliceSimpleRangeMaskUint8Test)
721 ARMNN_AUTO_TEST_CASE(StridedSliceShrinkAxisMaskUint8, StridedSliceShrinkAxisMaskUint8Test)
722 ARMNN_AUTO_TEST_CASE(StridedSlice3DUint8, StridedSlice3DUint8Test)
723 ARMNN_AUTO_TEST_CASE(StridedSlice3DReverseUint8, StridedSlice3DReverseUint8Test)
724 ARMNN_AUTO_TEST_CASE(StridedSlice2DUint8, StridedSlice2DUint8Test)
725 ARMNN_AUTO_TEST_CASE(StridedSlice2DReverseUint8, StridedSlice2DReverseUint8Test)
728 ARMNN_AUTO_TEST_CASE(QuantizeSimpleUint8, QuantizeSimpleUint8Test)
729 ARMNN_AUTO_TEST_CASE(QuantizeClampUint8, QuantizeClampUint8Test)
732 ARMNN_AUTO_TEST_CASE(PreluFloat32, PreluTest<DataType::Float32>)
733 ARMNN_AUTO_TEST_CASE(PreluUint8, PreluTest<DataType::QuantisedAsymm8>)
736 ARMNN_AUTO_TEST_CASE(Stack0Axis, Stack0AxisTest<armnn::DataType::Float32>)
737 ARMNN_AUTO_TEST_CASE(Stack4dOutput1Axis, Stack4dOutput1AxisTest<armnn::DataType::Float32>)
738 ARMNN_AUTO_TEST_CASE(Stack4dOutput2Axis, Stack4dOutput2AxisTest<armnn::DataType::Float32>)
739 ARMNN_AUTO_TEST_CASE(Stack4dOutput3Axis, Stack4dOutput3AxisTest<armnn::DataType::Float32>)
740 ARMNN_AUTO_TEST_CASE(Stack3dOutput1Axis3Input, Stack3dOutput1Axis3InputTest<armnn::DataType::Float32>)
741 ARMNN_AUTO_TEST_CASE(Stack5dOutput, Stack5dOutputTest<armnn::DataType::Float32>)
743 // TransposeConvolution2d
744 ARMNN_AUTO_TEST_CASE(SimpleTransposeConvolution2dFloatNchw,
745 SimpleTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
748 ARMNN_AUTO_TEST_CASE(SimpleTransposeConvolution2dFloatNhwc,
749 SimpleTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
752 ARMNN_AUTO_TEST_CASE(SimpleTransposeConvolution2dUint8Nchw,
753 SimpleTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
756 ARMNN_AUTO_TEST_CASE(SimpleTransposeConvolution2dUint8Nhwc,
757 SimpleTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
761 ARMNN_AUTO_TEST_CASE(UnbiasedSimpleTransposeConvolution2dFloatNchw,
762 SimpleTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
765 ARMNN_AUTO_TEST_CASE(UnbiasedSimpleTransposeConvolution2dFloatNhwc,
766 SimpleTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
769 ARMNN_AUTO_TEST_CASE(UnbiasedSimpleTransposeConvolution2dUint8Nchw,
770 SimpleTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
773 ARMNN_AUTO_TEST_CASE(UnbiasedSimpleTransposeConvolution2dUint8Nhwc,
774 SimpleTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
778 ARMNN_AUTO_TEST_CASE(PaddedTransposeConvolution2dFloatNchw,
779 PaddedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
782 ARMNN_AUTO_TEST_CASE(PaddedTransposeConvolution2dFloatNhwc,
783 PaddedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
786 ARMNN_AUTO_TEST_CASE(PaddedTransposeConvolution2dUint8Nchw,
787 PaddedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
790 ARMNN_AUTO_TEST_CASE(PaddedTransposeConvolution2dUint8Nhwc,
791 PaddedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
795 ARMNN_AUTO_TEST_CASE(UnbiasedPaddedTransposeConvolution2dFloatNchw,
796 PaddedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
799 ARMNN_AUTO_TEST_CASE(UnbiasedPaddedTransposeConvolution2dFloatNhwc,
800 PaddedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
803 ARMNN_AUTO_TEST_CASE(UnbiasedPaddedTransposeConvolution2dUint8Nchw,
804 PaddedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
807 ARMNN_AUTO_TEST_CASE(UnbiasedPaddedTransposeConvolution2dUint8Nhwc,
808 PaddedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
812 ARMNN_AUTO_TEST_CASE(StridedTransposeConvolution2dFloatNchw,
813 StridedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
816 ARMNN_AUTO_TEST_CASE(StridedTransposeConvolution2dFloatNhwc,
817 StridedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
820 ARMNN_AUTO_TEST_CASE(StridedTransposeConvolution2dUint8Nchw,
821 StridedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
824 ARMNN_AUTO_TEST_CASE(StridedTransposeConvolution2dUint8Nhwc,
825 StridedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
829 ARMNN_AUTO_TEST_CASE(UnbiasedStridedTransposeConvolution2dFloatNchw,
830 StridedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
833 ARMNN_AUTO_TEST_CASE(UnbiasedStridedTransposeConvolution2dFloatNhwc,
834 StridedTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
837 ARMNN_AUTO_TEST_CASE(UnbiasedStridedTransposeConvolution2dUint8Nchw,
838 StridedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
841 ARMNN_AUTO_TEST_CASE(UnbiasedStridedTransposeConvolution2dUint8Nhwc,
842 StridedTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
846 ARMNN_AUTO_TEST_CASE(MultiChannelTransposeConvolution2dFloatNchw,
847 MultiChannelTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
849 ARMNN_AUTO_TEST_CASE(MultiChannelTransposeConvolution2dFloatNhwc,
850 MultiChannelTransposeConvolution2dTest<DataType::Float32, DataType::Float32>,
852 ARMNN_AUTO_TEST_CASE(MultiChannelTransposeConvolution2dUint8Nchw,
853 MultiChannelTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
855 ARMNN_AUTO_TEST_CASE(MultiChannelTransposeConvolution2dUint8Nhwc,
856 MultiChannelTransposeConvolution2dTest<DataType::QuantisedAsymm8, DataType::Signed32>,
859 #if defined(ARMCOMPUTEREF_ENABLED)
861 // The ARMNN_COMPARE_REF_AUTO_TEST_CASE and the ARMNN_COMPARE_REF_FIXTURE_TEST_CASE test units are not available
862 // if the reference backend is not built
864 // ============================================================================
867 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest)
869 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32,
870 CompareDepthwiseConvolution2dFloatTest,
872 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8,
873 CompareDepthwiseConvolution2dUint8Test,
876 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32Nhwc,
877 CompareDepthwiseConvolution2dFloatTest,
879 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8Nhwc,
880 CompareDepthwiseConvolution2dUint8Test,
883 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest,
884 NormalizationAlgorithmChannel::Within,
885 NormalizationAlgorithmMethod::LocalBrightness)
886 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest,
887 NormalizationAlgorithmChannel::Across,
888 NormalizationAlgorithmMethod::LocalBrightness)
890 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReference, ComparePooling2dTest, PoolingAlgorithm::Max)
891 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReferenceUint8, ComparePooling2dUint8Test,
892 PoolingAlgorithm::Max)
893 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReference, ComparePooling2dTest,
894 PoolingAlgorithm::Average)
895 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReferenceUint8, ComparePooling2dUint8Test,
896 PoolingAlgorithm::Average)
897 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithReference, ComparePooling2dTest, PoolingAlgorithm::L2)
898 ARMNN_COMPARE_REF_AUTO_TEST_CASE(UNSUPPORTED_CompareL2Pooling2dWithReferenceUint8, ComparePooling2dUint8Test,
899 PoolingAlgorithm::L2)
901 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f)
902 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f)
904 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta1WithReference, CompareSoftmaxUint8Test, 1.0f)
905 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta2WithReference, CompareSoftmaxUint8Test, 2.0f)
907 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest)
909 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMultiplicationTest)
911 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
913 ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
914 ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
916 // ============================================================================
919 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture,
920 CompareActivationTest, ActivationFunction::Sigmoid, 5u)
922 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture,
923 CompareActivationTest, ActivationFunction::TanH, 5u)
925 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture,
926 CompareActivationTest, ActivationFunction::Linear, 5u)
928 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture,
929 CompareActivationTest, ActivationFunction::ReLu, 5u)
931 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture,
932 CompareActivationTest, ActivationFunction::BoundedReLu, 5u)
933 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture,
934 CompareActivationUint8Test, ActivationFunction::BoundedReLu)
936 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture,
937 CompareActivationTest, ActivationFunction::SoftReLu, 1u)
939 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture,
940 CompareActivationTest, ActivationFunction::LeakyReLu, 5u)
942 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture,
943 CompareActivationTest, ActivationFunction::Abs, 5u)
945 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture,
946 CompareActivationTest, ActivationFunction::Sqrt, 5u)
948 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
949 CompareActivationTest, ActivationFunction::Square, 5u)
953 BOOST_AUTO_TEST_SUITE_END()