blob: 58618b4298b3b9077c740f48e724eba833ad5bc4 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
telsoa014fcda012018-03-09 14:13:49 +00005
Aron Virginas-Tar56055192018-11-12 18:10:43 +00006#include "NeonWorkloadFactoryHelper.hpp"
7
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +00008#include <test/TensorHelpers.hpp>
9#include <test/UnitTests.hpp>
telsoa014fcda012018-03-09 14:13:49 +000010
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000011#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>
telsoa014fcda012018-03-09 14:13:49 +000019
arovir0143095f32018-10-09 18:04:24 +010020#include <boost/test/unit_test.hpp>
telsoa014fcda012018-03-09 14:13:49 +000021
22BOOST_AUTO_TEST_SUITE(Compute_ArmComputeNeon)
23using FactoryType = armnn::NeonWorkloadFactory;
24
25// ============================================================================
26// UNIT tests
27
28// Convolution
29ARMNN_AUTO_TEST_CASE(SimpleConvolution1d, Convolution1dTest, true)
30
jimfly010a088a62018-10-25 17:05:05 +010031ARMNN_AUTO_TEST_CASE(SimpleConvolution2d, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NCHW)
32ARMNN_AUTO_TEST_CASE(SimpleConvolution2dNhwc, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NHWC)
narpra015f703182018-10-26 16:24:58 +010033ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NCHW)
34ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8Nhwc, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NHWC)
jimfly010a088a62018-10-25 17:05:05 +010035ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2d, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NCHW)
36ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dNhwc, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NHWC)
Mike Kelly7332ed82018-12-20 17:03:06 +000037ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dStride2x2Nhwc,
38 SimpleConvolution2d3x3Stride2x2Test, false, armnn::DataLayout::NHWC)
jimfly010a088a62018-10-25 17:05:05 +010039
narpra015f703182018-10-26 16:24:58 +010040ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquare, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NCHW)
41ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPadding, Convolution2dAsymmetricPaddingTest, armnn::DataLayout::NCHW)
42
43ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquareNhwc, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NHWC)
44ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPaddingNhwc,
45 Convolution2dAsymmetricPaddingTest,
46 armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +000047
Francis Murtaghd59116e2018-10-04 16:03:07 +010048ARMNN_AUTO_TEST_CASE(SimpleConvolution2dSquareNhwc, SimpleConvolution2d3x3NhwcTest, false)
telsoa014fcda012018-03-09 14:13:49 +000049
50// Depthwise Convolution
jimfly01b9c89632018-10-26 16:50:13 +010051ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1,
52 DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NCHW)
53ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1,
54 DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NCHW)
55ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8,
56 DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NCHW)
57ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8,
58 DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NCHW)
59
60// NHWC Depthwise Convolution
61ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1NHhwc,
62 DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NHWC)
63ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Nhwc,
64 DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NHWC)
65ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8Nhwc,
66 DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NHWC)
67ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8Nhwc,
68 DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NHWC)
69
Nikhil Rajcec6b652018-10-12 13:51:57 +010070ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthNhwc, DepthwiseConvolution2dDepthNhwcTest, false)
Bruno Goncalves22972f02019-04-26 21:03:24 -030071ARMNN_AUTO_TEST_CASE(SimpleDepthwiseConvolution2d3x3Dilation3x3Nhwc,
72 SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTest)
jimfly01b9c89632018-10-26 16:50:13 +010073
telsoa014fcda012018-03-09 14:13:49 +000074
jimfly01382a91d2018-10-26 15:55:50 +010075ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetric,
76 DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NCHW)
77ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetric,
78 DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NCHW)
79ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetricNhwc,
80 DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NHWC)
81ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetricNhwc,
82 DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NHWC)
surmeh013537c2c2018-05-18 16:31:43 +010083
telsoa014fcda012018-03-09 14:13:49 +000084namespace
85{
86
87armnn::DepthwiseConvolution2dDescriptor MakeDepthwiseConv2dDesc(uint32_t strideX, uint32_t strideY,
88 uint32_t depthMultiplier = 1, uint32_t padLeft = 0, uint32_t padRight = 0,
89 uint32_t padTop = 0, uint32_t padBottom = 0)
90{
telsoa01c577f2c2018-08-31 09:22:23 +010091 boost::ignore_unused(depthMultiplier);
92
telsoa014fcda012018-03-09 14:13:49 +000093 armnn::DepthwiseConvolution2dDescriptor desc;
telsoa01c577f2c2018-08-31 09:22:23 +010094
telsoa014fcda012018-03-09 14:13:49 +000095 desc.m_PadLeft = padLeft;
96 desc.m_PadRight = padRight;
telsoa01c577f2c2018-08-31 09:22:23 +010097
telsoa014fcda012018-03-09 14:13:49 +000098 desc.m_PadTop = padTop;
99 desc.m_PadBottom = padBottom;
100 desc.m_StrideX = strideX;
101 desc.m_StrideY = strideY;
telsoa01c577f2c2018-08-31 09:22:23 +0100102 desc.m_BiasEnabled = false;
103
telsoa014fcda012018-03-09 14:13:49 +0000104 return desc;
105}
106
telsoa01c577f2c2018-08-31 09:22:23 +0100107armnn::TensorInfo CreateOutputTensorInfo(const armnn::TensorInfo& inputInfo,
108 const armnn::TensorInfo& weightsInfo,
109 const armnn::DepthwiseConvolution2dDescriptor& descriptor,
110 armnn::DataType dataType)
111{
112 const armnn::TensorShape& inputShape = inputInfo.GetShape();
113 const armnn::TensorShape& filterShape = weightsInfo.GetShape();
114
115 unsigned int inWidth = inputShape[3];
116 unsigned int inHeight = inputShape[2];
117 unsigned int inBatchSize = inputShape[0];
118
119 unsigned int filterWidth = filterShape[3];
120 unsigned int readWidth = (inWidth + descriptor.m_PadLeft + descriptor.m_PadRight) - (filterWidth);
121 unsigned int outWidth = 1u + (readWidth / descriptor.m_StrideX);
122
123 unsigned int filterHeight = filterShape[2];
124 unsigned int readHeight = (inHeight + descriptor.m_PadTop + descriptor.m_PadBottom) - (filterHeight);
125 unsigned int outHeight = 1u + (readHeight / descriptor.m_StrideY);
126 unsigned int depthMultiplier = filterShape[0];
127
128 unsigned int outChannels = filterShape[1] * depthMultiplier;
129 unsigned int outBatchSize = inBatchSize;
130
131 armnn::TensorShape outputShape({outBatchSize, outChannels, outHeight, outWidth});
132 return armnn::TensorInfo(outputShape, dataType);
133}
telsoa014fcda012018-03-09 14:13:49 +0000134}
135
136BOOST_AUTO_TEST_CASE(DepthwiseConv2dUtils)
137{
telsoa01c577f2c2018-08-31 09:22:23 +0100138 const armnn::DataType dataType = armnn::DataType::Float32;
139
140 armnn::TensorInfo inputInfo({1, 1, 10, 10 }, dataType);
141 armnn::TensorInfo outputInfo;
142 armnn::TensorInfo weightsInfo3x3({ 1, 1, 3, 3 }, dataType);
143 armnn::TensorInfo biasesInfo;
144
145 armnn::DepthwiseConvolution2dDescriptor descriptor;
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100146 armnn::NeonLayerSupport layerSupport;
telsoa014fcda012018-03-09 14:13:49 +0000147
148 // Strides supported: 1,2,3
telsoa01c577f2c2018-08-31 09:22:23 +0100149 descriptor = MakeDepthwiseConv2dDesc(1, 1);
150 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100151 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
152 weightsInfo3x3, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000153
telsoa01c577f2c2018-08-31 09:22:23 +0100154 descriptor = MakeDepthwiseConv2dDesc(1, 2);
155 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100156 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
157 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100158
159 descriptor = MakeDepthwiseConv2dDesc(1, 3);
160 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100161 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
162 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100163
164 descriptor = MakeDepthwiseConv2dDesc(2, 1);
165 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100166 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
167 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100168
169 descriptor = MakeDepthwiseConv2dDesc(2, 2);
170 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100171 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
172 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100173
174 descriptor = MakeDepthwiseConv2dDesc(2, 3);
175 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100176 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
177 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100178
179 descriptor = MakeDepthwiseConv2dDesc(3, 1);
180 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100181 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
182 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100183
184 descriptor = MakeDepthwiseConv2dDesc(3, 2);
185 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100186 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
187 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100188
189 descriptor = MakeDepthwiseConv2dDesc(3, 3);
190 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100191 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
192 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100193
194 // Supported stride 4
195 descriptor = MakeDepthwiseConv2dDesc(4, 1);
196 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100197 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
198 weightsInfo3x3, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000199
200 // Supported weights shape 1x1
201 armnn::TensorInfo weightsInfo1x1({ 1, 1, 1, 1 }, armnn::DataType::Float32);
telsoa01c577f2c2018-08-31 09:22:23 +0100202 descriptor = MakeDepthwiseConv2dDesc(1, 1);
203 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo1x1, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100204 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
205 weightsInfo1x1, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000206
207 // Supported shape 2x2
208 armnn::TensorInfo weightsInfo2x2({ 1, 1, 2, 2 }, armnn::DataType::Float32);
telsoa01c577f2c2018-08-31 09:22:23 +0100209 descriptor = MakeDepthwiseConv2dDesc(1, 1);
210 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo2x2, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100211 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
212 weightsInfo2x2, biasesInfo));
surmeh013537c2c2018-05-18 16:31:43 +0100213
214 // Asymmetric padding
telsoa01c577f2c2018-08-31 09:22:23 +0100215 descriptor = MakeDepthwiseConv2dDesc(1, 1, 1, 1, 2, 1, 2);
216 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100217 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
218 weightsInfo3x3, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000219}
220
221// Pooling
222ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true)
223ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true)
James Conroy45a9b772018-10-31 11:47:53 +0000224
225ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2d, SimpleMaxPooling2dTest, armnn::DataLayout::NCHW)
226ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dNhwc, SimpleMaxPooling2dTest, armnn::DataLayout::NHWC)
227ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NCHW)
228ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8Nhwc, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NHWC)
229
230ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
231ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
232ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NCHW)
233ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8Nhwc, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NHWC)
surmeh01bceff2f2018-03-29 16:29:27 +0100234
telsoa014fcda012018-03-09 14:13:49 +0000235ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest)
236ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test)
237
James Conroy45a9b772018-10-31 11:47:53 +0000238ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest, armnn::DataLayout::NCHW)
239ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2dNeon, SimpleL2Pooling2dTest, armnn::DataLayout::NHWC)
240ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test, armnn::DataLayout::NCHW)
241
telsoa014fcda012018-03-09 14:13:49 +0000242ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test)
243ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test)
244ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test)
245ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test)
246ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test)
247ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test)
248ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test)
249ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test)
250ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test)
251ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test)
252
253// Ignore padding values for pooling but count padding fields into the divisor
254ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest)
255ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test)
256ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test)
257ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test)
258
259ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest)
260ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test)
261ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest)
262ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8,
263 IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test)
264ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test)
265ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100266ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2,
267 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, false)
268ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding,
269 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
270 true)
telsoa014fcda012018-03-09 14:13:49 +0000271
272ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest)
273ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test)
274ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test)
275ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test)
276
277// Activation
278ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
279
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000280// ReLu
281ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
282ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
283
Narumol Prangnawaratb98bbcf2019-04-15 14:14:27 +0100284// Sigmoid
285ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
286ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
287
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000288// Softmax
telsoa014fcda012018-03-09 14:13:49 +0000289ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
290ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
telsoa014fcda012018-03-09 14:13:49 +0000291ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f)
292ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f)
293
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000294ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1, Simple3dSoftmaxTest, 1.0f)
295ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1Uint8, Simple3dSoftmaxUint8Test, 1.0f)
296
297ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1, Simple4dSoftmaxTest, 1.0f)
298ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1Uint8, Simple4dSoftmaxUint8Test, 1.0f)
telsoa014fcda012018-03-09 14:13:49 +0000299
telsoa01c577f2c2018-08-31 09:22:23 +0100300// Splitter
301ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest)
302ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000303
304ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
305ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
306
307// Merger
308ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest)
309ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test)
310
311// Fully Connected
312ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
313ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false)
314ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true)
315ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false)
316ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true)
kevmay01e448be32018-09-26 10:21:55 +0100317ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedUint8Test, false)
318ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedUint8Test, true)
telsoa014fcda012018-03-09 14:13:49 +0000319
320// Add
321ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)
David Beckbc392452018-09-10 14:47:28 +0100322ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest)
telsoa014fcda012018-03-09 14:13:49 +0000323ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest)
324
David Beckbc392452018-09-10 14:47:28 +0100325// Sub
326ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest)
Mohamed Nour Abouelseoud3d93bc42018-11-21 10:35:17 +0000327ARMNN_AUTO_TEST_CASE(SubBroadcast1Element, SubtractionBroadcast1ElementTest)
328ARMNN_AUTO_TEST_CASE(SubBroadcast, SubtractionBroadcastTest)
Conor Kennedyb99480b2019-03-08 08:24:41 +0000329ARMNN_AUTO_TEST_CASE(SubtractionUint8, SubtractionUint8Test)
330ARMNN_AUTO_TEST_CASE(SubBroadcastUint8, SubtractionBroadcastUint8Test)
331ARMNN_AUTO_TEST_CASE(SubBroadcast1ElementUint8, SubtractionBroadcast1ElementUint8Test)
David Beckbc392452018-09-10 14:47:28 +0100332
telsoa014fcda012018-03-09 14:13:49 +0000333// Mul
334ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest)
surmeh013537c2c2018-05-18 16:31:43 +0100335ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest)
336ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest)
Conor Kennedyb99480b2019-03-08 08:24:41 +0000337ARMNN_AUTO_TEST_CASE(MultiplicationUint8, MultiplicationUint8Test)
338ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1ElementUint8, MultiplicationBroadcast1ElementUint8Test)
339ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVectorUint8, MultiplicationBroadcast1DVectorUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000340
341// Batch Norm
342ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest)
Nikhil Rajd1340932018-10-18 14:27:50 +0100343ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest)
telsoa014fcda012018-03-09 14:13:49 +0000344
345// Constant
346ARMNN_AUTO_TEST_CASE(Constant, ConstantTest)
Nina Drozd58ef2c62019-05-16 12:09:18 +0100347ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantUint8SimpleQuantizationScaleNoOffsetTest)
telsoa014fcda012018-03-09 14:13:49 +0000348
349// Concatenation
350ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest)
351ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test)
352
353ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test)
354ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test)
355ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test)
356ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test)
357
358ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest)
359ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test)
360ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest)
361ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test)
362
363ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test)
364ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test)
365ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test)
366ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test)
narpra015cdda352018-11-19 15:30:27 +0000367ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test, false)
368ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000369
370ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest)
371ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test)
372ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest)
373ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test)
narpra015cdda352018-11-19 15:30:27 +0000374ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest, false)
375ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000376
narpra015cdda352018-11-19 15:30:27 +0000377ARMNN_AUTO_TEST_CASE(Concatenation4dDim0, Concatenation4dDim0Test)
378ARMNN_AUTO_TEST_CASE(Concatenation4dDim1, Concatenation4dDim1Test)
379ARMNN_AUTO_TEST_CASE(Concatenation4dDim3, Concatenation4dDim3Test, false)
380ARMNN_AUTO_TEST_CASE(Concatenation4dDim0Uint8, Concatenation4dDim0Uint8Test)
381ARMNN_AUTO_TEST_CASE(Concatenation4dDim1Uint8, Concatenation4dDim1Uint8Test)
382ARMNN_AUTO_TEST_CASE(Concatenation4dDim3Uint8, Concatenation4dDim3Uint8Test, false)
383
384ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0, Concatenation4dDiffShapeDim0Test)
385ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1, Concatenation4dDiffShapeDim1Test)
386ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3, Concatenation4dDiffShapeDim3Test, false)
387ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0Uint8, Concatenation4dDiffShapeDim0Uint8Test)
388ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1Uint8, Concatenation4dDiffShapeDim1Uint8Test)
389ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3Uint8, Concatenation4dDiffShapeDim3Uint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000390// L2 Normalization
jimfly013aab7c32018-11-12 13:32:08 +0000391ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest, armnn::DataLayout::NCHW)
392ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest, armnn::DataLayout::NCHW)
393ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest, armnn::DataLayout::NCHW)
394ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest, armnn::DataLayout::NCHW)
Matteo Martincigh539b44d2018-10-01 09:26:39 +0100395
jimfly013aab7c32018-11-12 13:32:08 +0000396ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dTest, armnn::DataLayout::NHWC)
397ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dTest, armnn::DataLayout::NHWC)
398ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dTest, armnn::DataLayout::NHWC)
399ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dTest, armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +0000400
401// Floor
402ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest)
403
kevmay01eed85922019-01-28 08:37:25 +0000404// Greater
405ARMNN_AUTO_TEST_CASE(SimpleGreater, GreaterSimpleTest)
406ARMNN_AUTO_TEST_CASE(GreaterBroadcast1Element, GreaterBroadcast1ElementTest)
407ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVector, GreaterBroadcast1DVectorTest)
408ARMNN_AUTO_TEST_CASE(GreaterUint8, GreaterUint8Test)
409ARMNN_AUTO_TEST_CASE(GreaterBroadcast1ElementUint8, GreaterBroadcast1ElementUint8Test)
410ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVectorUint8, GreaterBroadcast1DVectorUint8Test)
411
telsoa014fcda012018-03-09 14:13:49 +0000412// Reshape
413ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeFloat32Test)
414ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeUint8Test)
415
Éanna Ó Catháin12055742019-01-25 10:01:40 +0000416// Pad
417ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest)
418ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest)
419ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest)
420
telsoa014fcda012018-03-09 14:13:49 +0000421// Permute
422ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteFloat32Test)
423ARMNN_AUTO_TEST_CASE(SimplePermuteUint8, SimplePermuteUint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100424ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1, PermuteFloat32ValueSet1Test)
425ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2, PermuteFloat32ValueSet2Test)
426ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3, PermuteFloat32ValueSet3Test)
427
Les Bellde9011b2018-10-03 10:37:52 +0100428// Lstm
429ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection,
430 LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest)
431ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection,
432 LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest)
433ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection,
434 LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest)
435
Matthew Benthamfd899962018-12-31 15:49:42 +0000436// Mean
437ARMNN_AUTO_TEST_CASE(MeanUint8Simple, MeanUint8SimpleTest)
438ARMNN_AUTO_TEST_CASE(MeanUint8SimpleAxis, MeanUint8SimpleAxisTest)
439ARMNN_AUTO_TEST_CASE(MeanUint8KeepDims, MeanUint8KeepDimsTest)
440ARMNN_AUTO_TEST_CASE(MeanUint8MultipleDims, MeanUint8MultipleDimsTest)
441ARMNN_AUTO_TEST_CASE(MeanVtsUint8, MeanVtsUint8Test)
442
443ARMNN_AUTO_TEST_CASE(MeanFloatSimple, MeanFloatSimpleTest)
444ARMNN_AUTO_TEST_CASE(MeanFloatSimpleAxis, MeanFloatSimpleAxisTest)
445ARMNN_AUTO_TEST_CASE(MeanFloatKeepDims, MeanFloatKeepDimsTest)
446ARMNN_AUTO_TEST_CASE(MeanFloatMultipleDims, MeanFloatMultipleDimsTest)
447ARMNN_AUTO_TEST_CASE(MeanVtsFloat1, MeanVtsFloat1Test)
448ARMNN_AUTO_TEST_CASE(MeanVtsFloat2, MeanVtsFloat2Test)
449ARMNN_AUTO_TEST_CASE(MeanVtsFloat3, MeanVtsFloat3Test)
450
Nattapat Chaimanowong4e6597a2018-12-20 14:14:06 +0000451// Max
452ARMNN_AUTO_TEST_CASE(SimpleMaximum, MaximumSimpleTest)
453ARMNN_AUTO_TEST_CASE(MaximumBroadcast1Element, MaximumBroadcast1ElementTest)
454ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVector, MaximumBroadcast1DVectorTest)
455ARMNN_AUTO_TEST_CASE(MaximumUint8, MaximumUint8Test)
456ARMNN_AUTO_TEST_CASE(MaximumBroadcast1ElementUint8, MaximumBroadcast1ElementUint8Test)
457ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVectorUint8, MaximumBroadcast1DVectorUint8Test)
458
Conor Kennedy54b21692019-01-09 07:57:38 +0000459// Min
460ARMNN_AUTO_TEST_CASE(SimpleMinimum1, MinimumBroadcast1ElementTest1)
461ARMNN_AUTO_TEST_CASE(SimpleMinimum2, MinimumBroadcast1ElementTest2)
462ARMNN_AUTO_TEST_CASE(Minimum1DVectorUint8, MinimumBroadcast1DVectorUint8Test)
463
narpra0155a97bc2018-10-02 14:35:53 +0100464// Normalization
465ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
466ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest)
467ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest)
468
Sadik Armaganc625f002018-12-17 11:32:16 +0000469// Resize Bilinear - NCHW data layout
470ARMNN_AUTO_TEST_CASE(ResizeBilinearNop, ResizeBilinearNopTest, armnn::DataLayout::NCHW)
471ARMNN_AUTO_TEST_CASE(SimpleResizeBilinear, SimpleResizeBilinearTest, armnn::DataLayout::NCHW)
472ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMin, ResizeBilinearSqMinTest, armnn::DataLayout::NCHW)
473ARMNN_AUTO_TEST_CASE(ResizeBilinearMin, ResizeBilinearMinTest, armnn::DataLayout::NCHW)
474ARMNN_AUTO_TEST_CASE(ResizeBilinearMag, ResizeBilinearMagTest, armnn::DataLayout::NCHW)
475
Conor Kennedydc1c0822019-02-01 07:23:17 +0000476ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8, ResizeBilinearNopUint8Test)
477ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8, SimpleResizeBilinearUint8Test)
478ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8, ResizeBilinearSqMinUint8Test)
479ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8, ResizeBilinearMinUint8Test)
480ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8, ResizeBilinearMagUint8Test)
481
Sadik Armaganc625f002018-12-17 11:32:16 +0000482// Resize Bilinear - NHWC data layout
483ARMNN_AUTO_TEST_CASE(ResizeBilinearNopNhwc, ResizeBilinearNopTest, armnn::DataLayout::NHWC)
484ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearNhwc, SimpleResizeBilinearTest, armnn::DataLayout::NHWC)
485ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinNhwc, ResizeBilinearSqMinTest, armnn::DataLayout::NHWC)
486ARMNN_AUTO_TEST_CASE(ResizeBilinearMinNhwc, ResizeBilinearMinTest, armnn::DataLayout::NHWC)
487ARMNN_AUTO_TEST_CASE(ResizeBilinearMagNhwc, ResizeBilinearMagTest, armnn::DataLayout::NHWC)
488
telsoa014fcda012018-03-09 14:13:49 +0000489// ============================================================================
490// COMPARE tests
491
492ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest)
493
jimfly017af00da2018-10-31 14:43:53 +0000494ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000495 CompareDepthwiseConvolution2dFloatTest,
jimfly017af00da2018-10-31 14:43:53 +0000496 armnn::DataLayout::NCHW)
497ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000498 CompareDepthwiseConvolution2dUint8Test,
jimfly017af00da2018-10-31 14:43:53 +0000499 armnn::DataLayout::NCHW)
500
501ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32Nhwc,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000502 CompareDepthwiseConvolution2dFloatTest,
jimfly017af00da2018-10-31 14:43:53 +0000503 armnn::DataLayout::NHWC)
504ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8Nhwc,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000505 CompareDepthwiseConvolution2dUint8Test,
jimfly017af00da2018-10-31 14:43:53 +0000506 armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +0000507
508ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest,
509 armnn::NormalizationAlgorithmChannel::Within,
510 armnn::NormalizationAlgorithmMethod::LocalBrightness)
511ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest,
512 armnn::NormalizationAlgorithmChannel::Across,
513 armnn::NormalizationAlgorithmMethod::LocalBrightness)
514
515ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::Max)
516ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReferenceUint8, ComparePooling2dUint8Test,
517 armnn::PoolingAlgorithm::Max)
518ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReference, ComparePooling2dTest,
519 armnn::PoolingAlgorithm::Average)
520ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReferenceUint8, ComparePooling2dUint8Test,
521 armnn::PoolingAlgorithm::Average)
522ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::L2)
523ARMNN_COMPARE_REF_AUTO_TEST_CASE(UNSUPPORTED_CompareL2Pooling2dWithReferenceUint8, ComparePooling2dUint8Test,
524 armnn::PoolingAlgorithm::L2)
525
526ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f)
527ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f)
528
529ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta1WithReference, CompareSoftmaxUint8Test, 1.0f)
530ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta2WithReference, CompareSoftmaxUint8Test, 2.0f)
531
532ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest)
533
534ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMultiplicationTest)
535
536ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
537
538ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
539ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
540
541// ============================================================================
542// FIXTURE tests
543
544ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture,
545 CompareActivationTest, armnn::ActivationFunction::Sigmoid, 5u)
546
547ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture,
548 CompareActivationTest, armnn::ActivationFunction::TanH, 5u)
549
550ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture,
551 CompareActivationTest, armnn::ActivationFunction::Linear, 5u)
552
553ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture,
554 CompareActivationTest, armnn::ActivationFunction::ReLu, 5u)
555
556ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture,
557 CompareActivationTest, armnn::ActivationFunction::BoundedReLu, 5u)
558ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture,
559 CompareActivationUint8Test, armnn::ActivationFunction::BoundedReLu)
560
561ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture,
562 CompareActivationTest, armnn::ActivationFunction::SoftReLu, 1u)
563
564ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture,
565 CompareActivationTest, armnn::ActivationFunction::LeakyReLu, 5u)
566
567ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture,
568 CompareActivationTest, armnn::ActivationFunction::Abs, 5u)
569
570ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture,
571 CompareActivationTest, armnn::ActivationFunction::Sqrt, 5u)
572
573ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
574 CompareActivationTest, armnn::ActivationFunction::Square, 5u)
telsoa014fcda012018-03-09 14:13:49 +0000575BOOST_AUTO_TEST_SUITE_END()