blob: 08e463ada266344ae1a018a56f85aaffeb7d4451 [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
Narumol Prangnawarat01961a72019-05-30 16:47:12 +0100221// Dequantize
222ARMNN_AUTO_TEST_CASE(DequantizeSimpleUint8, DequantizeSimpleUint8Test)
223ARMNN_AUTO_TEST_CASE(DequantizeOffsetUint8, DequantizeOffsetUint8Test)
224
telsoa014fcda012018-03-09 14:13:49 +0000225// Pooling
226ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true)
227ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true)
James Conroy45a9b772018-10-31 11:47:53 +0000228
229ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2d, SimpleMaxPooling2dTest, armnn::DataLayout::NCHW)
230ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dNhwc, SimpleMaxPooling2dTest, armnn::DataLayout::NHWC)
231ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NCHW)
232ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8Nhwc, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NHWC)
233
234ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
235ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW)
236ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NCHW)
237ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8Nhwc, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NHWC)
surmeh01bceff2f2018-03-29 16:29:27 +0100238
telsoa014fcda012018-03-09 14:13:49 +0000239ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest)
240ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test)
241
James Conroy45a9b772018-10-31 11:47:53 +0000242ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest, armnn::DataLayout::NCHW)
243ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2dNeon, SimpleL2Pooling2dTest, armnn::DataLayout::NHWC)
244ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test, armnn::DataLayout::NCHW)
245
telsoa014fcda012018-03-09 14:13:49 +0000246ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test)
247ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test)
248ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test)
249ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test)
250ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test)
251ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test)
252ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test)
253ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test)
254ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test)
255ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test)
256
257// Ignore padding values for pooling but count padding fields into the divisor
258ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest)
259ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test)
260ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test)
261ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test)
262
263ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest)
264ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test)
265ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest)
266ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8,
267 IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test)
268ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test)
269ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100270ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2,
271 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, false)
272ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding,
273 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
274 true)
telsoa014fcda012018-03-09 14:13:49 +0000275
276ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest)
277ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test)
278ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test)
279ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test)
280
281// Activation
282ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
283
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000284// ReLu
285ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
286ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
287
Narumol Prangnawaratb98bbcf2019-04-15 14:14:27 +0100288// Sigmoid
289ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
290ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
291
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000292// Softmax
telsoa014fcda012018-03-09 14:13:49 +0000293ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
294ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
telsoa014fcda012018-03-09 14:13:49 +0000295ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f)
296ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f)
297
Narumol Prangnawarat65d30962019-03-14 11:55:03 +0000298ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1, Simple3dSoftmaxTest, 1.0f)
299ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1Uint8, Simple3dSoftmaxUint8Test, 1.0f)
300
301ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1, Simple4dSoftmaxTest, 1.0f)
302ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1Uint8, Simple4dSoftmaxUint8Test, 1.0f)
telsoa014fcda012018-03-09 14:13:49 +0000303
telsoa01c577f2c2018-08-31 09:22:23 +0100304// Splitter
305ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest)
306ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000307
308ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
309ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
310
Jim Flynn4ed6c832019-05-20 11:02:46 +0100311// Concat
312ARMNN_AUTO_TEST_CASE(SimpleConcat, ConcatTest)
313ARMNN_AUTO_TEST_CASE(ConcatUint8, ConcatUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000314
315// Fully Connected
316ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
317ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false)
318ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true)
319ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false)
320ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true)
Francis Murtagh46c09d02019-05-28 08:15:28 +0100321ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedTest<armnn::DataType::QuantisedAsymm8>, false)
322ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedTest<armnn::DataType::QuantisedAsymm8>, true)
telsoa014fcda012018-03-09 14:13:49 +0000323
324// Add
325ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)
David Beckbc392452018-09-10 14:47:28 +0100326ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest)
telsoa014fcda012018-03-09 14:13:49 +0000327ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest)
328
David Beckbc392452018-09-10 14:47:28 +0100329// Sub
330ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest)
Mohamed Nour Abouelseoud3d93bc42018-11-21 10:35:17 +0000331ARMNN_AUTO_TEST_CASE(SubBroadcast1Element, SubtractionBroadcast1ElementTest)
332ARMNN_AUTO_TEST_CASE(SubBroadcast, SubtractionBroadcastTest)
Conor Kennedyb99480b2019-03-08 08:24:41 +0000333ARMNN_AUTO_TEST_CASE(SubtractionUint8, SubtractionUint8Test)
334ARMNN_AUTO_TEST_CASE(SubBroadcastUint8, SubtractionBroadcastUint8Test)
335ARMNN_AUTO_TEST_CASE(SubBroadcast1ElementUint8, SubtractionBroadcast1ElementUint8Test)
David Beckbc392452018-09-10 14:47:28 +0100336
telsoa014fcda012018-03-09 14:13:49 +0000337// Mul
338ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest)
surmeh013537c2c2018-05-18 16:31:43 +0100339ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest)
340ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest)
Conor Kennedyb99480b2019-03-08 08:24:41 +0000341ARMNN_AUTO_TEST_CASE(MultiplicationUint8, MultiplicationUint8Test)
342ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1ElementUint8, MultiplicationBroadcast1ElementUint8Test)
343ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVectorUint8, MultiplicationBroadcast1DVectorUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000344
345// Batch Norm
346ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest)
Nikhil Rajd1340932018-10-18 14:27:50 +0100347ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest)
telsoa014fcda012018-03-09 14:13:49 +0000348
349// Constant
350ARMNN_AUTO_TEST_CASE(Constant, ConstantTest)
Nina Drozd58ef2c62019-05-16 12:09:18 +0100351ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantUint8SimpleQuantizationScaleNoOffsetTest)
telsoa014fcda012018-03-09 14:13:49 +0000352
353// Concatenation
354ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest)
355ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test)
356
357ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test)
358ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test)
359ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test)
360ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test)
361
362ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest)
363ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test)
364ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest)
365ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test)
366
367ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test)
368ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test)
369ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test)
370ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test)
narpra015cdda352018-11-19 15:30:27 +0000371ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test, false)
372ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000373
374ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest)
375ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test)
376ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest)
377ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test)
narpra015cdda352018-11-19 15:30:27 +0000378ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest, false)
379ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000380
narpra015cdda352018-11-19 15:30:27 +0000381ARMNN_AUTO_TEST_CASE(Concatenation4dDim0, Concatenation4dDim0Test)
382ARMNN_AUTO_TEST_CASE(Concatenation4dDim1, Concatenation4dDim1Test)
383ARMNN_AUTO_TEST_CASE(Concatenation4dDim3, Concatenation4dDim3Test, false)
384ARMNN_AUTO_TEST_CASE(Concatenation4dDim0Uint8, Concatenation4dDim0Uint8Test)
385ARMNN_AUTO_TEST_CASE(Concatenation4dDim1Uint8, Concatenation4dDim1Uint8Test)
386ARMNN_AUTO_TEST_CASE(Concatenation4dDim3Uint8, Concatenation4dDim3Uint8Test, false)
387
388ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0, Concatenation4dDiffShapeDim0Test)
389ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1, Concatenation4dDiffShapeDim1Test)
390ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3, Concatenation4dDiffShapeDim3Test, false)
391ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0Uint8, Concatenation4dDiffShapeDim0Uint8Test)
392ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1Uint8, Concatenation4dDiffShapeDim1Uint8Test)
393ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3Uint8, Concatenation4dDiffShapeDim3Uint8Test, false)
telsoa014fcda012018-03-09 14:13:49 +0000394// L2 Normalization
jimfly013aab7c32018-11-12 13:32:08 +0000395ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest, armnn::DataLayout::NCHW)
396ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest, armnn::DataLayout::NCHW)
397ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest, armnn::DataLayout::NCHW)
398ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest, armnn::DataLayout::NCHW)
Matteo Martincigh539b44d2018-10-01 09:26:39 +0100399
jimfly013aab7c32018-11-12 13:32:08 +0000400ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dTest, armnn::DataLayout::NHWC)
401ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dTest, armnn::DataLayout::NHWC)
402ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dTest, armnn::DataLayout::NHWC)
403ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dTest, armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +0000404
405// Floor
406ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest)
407
kevmay01eed85922019-01-28 08:37:25 +0000408// Greater
409ARMNN_AUTO_TEST_CASE(SimpleGreater, GreaterSimpleTest)
410ARMNN_AUTO_TEST_CASE(GreaterBroadcast1Element, GreaterBroadcast1ElementTest)
411ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVector, GreaterBroadcast1DVectorTest)
412ARMNN_AUTO_TEST_CASE(GreaterUint8, GreaterUint8Test)
413ARMNN_AUTO_TEST_CASE(GreaterBroadcast1ElementUint8, GreaterBroadcast1ElementUint8Test)
414ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVectorUint8, GreaterBroadcast1DVectorUint8Test)
415
telsoa014fcda012018-03-09 14:13:49 +0000416// Reshape
Nina Drozd8ed4b8c2019-05-29 10:41:04 +0100417ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeTest<armnn::DataType::Float32>)
418ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeTest<armnn::DataType::QuantisedAsymm8>)
telsoa014fcda012018-03-09 14:13:49 +0000419
Éanna Ó Catháin12055742019-01-25 10:01:40 +0000420// Pad
421ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest)
422ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest)
423ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest)
424
telsoa014fcda012018-03-09 14:13:49 +0000425// Permute
426ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteFloat32Test)
427ARMNN_AUTO_TEST_CASE(SimplePermuteUint8, SimplePermuteUint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100428ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1, PermuteFloat32ValueSet1Test)
429ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2, PermuteFloat32ValueSet2Test)
430ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3, PermuteFloat32ValueSet3Test)
431
Les Bellde9011b2018-10-03 10:37:52 +0100432// Lstm
433ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection,
434 LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest)
435ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection,
436 LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest)
437ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection,
438 LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest)
439
Matthew Benthamfd899962018-12-31 15:49:42 +0000440// Mean
441ARMNN_AUTO_TEST_CASE(MeanUint8Simple, MeanUint8SimpleTest)
442ARMNN_AUTO_TEST_CASE(MeanUint8SimpleAxis, MeanUint8SimpleAxisTest)
443ARMNN_AUTO_TEST_CASE(MeanUint8KeepDims, MeanUint8KeepDimsTest)
444ARMNN_AUTO_TEST_CASE(MeanUint8MultipleDims, MeanUint8MultipleDimsTest)
445ARMNN_AUTO_TEST_CASE(MeanVtsUint8, MeanVtsUint8Test)
446
447ARMNN_AUTO_TEST_CASE(MeanFloatSimple, MeanFloatSimpleTest)
448ARMNN_AUTO_TEST_CASE(MeanFloatSimpleAxis, MeanFloatSimpleAxisTest)
449ARMNN_AUTO_TEST_CASE(MeanFloatKeepDims, MeanFloatKeepDimsTest)
450ARMNN_AUTO_TEST_CASE(MeanFloatMultipleDims, MeanFloatMultipleDimsTest)
451ARMNN_AUTO_TEST_CASE(MeanVtsFloat1, MeanVtsFloat1Test)
452ARMNN_AUTO_TEST_CASE(MeanVtsFloat2, MeanVtsFloat2Test)
453ARMNN_AUTO_TEST_CASE(MeanVtsFloat3, MeanVtsFloat3Test)
454
Nattapat Chaimanowong4e6597a2018-12-20 14:14:06 +0000455// Max
456ARMNN_AUTO_TEST_CASE(SimpleMaximum, MaximumSimpleTest)
457ARMNN_AUTO_TEST_CASE(MaximumBroadcast1Element, MaximumBroadcast1ElementTest)
458ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVector, MaximumBroadcast1DVectorTest)
459ARMNN_AUTO_TEST_CASE(MaximumUint8, MaximumUint8Test)
460ARMNN_AUTO_TEST_CASE(MaximumBroadcast1ElementUint8, MaximumBroadcast1ElementUint8Test)
461ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVectorUint8, MaximumBroadcast1DVectorUint8Test)
462
Conor Kennedy54b21692019-01-09 07:57:38 +0000463// Min
464ARMNN_AUTO_TEST_CASE(SimpleMinimum1, MinimumBroadcast1ElementTest1)
465ARMNN_AUTO_TEST_CASE(SimpleMinimum2, MinimumBroadcast1ElementTest2)
466ARMNN_AUTO_TEST_CASE(Minimum1DVectorUint8, MinimumBroadcast1DVectorUint8Test)
467
narpra0155a97bc2018-10-02 14:35:53 +0100468// Normalization
469ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
470ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest)
471ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest)
472
Sadik Armaganc625f002018-12-17 11:32:16 +0000473// Resize Bilinear - NCHW data layout
474ARMNN_AUTO_TEST_CASE(ResizeBilinearNop, ResizeBilinearNopTest, armnn::DataLayout::NCHW)
475ARMNN_AUTO_TEST_CASE(SimpleResizeBilinear, SimpleResizeBilinearTest, armnn::DataLayout::NCHW)
476ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMin, ResizeBilinearSqMinTest, armnn::DataLayout::NCHW)
477ARMNN_AUTO_TEST_CASE(ResizeBilinearMin, ResizeBilinearMinTest, armnn::DataLayout::NCHW)
478ARMNN_AUTO_TEST_CASE(ResizeBilinearMag, ResizeBilinearMagTest, armnn::DataLayout::NCHW)
479
Conor Kennedydc1c0822019-02-01 07:23:17 +0000480ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8, ResizeBilinearNopUint8Test)
481ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8, SimpleResizeBilinearUint8Test)
482ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8, ResizeBilinearSqMinUint8Test)
483ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8, ResizeBilinearMinUint8Test)
484ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8, ResizeBilinearMagUint8Test)
485
Sadik Armaganc625f002018-12-17 11:32:16 +0000486// Resize Bilinear - NHWC data layout
487ARMNN_AUTO_TEST_CASE(ResizeBilinearNopNhwc, ResizeBilinearNopTest, armnn::DataLayout::NHWC)
488ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearNhwc, SimpleResizeBilinearTest, armnn::DataLayout::NHWC)
489ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinNhwc, ResizeBilinearSqMinTest, armnn::DataLayout::NHWC)
490ARMNN_AUTO_TEST_CASE(ResizeBilinearMinNhwc, ResizeBilinearMinTest, armnn::DataLayout::NHWC)
491ARMNN_AUTO_TEST_CASE(ResizeBilinearMagNhwc, ResizeBilinearMagTest, armnn::DataLayout::NHWC)
492
Sadik Armaganfabc2892019-05-31 09:05:11 +0100493// Quantize
494ARMNN_AUTO_TEST_CASE(QuantizeSimpleUint8, QuantizeSimpleUint8Test)
495ARMNN_AUTO_TEST_CASE(QuantizeClampUint8, QuantizeClampUint8Test)
496
telsoa014fcda012018-03-09 14:13:49 +0000497// ============================================================================
498// COMPARE tests
499
500ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest)
501
jimfly017af00da2018-10-31 14:43:53 +0000502ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000503 CompareDepthwiseConvolution2dFloatTest,
jimfly017af00da2018-10-31 14:43:53 +0000504 armnn::DataLayout::NCHW)
505ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000506 CompareDepthwiseConvolution2dUint8Test,
jimfly017af00da2018-10-31 14:43:53 +0000507 armnn::DataLayout::NCHW)
508
509ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32Nhwc,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000510 CompareDepthwiseConvolution2dFloatTest,
jimfly017af00da2018-10-31 14:43:53 +0000511 armnn::DataLayout::NHWC)
512ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8Nhwc,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000513 CompareDepthwiseConvolution2dUint8Test,
jimfly017af00da2018-10-31 14:43:53 +0000514 armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +0000515
516ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest,
517 armnn::NormalizationAlgorithmChannel::Within,
518 armnn::NormalizationAlgorithmMethod::LocalBrightness)
519ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest,
520 armnn::NormalizationAlgorithmChannel::Across,
521 armnn::NormalizationAlgorithmMethod::LocalBrightness)
522
523ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::Max)
524ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReferenceUint8, ComparePooling2dUint8Test,
525 armnn::PoolingAlgorithm::Max)
526ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReference, ComparePooling2dTest,
527 armnn::PoolingAlgorithm::Average)
528ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReferenceUint8, ComparePooling2dUint8Test,
529 armnn::PoolingAlgorithm::Average)
530ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::L2)
531ARMNN_COMPARE_REF_AUTO_TEST_CASE(UNSUPPORTED_CompareL2Pooling2dWithReferenceUint8, ComparePooling2dUint8Test,
532 armnn::PoolingAlgorithm::L2)
533
534ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f)
535ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f)
536
537ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta1WithReference, CompareSoftmaxUint8Test, 1.0f)
538ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta2WithReference, CompareSoftmaxUint8Test, 2.0f)
539
540ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest)
541
542ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMultiplicationTest)
543
544ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
545
546ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
547ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
548
549// ============================================================================
550// FIXTURE tests
551
552ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture,
553 CompareActivationTest, armnn::ActivationFunction::Sigmoid, 5u)
554
555ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture,
556 CompareActivationTest, armnn::ActivationFunction::TanH, 5u)
557
558ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture,
559 CompareActivationTest, armnn::ActivationFunction::Linear, 5u)
560
561ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture,
562 CompareActivationTest, armnn::ActivationFunction::ReLu, 5u)
563
564ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture,
565 CompareActivationTest, armnn::ActivationFunction::BoundedReLu, 5u)
566ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture,
567 CompareActivationUint8Test, armnn::ActivationFunction::BoundedReLu)
568
569ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture,
570 CompareActivationTest, armnn::ActivationFunction::SoftReLu, 1u)
571
572ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture,
573 CompareActivationTest, armnn::ActivationFunction::LeakyReLu, 5u)
574
575ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture,
576 CompareActivationTest, armnn::ActivationFunction::Abs, 5u)
577
578ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture,
579 CompareActivationTest, armnn::ActivationFunction::Sqrt, 5u)
580
581ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
582 CompareActivationTest, armnn::ActivationFunction::Square, 5u)
telsoa014fcda012018-03-09 14:13:49 +0000583BOOST_AUTO_TEST_SUITE_END()