blob: 049680aafe0d6ea088e7a1a0a47cff819c293b00 [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>
Narumol Prangnawarat86bb4e12019-07-08 11:36:05 +010017#include <backendsCommon/test/PermuteTestImpl.hpp>
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000018#include <backendsCommon/test/TensorCopyUtils.hpp>
19#include <backendsCommon/test/WorkloadTestUtils.hpp>
telsoa014fcda012018-03-09 14:13:49 +000020
arovir0143095f32018-10-09 18:04:24 +010021#include <boost/test/unit_test.hpp>
telsoa014fcda012018-03-09 14:13:49 +000022
23BOOST_AUTO_TEST_SUITE(Compute_ArmComputeNeon)
24using FactoryType = armnn::NeonWorkloadFactory;
25
26// ============================================================================
27// UNIT tests
28
29// Convolution
30ARMNN_AUTO_TEST_CASE(SimpleConvolution1d, Convolution1dTest, true)
31
jimfly010a088a62018-10-25 17:05:05 +010032ARMNN_AUTO_TEST_CASE(SimpleConvolution2d, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NCHW)
33ARMNN_AUTO_TEST_CASE(SimpleConvolution2dNhwc, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NHWC)
narpra015f703182018-10-26 16:24:58 +010034ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NCHW)
35ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8Nhwc, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NHWC)
jimfly010a088a62018-10-25 17:05:05 +010036ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2d, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NCHW)
37ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dNhwc, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NHWC)
Mike Kelly7332ed82018-12-20 17:03:06 +000038ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dStride2x2Nhwc,
39 SimpleConvolution2d3x3Stride2x2Test, false, armnn::DataLayout::NHWC)
jimfly010a088a62018-10-25 17:05:05 +010040
narpra015f703182018-10-26 16:24:58 +010041ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquare, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NCHW)
42ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPadding, Convolution2dAsymmetricPaddingTest, armnn::DataLayout::NCHW)
43
44ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquareNhwc, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NHWC)
45ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPaddingNhwc,
46 Convolution2dAsymmetricPaddingTest,
47 armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +000048
Francis Murtaghd59116e2018-10-04 16:03:07 +010049ARMNN_AUTO_TEST_CASE(SimpleConvolution2dSquareNhwc, SimpleConvolution2d3x3NhwcTest, false)
telsoa014fcda012018-03-09 14:13:49 +000050
51// Depthwise Convolution
jimfly01b9c89632018-10-26 16:50:13 +010052ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1,
53 DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NCHW)
54ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1,
55 DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NCHW)
56ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8,
57 DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NCHW)
58ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8,
59 DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NCHW)
60
61// NHWC Depthwise Convolution
62ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1NHhwc,
63 DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NHWC)
64ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Nhwc,
65 DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NHWC)
66ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8Nhwc,
67 DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NHWC)
68ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8Nhwc,
69 DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NHWC)
70
Nikhil Rajcec6b652018-10-12 13:51:57 +010071ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthNhwc, DepthwiseConvolution2dDepthNhwcTest, false)
Bruno Goncalves22972f02019-04-26 21:03:24 -030072ARMNN_AUTO_TEST_CASE(SimpleDepthwiseConvolution2d3x3Dilation3x3Nhwc,
73 SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTest)
jimfly01b9c89632018-10-26 16:50:13 +010074
telsoa014fcda012018-03-09 14:13:49 +000075
jimfly01382a91d2018-10-26 15:55:50 +010076ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetric,
77 DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NCHW)
78ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetric,
79 DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NCHW)
80ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetricNhwc,
81 DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NHWC)
82ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetricNhwc,
83 DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NHWC)
surmeh013537c2c2018-05-18 16:31:43 +010084
telsoa014fcda012018-03-09 14:13:49 +000085namespace
86{
87
88armnn::DepthwiseConvolution2dDescriptor MakeDepthwiseConv2dDesc(uint32_t strideX, uint32_t strideY,
89 uint32_t depthMultiplier = 1, uint32_t padLeft = 0, uint32_t padRight = 0,
90 uint32_t padTop = 0, uint32_t padBottom = 0)
91{
telsoa01c577f2c2018-08-31 09:22:23 +010092 boost::ignore_unused(depthMultiplier);
93
telsoa014fcda012018-03-09 14:13:49 +000094 armnn::DepthwiseConvolution2dDescriptor desc;
telsoa01c577f2c2018-08-31 09:22:23 +010095
telsoa014fcda012018-03-09 14:13:49 +000096 desc.m_PadLeft = padLeft;
97 desc.m_PadRight = padRight;
telsoa01c577f2c2018-08-31 09:22:23 +010098
telsoa014fcda012018-03-09 14:13:49 +000099 desc.m_PadTop = padTop;
100 desc.m_PadBottom = padBottom;
101 desc.m_StrideX = strideX;
102 desc.m_StrideY = strideY;
telsoa01c577f2c2018-08-31 09:22:23 +0100103 desc.m_BiasEnabled = false;
104
telsoa014fcda012018-03-09 14:13:49 +0000105 return desc;
106}
107
telsoa01c577f2c2018-08-31 09:22:23 +0100108armnn::TensorInfo CreateOutputTensorInfo(const armnn::TensorInfo& inputInfo,
109 const armnn::TensorInfo& weightsInfo,
110 const armnn::DepthwiseConvolution2dDescriptor& descriptor,
111 armnn::DataType dataType)
112{
113 const armnn::TensorShape& inputShape = inputInfo.GetShape();
114 const armnn::TensorShape& filterShape = weightsInfo.GetShape();
115
116 unsigned int inWidth = inputShape[3];
117 unsigned int inHeight = inputShape[2];
118 unsigned int inBatchSize = inputShape[0];
119
120 unsigned int filterWidth = filterShape[3];
121 unsigned int readWidth = (inWidth + descriptor.m_PadLeft + descriptor.m_PadRight) - (filterWidth);
122 unsigned int outWidth = 1u + (readWidth / descriptor.m_StrideX);
123
124 unsigned int filterHeight = filterShape[2];
125 unsigned int readHeight = (inHeight + descriptor.m_PadTop + descriptor.m_PadBottom) - (filterHeight);
126 unsigned int outHeight = 1u + (readHeight / descriptor.m_StrideY);
127 unsigned int depthMultiplier = filterShape[0];
128
129 unsigned int outChannels = filterShape[1] * depthMultiplier;
130 unsigned int outBatchSize = inBatchSize;
131
132 armnn::TensorShape outputShape({outBatchSize, outChannels, outHeight, outWidth});
133 return armnn::TensorInfo(outputShape, dataType);
134}
telsoa014fcda012018-03-09 14:13:49 +0000135}
136
137BOOST_AUTO_TEST_CASE(DepthwiseConv2dUtils)
138{
telsoa01c577f2c2018-08-31 09:22:23 +0100139 const armnn::DataType dataType = armnn::DataType::Float32;
140
141 armnn::TensorInfo inputInfo({1, 1, 10, 10 }, dataType);
142 armnn::TensorInfo outputInfo;
143 armnn::TensorInfo weightsInfo3x3({ 1, 1, 3, 3 }, dataType);
144 armnn::TensorInfo biasesInfo;
145
146 armnn::DepthwiseConvolution2dDescriptor descriptor;
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100147 armnn::NeonLayerSupport layerSupport;
telsoa014fcda012018-03-09 14:13:49 +0000148
149 // Strides supported: 1,2,3
telsoa01c577f2c2018-08-31 09:22:23 +0100150 descriptor = MakeDepthwiseConv2dDesc(1, 1);
151 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100152 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
153 weightsInfo3x3, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000154
telsoa01c577f2c2018-08-31 09:22:23 +0100155 descriptor = MakeDepthwiseConv2dDesc(1, 2);
156 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100157 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
158 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100159
160 descriptor = MakeDepthwiseConv2dDesc(1, 3);
161 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100162 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
163 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100164
165 descriptor = MakeDepthwiseConv2dDesc(2, 1);
166 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100167 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
168 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100169
170 descriptor = MakeDepthwiseConv2dDesc(2, 2);
171 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100172 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
173 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100174
175 descriptor = MakeDepthwiseConv2dDesc(2, 3);
176 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100177 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
178 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100179
180 descriptor = MakeDepthwiseConv2dDesc(3, 1);
181 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100182 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
183 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100184
185 descriptor = MakeDepthwiseConv2dDesc(3, 2);
186 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100187 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
188 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100189
190 descriptor = MakeDepthwiseConv2dDesc(3, 3);
191 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100192 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
193 weightsInfo3x3, biasesInfo));
telsoa01c577f2c2018-08-31 09:22:23 +0100194
195 // Supported stride 4
196 descriptor = MakeDepthwiseConv2dDesc(4, 1);
197 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100198 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
199 weightsInfo3x3, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000200
201 // Supported weights shape 1x1
202 armnn::TensorInfo weightsInfo1x1({ 1, 1, 1, 1 }, armnn::DataType::Float32);
telsoa01c577f2c2018-08-31 09:22:23 +0100203 descriptor = MakeDepthwiseConv2dDesc(1, 1);
204 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo1x1, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100205 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
206 weightsInfo1x1, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000207
208 // Supported shape 2x2
209 armnn::TensorInfo weightsInfo2x2({ 1, 1, 2, 2 }, armnn::DataType::Float32);
telsoa01c577f2c2018-08-31 09:22:23 +0100210 descriptor = MakeDepthwiseConv2dDesc(1, 1);
211 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo2x2, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100212 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
213 weightsInfo2x2, biasesInfo));
surmeh013537c2c2018-05-18 16:31:43 +0100214
215 // Asymmetric padding
telsoa01c577f2c2018-08-31 09:22:23 +0100216 descriptor = MakeDepthwiseConv2dDesc(1, 1, 1, 1, 2, 1, 2);
217 outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType);
Aron Virginas-Tarfc824312018-10-15 15:00:13 +0100218 BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor,
219 weightsInfo3x3, biasesInfo));
telsoa014fcda012018-03-09 14:13:49 +0000220}
221
Narumol Prangnawarat01961a72019-05-30 16:47:12 +0100222// Dequantize
223ARMNN_AUTO_TEST_CASE(DequantizeSimpleUint8, DequantizeSimpleUint8Test)
224ARMNN_AUTO_TEST_CASE(DequantizeOffsetUint8, DequantizeOffsetUint8Test)
225
telsoa014fcda012018-03-09 14:13:49 +0000226// Pooling
227ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true)
228ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true)
James Conroy45a9b772018-10-31 11:47:53 +0000229
230ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2d, SimpleMaxPooling2dTest, armnn::DataLayout::NCHW)
231ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dNhwc, SimpleMaxPooling2dTest, armnn::DataLayout::NHWC)
232ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NCHW)
233ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8Nhwc, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NHWC)
234
235ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
236ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
237ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NCHW)
238ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8Nhwc, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NHWC)
surmeh01bceff2f2018-03-29 16:29:27 +0100239
telsoa014fcda012018-03-09 14:13:49 +0000240ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest)
241ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test)
242
James Conroy45a9b772018-10-31 11:47:53 +0000243ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest, armnn::DataLayout::NCHW)
244ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2dNeon, SimpleL2Pooling2dTest, armnn::DataLayout::NHWC)
245ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test, armnn::DataLayout::NCHW)
246
telsoa014fcda012018-03-09 14:13:49 +0000247ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test)
248ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test)
249ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test)
250ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test)
251ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test)
252ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test)
253ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test)
254ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test)
255ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test)
256ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test)
257
258// Ignore padding values for pooling but count padding fields into the divisor
259ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest)
260ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test)
261ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test)
262ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test)
263
264ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest)
265ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test)
266ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest)
267ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8,
268 IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test)
269ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test)
270ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100271ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2,
272 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, false)
273ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding,
274 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
275 true)
telsoa014fcda012018-03-09 14:13:49 +0000276
277ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest)
278ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test)
279ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test)
280ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test)
281
282// Activation
283ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
284
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000285// ReLu
286ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
287ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
288
Narumol Prangnawaratb98bbcf2019-04-15 14:14:27 +0100289// Sigmoid
290ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
291ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
292
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000293// Softmax
telsoa014fcda012018-03-09 14:13:49 +0000294ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
295ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
telsoa014fcda012018-03-09 14:13:49 +0000296ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f)
297ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f)
298
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000299ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1, Simple3dSoftmaxTest, 1.0f)
300ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1Uint8, Simple3dSoftmaxUint8Test, 1.0f)
301
302ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1, Simple4dSoftmaxTest, 1.0f)
303ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1Uint8, Simple4dSoftmaxUint8Test, 1.0f)
telsoa014fcda012018-03-09 14:13:49 +0000304
Ellen Norris-Thompson29794572019-06-26 16:40:36 +0100305// SpaceToDepth
306ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHWAsymmQ8, SpaceToDepthNCHWAsymmQ8Test)
307ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWCAsymmQ8, SpaceToDepthNHWCAsymmQ8Test)
308
309ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWC1Float32, SpaceToDepthNHWCFloat32Test1)
310ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHW1Float32, SpaceToDepthNCHWFloat32Test1)
311
312ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWC2Float32, SpaceToDepthNHWCFloat32Test2)
313ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHW2Float32, SpaceToDepthNCHWFloat32Test2)
314
315ARMNN_AUTO_TEST_CASE(SpaceToDepthNHWCQSymm16, SpaceToDepthNHWCQSymm16Test)
316ARMNN_AUTO_TEST_CASE(SpaceToDepthNCHWQSymm16, SpaceToDepthNCHWQSymm16Test)
317
telsoa01c577f2c2018-08-31 09:22:23 +0100318// Splitter
319ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest)
320ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000321
322ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
323ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
324
Jim Flynn4ed6c832019-05-20 11:02:46 +0100325// Concat
326ARMNN_AUTO_TEST_CASE(SimpleConcat, ConcatTest)
327ARMNN_AUTO_TEST_CASE(ConcatUint8, ConcatUint8Test)
Narumol Prangnawarat71c80b12019-06-17 17:45:43 +0100328ARMNN_AUTO_TEST_CASE(ConcatUint8DifferentInputOutputQParam,
329 ConcatDifferentInputOutputQParamTest<armnn::DataType::QuantisedAsymm8>, false)
telsoa014fcda012018-03-09 14:13:49 +0000330
331// Fully Connected
332ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
333ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false)
334ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true)
335ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false)
336ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true)
Francis Murtagh46c09d02019-05-28 08:15:28 +0100337ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedTest<armnn::DataType::QuantisedAsymm8>, false)
338ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedTest<armnn::DataType::QuantisedAsymm8>, true)
telsoa014fcda012018-03-09 14:13:49 +0000339
340// Add
341ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)
David Beckbc392452018-09-10 14:47:28 +0100342ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest)
telsoa014fcda012018-03-09 14:13:49 +0000343ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest)
344
David Beckbc392452018-09-10 14:47:28 +0100345// Sub
346ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest)
Mohamed Nour Abouelseoud3d93bc42018-11-21 10:35:17 +0000347ARMNN_AUTO_TEST_CASE(SubBroadcast1Element, SubtractionBroadcast1ElementTest)
348ARMNN_AUTO_TEST_CASE(SubBroadcast, SubtractionBroadcastTest)
Conor Kennedyb99480b2019-03-08 08:24:41 +0000349ARMNN_AUTO_TEST_CASE(SubtractionUint8, SubtractionUint8Test)
350ARMNN_AUTO_TEST_CASE(SubBroadcastUint8, SubtractionBroadcastUint8Test)
351ARMNN_AUTO_TEST_CASE(SubBroadcast1ElementUint8, SubtractionBroadcast1ElementUint8Test)
David Beckbc392452018-09-10 14:47:28 +0100352
telsoa014fcda012018-03-09 14:13:49 +0000353// Mul
354ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest)
surmeh013537c2c2018-05-18 16:31:43 +0100355ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest)
356ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest)
Conor Kennedyb99480b2019-03-08 08:24:41 +0000357ARMNN_AUTO_TEST_CASE(MultiplicationUint8, MultiplicationUint8Test)
358ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1ElementUint8, MultiplicationBroadcast1ElementUint8Test)
359ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVectorUint8, MultiplicationBroadcast1DVectorUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000360
361// Batch Norm
362ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest)
Nikhil Rajd1340932018-10-18 14:27:50 +0100363ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest)
telsoa014fcda012018-03-09 14:13:49 +0000364
365// Constant
366ARMNN_AUTO_TEST_CASE(Constant, ConstantTest)
Nina Drozd58ef2c62019-05-16 12:09:18 +0100367ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantUint8SimpleQuantizationScaleNoOffsetTest)
telsoa014fcda012018-03-09 14:13:49 +0000368
369// Concatenation
370ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest)
371ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test)
372
373ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test)
374ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test)
375ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test)
376ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test)
377
378ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest)
379ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test)
380ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest)
381ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test)
382
383ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test)
384ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test)
385ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test)
386ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test)
narpra015cdda352018-11-19 15:30:27 +0000387ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test, false)
388ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000389
390ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest)
391ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test)
392ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest)
393ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test)
narpra015cdda352018-11-19 15:30:27 +0000394ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest, false)
395ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000396
narpra015cdda352018-11-19 15:30:27 +0000397ARMNN_AUTO_TEST_CASE(Concatenation4dDim0, Concatenation4dDim0Test)
398ARMNN_AUTO_TEST_CASE(Concatenation4dDim1, Concatenation4dDim1Test)
399ARMNN_AUTO_TEST_CASE(Concatenation4dDim3, Concatenation4dDim3Test, false)
400ARMNN_AUTO_TEST_CASE(Concatenation4dDim0Uint8, Concatenation4dDim0Uint8Test)
401ARMNN_AUTO_TEST_CASE(Concatenation4dDim1Uint8, Concatenation4dDim1Uint8Test)
402ARMNN_AUTO_TEST_CASE(Concatenation4dDim3Uint8, Concatenation4dDim3Uint8Test, false)
403
404ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0, Concatenation4dDiffShapeDim0Test)
405ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1, Concatenation4dDiffShapeDim1Test)
406ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3, Concatenation4dDiffShapeDim3Test, false)
407ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0Uint8, Concatenation4dDiffShapeDim0Uint8Test)
408ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1Uint8, Concatenation4dDiffShapeDim1Uint8Test)
409ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3Uint8, Concatenation4dDiffShapeDim3Uint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000410// L2 Normalization
jimfly013aab7c32018-11-12 13:32:08 +0000411ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest, armnn::DataLayout::NCHW)
412ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest, armnn::DataLayout::NCHW)
413ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest, armnn::DataLayout::NCHW)
414ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest, armnn::DataLayout::NCHW)
Matteo Martincigh539b44d2018-10-01 09:26:39 +0100415
jimfly013aab7c32018-11-12 13:32:08 +0000416ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dTest, armnn::DataLayout::NHWC)
417ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dTest, armnn::DataLayout::NHWC)
418ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dTest, armnn::DataLayout::NHWC)
419ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dTest, armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +0000420
Ferran Balaguer0c64f462019-06-18 16:32:30 +0100421ARMNN_AUTO_TEST_CASE(L2NormalizationDefaultEpsilon, L2NormalizationDefaultEpsilonTest, armnn::DataLayout::NCHW)
422ARMNN_AUTO_TEST_CASE(L2NormalizationNonDefaultEpsilon, L2NormalizationNonDefaultEpsilonTest, armnn::DataLayout::NCHW)
423
telsoa014fcda012018-03-09 14:13:49 +0000424// Floor
James Conroy83735b12019-05-30 16:36:59 +0100425ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest<armnn::DataType::Float32>)
telsoa014fcda012018-03-09 14:13:49 +0000426
kevmay01eed85922019-01-28 08:37:25 +0000427// Greater
428ARMNN_AUTO_TEST_CASE(SimpleGreater, GreaterSimpleTest)
429ARMNN_AUTO_TEST_CASE(GreaterBroadcast1Element, GreaterBroadcast1ElementTest)
430ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVector, GreaterBroadcast1DVectorTest)
431ARMNN_AUTO_TEST_CASE(GreaterUint8, GreaterUint8Test)
432ARMNN_AUTO_TEST_CASE(GreaterBroadcast1ElementUint8, GreaterBroadcast1ElementUint8Test)
433ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVectorUint8, GreaterBroadcast1DVectorUint8Test)
434
telsoa014fcda012018-03-09 14:13:49 +0000435// Reshape
Nina Drozd8ed4b8c2019-05-29 10:41:04 +0100436ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeTest<armnn::DataType::Float32>)
437ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeTest<armnn::DataType::QuantisedAsymm8>)
telsoa014fcda012018-03-09 14:13:49 +0000438
Éanna Ó Catháin12055742019-01-25 10:01:40 +0000439// Pad
440ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest)
FinnWilliamsArma5b5bbf2019-07-08 14:11:33 +0100441ARMNN_AUTO_TEST_CASE(PadFloat322dCustomPadding, PadFloat322dCustomPaddingTest)
Éanna Ó Catháin12055742019-01-25 10:01:40 +0000442ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest)
443ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest)
444
Teresa Charlinec8e1982019-07-02 16:24:09 +0100445ARMNN_AUTO_TEST_CASE(PadUint82d, PadUint82dTest)
FinnWilliamsArma5b5bbf2019-07-08 14:11:33 +0100446ARMNN_AUTO_TEST_CASE(PadUint82dCustomPadding, PadUint82dCustomPaddingTest)
Teresa Charlinec8e1982019-07-02 16:24:09 +0100447ARMNN_AUTO_TEST_CASE(PadUint83d, PadUint83dTest)
448ARMNN_AUTO_TEST_CASE(PadUint84d, PadUint84dTest)
449
FinnWilliamsArm8b797a82019-07-09 16:01:41 +0100450ARMNN_AUTO_TEST_CASE(Pad2dQSymm16, Pad2dTestCommon<armnn::DataType::QuantisedSymm16>, 2.0f, 0, 0.0f)
451ARMNN_AUTO_TEST_CASE(Pad2dQSymm16CustomPadding, Pad2dTestCommon<armnn::DataType::QuantisedSymm16>, 2.0f, 0, 1.0f)
452ARMNN_AUTO_TEST_CASE(Pad3dQSymm16, Pad3dTestCommon<armnn::DataType::QuantisedSymm16>, 2.0f, 0)
453ARMNN_AUTO_TEST_CASE(Pad4dQSymm16, Pad4dTestCommon<armnn::DataType::QuantisedSymm16>, 2.0f, 0)
454
telsoa014fcda012018-03-09 14:13:49 +0000455// Permute
Narumol Prangnawarat86bb4e12019-07-08 11:36:05 +0100456ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteTest<armnn::DataType::Float32>)
457ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1Test, PermuteValueSet1Test<armnn::DataType::Float32>)
458ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2Test, PermuteValueSet2Test<armnn::DataType::Float32>)
459ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3Test, PermuteValueSet3Test<armnn::DataType::Float32>)
460ARMNN_AUTO_TEST_CASE(SimplePermuteQASymm8, SimplePermuteTest<armnn::DataType::QuantisedAsymm8>)
461ARMNN_AUTO_TEST_CASE(PermuteQASymm8ValueSet1Test, PermuteValueSet1Test<armnn::DataType::QuantisedAsymm8>)
462ARMNN_AUTO_TEST_CASE(PermuteQASymm8ValueSet2Test, PermuteValueSet2Test<armnn::DataType::QuantisedAsymm8>)
463ARMNN_AUTO_TEST_CASE(PermuteQASymm8ValueSet3Test, PermuteValueSet3Test<armnn::DataType::QuantisedAsymm8>)
surmeh01bceff2f2018-03-29 16:29:27 +0100464
Les Bellde9011b2018-10-03 10:37:52 +0100465// Lstm
466ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection,
467 LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest)
468ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection,
469 LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest)
470ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection,
471 LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest)
Jan Eilersad5293a2019-07-08 09:57:55 +0100472ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNorm,
473 LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNormTest)
Les Bellde9011b2018-10-03 10:37:52 +0100474
Matthew Benthamfd899962018-12-31 15:49:42 +0000475// Mean
James Conroy4d1ff582019-06-10 17:06:39 +0100476ARMNN_AUTO_TEST_CASE(MeanSimpleFloat32, MeanSimpleTest<armnn::DataType::Float32>)
477ARMNN_AUTO_TEST_CASE(MeanSimpleAxisFloat32, MeanSimpleAxisTest<armnn::DataType::Float32>)
478ARMNN_AUTO_TEST_CASE(MeanKeepDimsFloat32, MeanKeepDimsTest<armnn::DataType::Float32>)
479ARMNN_AUTO_TEST_CASE(MeanMultipleDimsFloat32, MeanMultipleDimsTest<armnn::DataType::Float32>)
480ARMNN_AUTO_TEST_CASE(MeanVts1Float32, MeanVts1Test<armnn::DataType::Float32>)
481ARMNN_AUTO_TEST_CASE(MeanVts2Float32, MeanVts2Test<armnn::DataType::Float32>)
482ARMNN_AUTO_TEST_CASE(MeanVts3Float32, MeanVts3Test<armnn::DataType::Float32>)
Matthew Benthamfd899962018-12-31 15:49:42 +0000483
James Conroy4d1ff582019-06-10 17:06:39 +0100484ARMNN_AUTO_TEST_CASE(MeanSimpleQuantisedAsymm8, MeanSimpleTest<armnn::DataType::QuantisedAsymm8>)
485ARMNN_AUTO_TEST_CASE(MeanSimpleAxisQuantisedAsymm8, MeanSimpleAxisTest<armnn::DataType::QuantisedAsymm8>)
486ARMNN_AUTO_TEST_CASE(MeanKeepDimsQuantisedAsymm8, MeanKeepDimsTest<armnn::DataType::QuantisedAsymm8>)
487ARMNN_AUTO_TEST_CASE(MeanMultipleDimsQuantisedAsymm8, MeanMultipleDimsTest<armnn::DataType::QuantisedAsymm8>)
488ARMNN_AUTO_TEST_CASE(MeanVts1QuantisedAsymm8, MeanVts1Test<armnn::DataType::QuantisedAsymm8>)
489ARMNN_AUTO_TEST_CASE(MeanVts2QuantisedAsymm8, MeanVts2Test<armnn::DataType::QuantisedAsymm8>)
490ARMNN_AUTO_TEST_CASE(MeanVts3QuantisedAsymm8, MeanVts3Test<armnn::DataType::QuantisedAsymm8>)
Matthew Benthamfd899962018-12-31 15:49:42 +0000491
Nattapat Chaimanowong4e6597a2018-12-20 14:14:06 +0000492// Max
493ARMNN_AUTO_TEST_CASE(SimpleMaximum, MaximumSimpleTest)
494ARMNN_AUTO_TEST_CASE(MaximumBroadcast1Element, MaximumBroadcast1ElementTest)
495ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVector, MaximumBroadcast1DVectorTest)
496ARMNN_AUTO_TEST_CASE(MaximumUint8, MaximumUint8Test)
497ARMNN_AUTO_TEST_CASE(MaximumBroadcast1ElementUint8, MaximumBroadcast1ElementUint8Test)
498ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVectorUint8, MaximumBroadcast1DVectorUint8Test)
499
Conor Kennedy54b21692019-01-09 07:57:38 +0000500// Min
501ARMNN_AUTO_TEST_CASE(SimpleMinimum1, MinimumBroadcast1ElementTest1)
502ARMNN_AUTO_TEST_CASE(SimpleMinimum2, MinimumBroadcast1ElementTest2)
503ARMNN_AUTO_TEST_CASE(Minimum1DVectorUint8, MinimumBroadcast1DVectorUint8Test)
504
narpra0155a97bc2018-10-02 14:35:53 +0100505// Normalization
506ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
507ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest)
508ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest)
509
Sadik Armaganc625f002018-12-17 11:32:16 +0000510// Resize Bilinear - NCHW data layout
Ellen Norris-Thompsonc4223d12019-06-10 14:15:12 +0100511ARMNN_AUTO_TEST_CASE(SimpleResizeBilinear, SimpleResizeBilinearTest<armnn::DataType::Float32>, armnn::DataLayout::NCHW)
512ARMNN_AUTO_TEST_CASE(ResizeBilinearNop, ResizeBilinearNopTest<armnn::DataType::Float32>, armnn::DataLayout::NCHW)
513ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMin, ResizeBilinearSqMinTest<armnn::DataType::Float32>, armnn::DataLayout::NCHW)
514ARMNN_AUTO_TEST_CASE(ResizeBilinearMin, ResizeBilinearMinTest<armnn::DataType::Float32>, armnn::DataLayout::NCHW)
515ARMNN_AUTO_TEST_CASE(ResizeBilinearMag, ResizeBilinearMagTest<armnn::DataType::Float32>, armnn::DataLayout::NCHW)
Sadik Armaganc625f002018-12-17 11:32:16 +0000516
Ellen Norris-Thompsonc4223d12019-06-10 14:15:12 +0100517ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8,
518 SimpleResizeBilinearTest<armnn::DataType::QuantisedAsymm8>,
519 armnn::DataLayout::NCHW)
520ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8,
521 ResizeBilinearNopTest<armnn::DataType::QuantisedAsymm8>,
522 armnn::DataLayout::NCHW)
523ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8,
524 ResizeBilinearSqMinTest<armnn::DataType::QuantisedAsymm8>,
525 armnn::DataLayout::NCHW)
526ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8,
527 ResizeBilinearMinTest<armnn::DataType::QuantisedAsymm8>,
528 armnn::DataLayout::NCHW)
529ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8,
530 ResizeBilinearMagTest<armnn::DataType::QuantisedAsymm8>,
531 armnn::DataLayout::NCHW)
Conor Kennedydc1c0822019-02-01 07:23:17 +0000532
Sadik Armaganc625f002018-12-17 11:32:16 +0000533// Resize Bilinear - NHWC data layout
Ellen Norris-Thompsonc4223d12019-06-10 14:15:12 +0100534ARMNN_AUTO_TEST_CASE(ResizeBilinearNopNhwc,
535 ResizeBilinearNopTest<armnn::DataType::Float32>,
536 armnn::DataLayout::NHWC)
537ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearNhwc,
538 SimpleResizeBilinearTest<armnn::DataType::Float32>,
539 armnn::DataLayout::NHWC)
540ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinNhwc,
541 ResizeBilinearSqMinTest<armnn::DataType::Float32>,
542 armnn::DataLayout::NHWC)
543ARMNN_AUTO_TEST_CASE(ResizeBilinearMinNhwc,
544 ResizeBilinearMinTest<armnn::DataType::Float32>,
545 armnn::DataLayout::NHWC)
546ARMNN_AUTO_TEST_CASE(ResizeBilinearMagNhwc,
547 ResizeBilinearMagTest<armnn::DataType::Float32>,
548 armnn::DataLayout::NHWC)
549
550ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8Nhwc,
551 ResizeBilinearNopTest<armnn::DataType::QuantisedAsymm8>,
552 armnn::DataLayout::NHWC)
553ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8Nhwc,
554 SimpleResizeBilinearTest<armnn::DataType::QuantisedAsymm8>,
555 armnn::DataLayout::NHWC)
556ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8Nhwc,
557 ResizeBilinearSqMinTest<armnn::DataType::QuantisedAsymm8>,
558 armnn::DataLayout::NHWC)
559ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8Nhwc,
560 ResizeBilinearMinTest<armnn::DataType::QuantisedAsymm8>,
561 armnn::DataLayout::NHWC)
562ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8Nhwc,
563 ResizeBilinearMagTest<armnn::DataType::QuantisedAsymm8>,
564 armnn::DataLayout::NHWC)
Sadik Armaganc625f002018-12-17 11:32:16 +0000565
Sadik Armaganfabc2892019-05-31 09:05:11 +0100566// Quantize
567ARMNN_AUTO_TEST_CASE(QuantizeSimpleUint8, QuantizeSimpleUint8Test)
568ARMNN_AUTO_TEST_CASE(QuantizeClampUint8, QuantizeClampUint8Test)
569
Nikhil Raj9b461482019-07-03 15:58:31 +0100570// PReLU
571ARMNN_AUTO_TEST_CASE(PreluFloat32, PreluTest<armnn::DataType::Float32>)
572ARMNN_AUTO_TEST_CASE(PreluUint8, PreluTest<armnn::DataType::QuantisedAsymm8>)
573
telsoa014fcda012018-03-09 14:13:49 +0000574// ============================================================================
575// COMPARE tests
576
577ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest)
578
jimfly017af00da2018-10-31 14:43:53 +0000579ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000580 CompareDepthwiseConvolution2dFloatTest,
jimfly017af00da2018-10-31 14:43:53 +0000581 armnn::DataLayout::NCHW)
582ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000583 CompareDepthwiseConvolution2dUint8Test,
jimfly017af00da2018-10-31 14:43:53 +0000584 armnn::DataLayout::NCHW)
585
586ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32Nhwc,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000587 CompareDepthwiseConvolution2dFloatTest,
jimfly017af00da2018-10-31 14:43:53 +0000588 armnn::DataLayout::NHWC)
589ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8Nhwc,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000590 CompareDepthwiseConvolution2dUint8Test,
jimfly017af00da2018-10-31 14:43:53 +0000591 armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +0000592
593ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest,
594 armnn::NormalizationAlgorithmChannel::Within,
595 armnn::NormalizationAlgorithmMethod::LocalBrightness)
596ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest,
597 armnn::NormalizationAlgorithmChannel::Across,
598 armnn::NormalizationAlgorithmMethod::LocalBrightness)
599
600ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::Max)
601ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReferenceUint8, ComparePooling2dUint8Test,
602 armnn::PoolingAlgorithm::Max)
603ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReference, ComparePooling2dTest,
604 armnn::PoolingAlgorithm::Average)
605ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReferenceUint8, ComparePooling2dUint8Test,
606 armnn::PoolingAlgorithm::Average)
607ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::L2)
608ARMNN_COMPARE_REF_AUTO_TEST_CASE(UNSUPPORTED_CompareL2Pooling2dWithReferenceUint8, ComparePooling2dUint8Test,
609 armnn::PoolingAlgorithm::L2)
610
611ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f)
612ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f)
613
614ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta1WithReference, CompareSoftmaxUint8Test, 1.0f)
615ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta2WithReference, CompareSoftmaxUint8Test, 2.0f)
616
617ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest)
618
619ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMultiplicationTest)
620
621ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
622
623ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
624ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
625
626// ============================================================================
627// FIXTURE tests
628
629ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture,
630 CompareActivationTest, armnn::ActivationFunction::Sigmoid, 5u)
631
632ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture,
633 CompareActivationTest, armnn::ActivationFunction::TanH, 5u)
634
635ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture,
636 CompareActivationTest, armnn::ActivationFunction::Linear, 5u)
637
638ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture,
639 CompareActivationTest, armnn::ActivationFunction::ReLu, 5u)
640
641ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture,
642 CompareActivationTest, armnn::ActivationFunction::BoundedReLu, 5u)
643ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture,
644 CompareActivationUint8Test, armnn::ActivationFunction::BoundedReLu)
645
646ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture,
647 CompareActivationTest, armnn::ActivationFunction::SoftReLu, 1u)
648
649ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture,
650 CompareActivationTest, armnn::ActivationFunction::LeakyReLu, 5u)
651
652ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture,
653 CompareActivationTest, armnn::ActivationFunction::Abs, 5u)
654
655ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture,
656 CompareActivationTest, armnn::ActivationFunction::Sqrt, 5u)
657
658ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
659 CompareActivationTest, armnn::ActivationFunction::Square, 5u)
telsoa014fcda012018-03-09 14:13:49 +0000660BOOST_AUTO_TEST_SUITE_END()