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/TensorCopyUtils.hpp>
18 #include <backendsCommon/test/WorkloadTestUtils.hpp>
20 #include <boost/test/unit_test.hpp>
22 BOOST_AUTO_TEST_SUITE(Compute_ArmComputeNeon)
23 using FactoryType = armnn::NeonWorkloadFactory;
25 // ============================================================================
29 ARMNN_AUTO_TEST_CASE(SimpleConvolution1d, Convolution1dTest, true)
31 ARMNN_AUTO_TEST_CASE(SimpleConvolution2d, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NCHW)
32 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dNhwc, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NHWC)
33 ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NCHW)
34 ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8Nhwc, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NHWC)
35 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2d, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NCHW)
36 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dNhwc, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NHWC)
37 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dStride2x2Nhwc,
38 SimpleConvolution2d3x3Stride2x2Test, false, armnn::DataLayout::NHWC)
40 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquare, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NCHW)
41 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPadding, Convolution2dAsymmetricPaddingTest, armnn::DataLayout::NCHW)
43 ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquareNhwc, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NHWC)
44 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPaddingNhwc,
45 Convolution2dAsymmetricPaddingTest,
46 armnn::DataLayout::NHWC)
48 ARMNN_AUTO_TEST_CASE(SimpleConvolution2dSquareNhwc, SimpleConvolution2d3x3NhwcTest, false)
50 // Depthwise Convolution
51 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1,
52 DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NCHW)
53 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1,
54 DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NCHW)
55 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8,
56 DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NCHW)
57 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8,
58 DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NCHW)
60 // NHWC Depthwise Convolution
61 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1NHhwc,
62 DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NHWC)
63 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Nhwc,
64 DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NHWC)
65 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8Nhwc,
66 DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NHWC)
67 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8Nhwc,
68 DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NHWC)
70 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthNhwc, DepthwiseConvolution2dDepthNhwcTest, false)
73 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetric,
74 DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NCHW)
75 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetric,
76 DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NCHW)
77 ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetricNhwc,
78 DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NHWC)
79 ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetricNhwc,
80 DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NHWC)
85 armnn::DepthwiseConvolution2dDescriptor MakeDepthwiseConv2dDesc(uint32_t strideX, uint32_t strideY,
86 uint32_t depthMultiplier = 1, uint32_t padLeft = 0, uint32_t padRight = 0,
87 uint32_t padTop = 0, uint32_t padBottom = 0)
89 boost::ignore_unused(depthMultiplier);
91 armnn::DepthwiseConvolution2dDescriptor desc;
93 desc.m_PadLeft = padLeft;
94 desc.m_PadRight = padRight;
96 desc.m_PadTop = padTop;
97 desc.m_PadBottom = padBottom;
98 desc.m_StrideX = strideX;
99 desc.m_StrideY = strideY;
100 desc.m_BiasEnabled = false;
105 armnn::TensorInfo CreateOutputTensorInfo(const armnn::TensorInfo& inputInfo,
106 const armnn::TensorInfo& weightsInfo,
107 const armnn::DepthwiseConvolution2dDescriptor& descriptor,
108 armnn::DataType dataType)
110 const armnn::TensorShape& inputShape = inputInfo.GetShape();
111 const armnn::TensorShape& filterShape = weightsInfo.GetShape();
113 unsigned int inWidth = inputShape[3];
114 unsigned int inHeight = inputShape[2];
115 unsigned int inBatchSize = inputShape[0];
117 unsigned int filterWidth = filterShape[3];
118 unsigned int readWidth = (inWidth + descriptor.m_PadLeft + descriptor.m_PadRight) - (filterWidth);
119 unsigned int outWidth = 1u + (readWidth / descriptor.m_StrideX);
121 unsigned int filterHeight = filterShape[2];
122 unsigned int readHeight = (inHeight + descriptor.m_PadTop + descriptor.m_PadBottom) - (filterHeight);
123 unsigned int outHeight = 1u + (readHeight / descriptor.m_StrideY);
124 unsigned int depthMultiplier = filterShape[0];
126 unsigned int outChannels = filterShape[1] * depthMultiplier;
127 unsigned int outBatchSize = inBatchSize;
129 armnn::TensorShape outputShape({outBatchSize, outChannels, outHeight, outWidth});
130 return armnn::TensorInfo(outputShape, dataType);
134 BOOST_AUTO_TEST_CASE(DepthwiseConv2dUtils)
136 const armnn::DataType dataType = armnn::DataType::Float32;
138 armnn::TensorInfo inputInfo({1, 1, 10, 10 }, dataType);
139 armnn::TensorInfo outputInfo;
140 armnn::TensorInfo weightsInfo3x3({ 1, 1, 3, 3 }, dataType);
141 armnn::TensorInfo biasesInfo;
143 armnn::DepthwiseConvolution2dDescriptor descriptor;
144 armnn::NeonLayerSupport layerSupport;
146 // Strides supported: 1,2,3
147 descriptor = MakeDepthwiseConv2dDesc(1, 1);
148 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
149 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
150 weightsInfo3x3, biasesInfo));
152 descriptor = MakeDepthwiseConv2dDesc(1, 2);
153 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
154 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
155 weightsInfo3x3, biasesInfo));
157 descriptor = MakeDepthwiseConv2dDesc(1, 3);
158 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
159 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
160 weightsInfo3x3, biasesInfo));
162 descriptor = MakeDepthwiseConv2dDesc(2, 1);
163 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
164 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
165 weightsInfo3x3, biasesInfo));
167 descriptor = MakeDepthwiseConv2dDesc(2, 2);
168 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
169 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
170 weightsInfo3x3, biasesInfo));
172 descriptor = MakeDepthwiseConv2dDesc(2, 3);
173 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
174 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
175 weightsInfo3x3, biasesInfo));
177 descriptor = MakeDepthwiseConv2dDesc(3, 1);
178 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
179 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
180 weightsInfo3x3, biasesInfo));
182 descriptor = MakeDepthwiseConv2dDesc(3, 2);
183 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
184 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
185 weightsInfo3x3, biasesInfo));
187 descriptor = MakeDepthwiseConv2dDesc(3, 3);
188 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
189 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
190 weightsInfo3x3, biasesInfo));
192 // Supported stride 4
193 descriptor = MakeDepthwiseConv2dDesc(4, 1);
194 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
195 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
196 weightsInfo3x3, biasesInfo));
198 // Supported weights shape 1x1
199 armnn::TensorInfo weightsInfo1x1({ 1, 1, 1, 1 }, armnn::DataType::Float32);
200 descriptor = MakeDepthwiseConv2dDesc(1, 1);
201 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo1x1, descriptor, dataType);
202 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
203 weightsInfo1x1, biasesInfo));
205 // Supported shape 2x2
206 armnn::TensorInfo weightsInfo2x2({ 1, 1, 2, 2 }, armnn::DataType::Float32);
207 descriptor = MakeDepthwiseConv2dDesc(1, 1);
208 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo2x2, descriptor, dataType);
209 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
210 weightsInfo2x2, biasesInfo));
212 // Asymmetric padding
213 descriptor = MakeDepthwiseConv2dDesc(1, 1, 1, 1, 2, 1, 2);
214 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
215 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
216 weightsInfo3x3, biasesInfo));
220 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true)
221 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true)
223 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2d, SimpleMaxPooling2dTest, armnn::DataLayout::NCHW)
224 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dNhwc, SimpleMaxPooling2dTest, armnn::DataLayout::NHWC)
225 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NCHW)
226 ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8Nhwc, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NHWC)
228 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
229 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
230 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NCHW)
231 ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8Nhwc, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NHWC)
233 ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest)
234 ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test)
236 ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest, armnn::DataLayout::NCHW)
237 ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2dNeon, SimpleL2Pooling2dTest, armnn::DataLayout::NHWC)
238 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test, armnn::DataLayout::NCHW)
240 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test)
241 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test)
242 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test)
243 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test)
244 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test)
245 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test)
246 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test)
247 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test)
248 ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test)
249 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test)
251 // Ignore padding values for pooling but count padding fields into the divisor
252 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest)
253 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test)
254 ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test)
255 ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test)
257 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest)
258 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test)
259 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest)
260 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8,
261 IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test)
262 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test)
263 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test)
264 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2,
265 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, false)
266 ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding,
267 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
270 ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest)
271 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test)
272 ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test)
273 ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test)
276 ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
278 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
279 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
281 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f)
282 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f)
284 ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
285 ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
288 ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest)
289 ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
291 ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
292 ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
295 ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest)
296 ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test)
299 ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
300 ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false)
301 ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true)
302 ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false)
303 ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true)
304 ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedUint8Test, false)
305 ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedUint8Test, true)
308 ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)
309 ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest)
310 ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest)
313 ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest)
314 ARMNN_AUTO_TEST_CASE(SubBroadcast1Element, SubtractionBroadcast1ElementTest)
315 ARMNN_AUTO_TEST_CASE(SubBroadcast, SubtractionBroadcastTest)
318 ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest)
319 ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest)
320 ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest)
323 ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest)
324 ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest)
327 ARMNN_AUTO_TEST_CASE(Constant, ConstantTest)
328 ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantTestUint8)
331 ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest)
332 ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test)
334 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test)
335 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test)
336 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test)
337 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test)
339 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest)
340 ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test)
341 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest)
342 ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test)
344 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test)
345 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test)
346 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test)
347 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test)
348 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test, false)
349 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test, false)
351 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest)
352 ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test)
353 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest)
354 ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test)
355 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest, false)
356 ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test, false)
358 ARMNN_AUTO_TEST_CASE(Concatenation4dDim0, Concatenation4dDim0Test)
359 ARMNN_AUTO_TEST_CASE(Concatenation4dDim1, Concatenation4dDim1Test)
360 ARMNN_AUTO_TEST_CASE(Concatenation4dDim3, Concatenation4dDim3Test, false)
361 ARMNN_AUTO_TEST_CASE(Concatenation4dDim0Uint8, Concatenation4dDim0Uint8Test)
362 ARMNN_AUTO_TEST_CASE(Concatenation4dDim1Uint8, Concatenation4dDim1Uint8Test)
363 ARMNN_AUTO_TEST_CASE(Concatenation4dDim3Uint8, Concatenation4dDim3Uint8Test, false)
365 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0, Concatenation4dDiffShapeDim0Test)
366 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1, Concatenation4dDiffShapeDim1Test)
367 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3, Concatenation4dDiffShapeDim3Test, false)
368 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0Uint8, Concatenation4dDiffShapeDim0Uint8Test)
369 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1Uint8, Concatenation4dDiffShapeDim1Uint8Test)
370 ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3Uint8, Concatenation4dDiffShapeDim3Uint8Test, false)
372 ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest, armnn::DataLayout::NCHW)
373 ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest, armnn::DataLayout::NCHW)
374 ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest, armnn::DataLayout::NCHW)
375 ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest, armnn::DataLayout::NCHW)
377 ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dTest, armnn::DataLayout::NHWC)
378 ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dTest, armnn::DataLayout::NHWC)
379 ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dTest, armnn::DataLayout::NHWC)
380 ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dTest, armnn::DataLayout::NHWC)
383 ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest)
386 ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeFloat32Test)
387 ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeUint8Test)
390 ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteFloat32Test)
391 ARMNN_AUTO_TEST_CASE(SimplePermuteUint8, SimplePermuteUint8Test)
392 ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1, PermuteFloat32ValueSet1Test)
393 ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2, PermuteFloat32ValueSet2Test)
394 ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3, PermuteFloat32ValueSet3Test)
397 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection,
398 LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest)
399 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection,
400 LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest)
401 ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection,
402 LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest)
405 ARMNN_AUTO_TEST_CASE(MeanUint8Simple, MeanUint8SimpleTest)
406 ARMNN_AUTO_TEST_CASE(MeanUint8SimpleAxis, MeanUint8SimpleAxisTest)
407 ARMNN_AUTO_TEST_CASE(MeanUint8KeepDims, MeanUint8KeepDimsTest)
408 ARMNN_AUTO_TEST_CASE(MeanUint8MultipleDims, MeanUint8MultipleDimsTest)
409 ARMNN_AUTO_TEST_CASE(MeanVtsUint8, MeanVtsUint8Test)
411 ARMNN_AUTO_TEST_CASE(MeanFloatSimple, MeanFloatSimpleTest)
412 ARMNN_AUTO_TEST_CASE(MeanFloatSimpleAxis, MeanFloatSimpleAxisTest)
413 ARMNN_AUTO_TEST_CASE(MeanFloatKeepDims, MeanFloatKeepDimsTest)
414 ARMNN_AUTO_TEST_CASE(MeanFloatMultipleDims, MeanFloatMultipleDimsTest)
415 ARMNN_AUTO_TEST_CASE(MeanVtsFloat1, MeanVtsFloat1Test)
416 ARMNN_AUTO_TEST_CASE(MeanVtsFloat2, MeanVtsFloat2Test)
417 ARMNN_AUTO_TEST_CASE(MeanVtsFloat3, MeanVtsFloat3Test)
420 ARMNN_AUTO_TEST_CASE(SimpleMaximum, MaximumSimpleTest)
421 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1Element, MaximumBroadcast1ElementTest)
422 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVector, MaximumBroadcast1DVectorTest)
423 ARMNN_AUTO_TEST_CASE(MaximumUint8, MaximumUint8Test)
424 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1ElementUint8, MaximumBroadcast1ElementUint8Test)
425 ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVectorUint8, MaximumBroadcast1DVectorUint8Test)
428 ARMNN_AUTO_TEST_CASE(SimpleMinimum1, MinimumBroadcast1ElementTest1)
429 ARMNN_AUTO_TEST_CASE(SimpleMinimum2, MinimumBroadcast1ElementTest2)
430 ARMNN_AUTO_TEST_CASE(Minimum1DVectorUint8, MinimumBroadcast1DVectorUint8Test)
433 ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
434 ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest)
435 ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest)
437 // ============================================================================
440 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest)
442 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32,
443 CompareDepthwiseConvolution2dFloatTest,
444 armnn::DataLayout::NCHW)
445 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8,
446 CompareDepthwiseConvolution2dUint8Test,
447 armnn::DataLayout::NCHW)
449 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32Nhwc,
450 CompareDepthwiseConvolution2dFloatTest,
451 armnn::DataLayout::NHWC)
452 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8Nhwc,
453 CompareDepthwiseConvolution2dUint8Test,
454 armnn::DataLayout::NHWC)
456 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest,
457 armnn::NormalizationAlgorithmChannel::Within,
458 armnn::NormalizationAlgorithmMethod::LocalBrightness)
459 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest,
460 armnn::NormalizationAlgorithmChannel::Across,
461 armnn::NormalizationAlgorithmMethod::LocalBrightness)
463 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::Max)
464 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReferenceUint8, ComparePooling2dUint8Test,
465 armnn::PoolingAlgorithm::Max)
466 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReference, ComparePooling2dTest,
467 armnn::PoolingAlgorithm::Average)
468 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReferenceUint8, ComparePooling2dUint8Test,
469 armnn::PoolingAlgorithm::Average)
470 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::L2)
471 ARMNN_COMPARE_REF_AUTO_TEST_CASE(UNSUPPORTED_CompareL2Pooling2dWithReferenceUint8, ComparePooling2dUint8Test,
472 armnn::PoolingAlgorithm::L2)
474 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f)
475 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f)
477 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta1WithReference, CompareSoftmaxUint8Test, 1.0f)
478 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta2WithReference, CompareSoftmaxUint8Test, 2.0f)
480 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest)
482 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMultiplicationTest)
484 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
486 ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
487 ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
489 // ============================================================================
492 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture,
493 CompareActivationTest, armnn::ActivationFunction::Sigmoid, 5u)
495 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture,
496 CompareActivationTest, armnn::ActivationFunction::TanH, 5u)
498 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture,
499 CompareActivationTest, armnn::ActivationFunction::Linear, 5u)
501 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture,
502 CompareActivationTest, armnn::ActivationFunction::ReLu, 5u)
504 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture,
505 CompareActivationTest, armnn::ActivationFunction::BoundedReLu, 5u)
506 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture,
507 CompareActivationUint8Test, armnn::ActivationFunction::BoundedReLu)
509 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture,
510 CompareActivationTest, armnn::ActivationFunction::SoftReLu, 1u)
512 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture,
513 CompareActivationTest, armnn::ActivationFunction::LeakyReLu, 5u)
515 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture,
516 CompareActivationTest, armnn::ActivationFunction::Abs, 5u)
518 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture,
519 CompareActivationTest, armnn::ActivationFunction::Sqrt, 5u)
521 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
522 CompareActivationTest, armnn::ActivationFunction::Square, 5u)
523 BOOST_AUTO_TEST_SUITE_END()