blob: 057b5d84b2f2972dc714ec838e201011abd3fd06 [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//
arovir0143095f32018-10-09 18:04:24 +01005
6#include "ClContextControlFixture.hpp"
7
telsoa014fcda012018-03-09 14:13:49 +00008#include "test/TensorHelpers.hpp"
arovir0143095f32018-10-09 18:04:24 +01009#include "test/UnitTests.hpp"
telsoa014fcda012018-03-09 14:13:49 +000010
David Beckb4540be2018-09-24 13:18:27 +010011#include <backends/CpuTensorHandle.hpp>
arovir0143095f32018-10-09 18:04:24 +010012#include <backends/cl/ClLayerSupport.hpp>
David Beckac42efd2018-09-26 17:41:13 +010013#include <backends/cl/ClWorkloadFactory.hpp>
14#include <backends/cl/workloads/ClWorkloadUtils.hpp>
David Beckb4540be2018-09-24 13:18:27 +010015#include <backends/reference/RefWorkloadFactory.hpp>
arovir0143095f32018-10-09 18:04:24 +010016#include <backends/test/ActivationFixture.hpp>
17#include <backends/test/LayerTests.hpp>
telsoa014fcda012018-03-09 14:13:49 +000018
19#include <arm_compute/core/CL/CLKernelLibrary.h>
20#include <arm_compute/runtime/CL/CLScheduler.h>
telsoa014fcda012018-03-09 14:13:49 +000021
arovir0143095f32018-10-09 18:04:24 +010022#include <boost/test/unit_test.hpp>
23
24#include <iostream>
25#include <string>
telsoa014fcda012018-03-09 14:13:49 +000026
telsoa01c577f2c2018-08-31 09:22:23 +010027BOOST_FIXTURE_TEST_SUITE(Compute_ArmComputeCl, ClContextControlFixture)
telsoa014fcda012018-03-09 14:13:49 +000028using FactoryType = armnn::ClWorkloadFactory;
29
30// ============================================================================
31// UNIT tests
32
33// Activation
34ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
35
36ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
37ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
38ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f)
39ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f)
40
41ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
42ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
43
44// Fully Connected
45ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
46ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false)
47ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true)
Matthew Benthamab8cdc12018-09-17 11:17:41 +010048ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedUint8Test, false)
49ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedUint8Test, true)
telsoa014fcda012018-03-09 14:13:49 +000050
51ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false)
52ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true)
53
54// Convolution
55ARMNN_AUTO_TEST_CASE(SimpleConvolution1d, Convolution1dTest, true)
56
jimfly010a088a62018-10-25 17:05:05 +010057ARMNN_AUTO_TEST_CASE(SimpleConvolution2d, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NCHW)
58ARMNN_AUTO_TEST_CASE(SimpleConvolution2dNhwc, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NHWC)
narpra015f703182018-10-26 16:24:58 +010059ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NCHW)
60ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8Nhwc, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NHWC)
jimfly010a088a62018-10-25 17:05:05 +010061ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2d, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NCHW)
62ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dNhwc, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NHWC)
63
narpra015f703182018-10-26 16:24:58 +010064ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquare, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NCHW)
65ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPadding, Convolution2dAsymmetricPaddingTest, armnn::DataLayout::NCHW)
66
67ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquareNhwc, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NHWC)
telsoa014fcda012018-03-09 14:13:49 +000068
Francis Murtaghd59116e2018-10-04 16:03:07 +010069ARMNN_AUTO_TEST_CASE(SimpleConvolution2dSquareNhwc, SimpleConvolution2d3x3NhwcTest, false)
70
telsoa014fcda012018-03-09 14:13:49 +000071// Depthwise Convolution
72ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1, DepthwiseConvolution2dDepthMul1Test, true)
Nikhil Rajcec6b652018-10-12 13:51:57 +010073ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthNhwc, DepthwiseConvolution2dDepthNhwcTest, false)
telsoa014fcda012018-03-09 14:13:49 +000074ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1, DepthwiseConvolution2dDepthMul1Test, false)
75ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8, DepthwiseConvolution2dDepthMul1Uint8Test, true)
76ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8, DepthwiseConvolution2dDepthMul1Uint8Test, false)
77
surmeh013537c2c2018-05-18 16:31:43 +010078ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetric, DepthwiseConvolution2dAsymmetricTest, true)
79ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetric, DepthwiseConvolution2dAsymmetricTest, false)
80
telsoa01c577f2c2018-08-31 09:22:23 +010081// Softmax
82BOOST_AUTO_TEST_CASE(Softmax4dSupport)
telsoa014fcda012018-03-09 14:13:49 +000083{
telsoa01c577f2c2018-08-31 09:22:23 +010084 const unsigned int numDimensions = 4u;
85 std::array<unsigned int, numDimensions> dimensionSizes;
86 dimensionSizes.fill(1u);
87
88 const armnn::TensorInfo inputInfo(numDimensions, &dimensionSizes.front(), armnn::DataType::Float32);
89 const armnn::TensorInfo outputInfo(numDimensions, &dimensionSizes.front(), armnn::DataType::Float32);
90
91 // 4D Softmax should be reported as unsupported on the CL backend
Aron Virginas-Tarbcf9f162018-10-15 11:47:37 +010092 armnn::ClLayerSupport layerSupport;
93 BOOST_TEST(!layerSupport.IsSoftmaxSupported(inputInfo, outputInfo, armnn::SoftmaxDescriptor()));
telsoa014fcda012018-03-09 14:13:49 +000094}
95
telsoa01c577f2c2018-08-31 09:22:23 +010096// Splitter
97ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest)
98ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
telsoa014fcda012018-03-09 14:13:49 +000099
100ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
101ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
102
103// Merger
104ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest)
105ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test)
106
narpra0155a97bc2018-10-02 14:35:53 +0100107// Normalization
108ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
109ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest)
110ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest)
111
telsoa014fcda012018-03-09 14:13:49 +0000112// Pooling
113ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true)
114ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true)
115
116ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest)
117ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test)
118ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test)
119ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test)
120
121ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest)
122ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test)
123ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest)
124ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8,
surmeh01bceff2f2018-03-29 16:29:27 +0100125 IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000126ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test)
127ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test)
128
129ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest)
130ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test)
131ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test)
132ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test)
133
134ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest)
Francis Murtagh043d0d02018-10-05 14:08:48 +0100135ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dNhwcTest)
telsoa014fcda012018-03-09 14:13:49 +0000136ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100137ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2,
138 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
139 false)
140ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding,
141 IgnorePaddingAveragePooling2dSize3x2Stride2x2Test,
142 true)
telsoa014fcda012018-03-09 14:13:49 +0000143ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest)
144ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test)
145
146ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest)
147ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test)
148ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test)
149ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test)
150ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test)
151ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test)
152ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test)
153ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test)
154ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test)
155ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test)
156ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test)
157ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test)
158
159// Add
160ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)
161ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest)
David Beck4a8692c2018-09-07 16:19:24 +0100162ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest)
163
164ARMNN_AUTO_TEST_CASE(AdditionUint8, AdditionUint8Test)
165ARMNN_AUTO_TEST_CASE(AddBroadcastUint8, AdditionBroadcastUint8Test)
166ARMNN_AUTO_TEST_CASE(AddBroadcast1ElementUint8, AdditionBroadcast1ElementUint8Test)
167
168// Sub
169ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest)
170
Francis Murtaghe7a86a42018-08-29 12:42:10 +0100171// Div
172ARMNN_AUTO_TEST_CASE(SimpleDivision, DivisionTest)
David Beckbc392452018-09-10 14:47:28 +0100173ARMNN_AUTO_TEST_CASE(DivisionByZero, DivisionByZeroTest)
Francis Murtaghe7a86a42018-08-29 12:42:10 +0100174ARMNN_AUTO_TEST_CASE(DivisionBroadcast1Element, DivisionBroadcast1ElementTest)
175ARMNN_AUTO_TEST_CASE(DivisionBroadcast1DVector, DivisionBroadcast1DVectorTest)
David Beck5cd01f32018-09-12 16:00:08 +0100176// NOTE: quantized division is not supported by CL and not required by the
177// android NN api
Francis Murtaghe7a86a42018-08-29 12:42:10 +0100178
telsoa014fcda012018-03-09 14:13:49 +0000179// Mul
180ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest)
surmeh01bceff2f2018-03-29 16:29:27 +0100181ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest)
182ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest)
Matthew Benthame2ec3302018-10-01 11:32:48 +0100183ARMNN_AUTO_TEST_CASE(MultiplicationUint8, MultiplicationUint8Test)
184ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1ElementUint8, MultiplicationBroadcast1ElementUint8Test)
185ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVectorUint8, MultiplicationBroadcast1DVectorUint8Test)
telsoa014fcda012018-03-09 14:13:49 +0000186
187// Batch Norm
188ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest)
Nikhil Rajd1340932018-10-18 14:27:50 +0100189ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest)
telsoa014fcda012018-03-09 14:13:49 +0000190
Matteo Martincigh539b44d2018-10-01 09:26:39 +0100191// L2 Normalization
telsoa014fcda012018-03-09 14:13:49 +0000192ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest)
193ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest)
194ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest)
195ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest)
196
Matteo Martincighb63973e2018-10-16 16:23:33 +0100197ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dNhwcTest)
Matteo Martincigh539b44d2018-10-01 09:26:39 +0100198ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dNhwcTest)
199ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dNhwcTest)
200ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dNhwcTest)
201
James Conroy074f3712018-10-03 09:32:03 +0100202// Resize Bilinear - NCHW data layout
telsoa014fcda012018-03-09 14:13:49 +0000203ARMNN_AUTO_TEST_CASE(ResizeBilinearNop, ResizeBilinearNopTest)
James Conroy074f3712018-10-03 09:32:03 +0100204ARMNN_AUTO_TEST_CASE(SimpleResizeBilinear, SimpleResizeBilinearTest)
telsoa014fcda012018-03-09 14:13:49 +0000205ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMin, ResizeBilinearSqMinTest)
206ARMNN_AUTO_TEST_CASE(ResizeBilinearMin, ResizeBilinearMinTest)
207ARMNN_AUTO_TEST_CASE(ResizeBilinearMag, ResizeBilinearMagTest)
208
James Conroy074f3712018-10-03 09:32:03 +0100209// Resize Bilinear - NHWC data layout
210ARMNN_AUTO_TEST_CASE(ResizeBilinearNopNhwc, ResizeBilinearNopNhwcTest)
211ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearNhwc, SimpleResizeBilinearNhwcTest)
212ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinNhwc, ResizeBilinearSqMinNhwcTest)
213ARMNN_AUTO_TEST_CASE(ResizeBilinearMinNhwc, ResizeBilinearMinNhwcTest)
214ARMNN_AUTO_TEST_CASE(ResizeBilinearMagNhwc, ResizeBilinearMagNhwcTest)
215
telsoa014fcda012018-03-09 14:13:49 +0000216// Constant
217ARMNN_AUTO_TEST_CASE(Constant, ConstantTest)
218ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantTestUint8)
219
220// Concat
221ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest)
222ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test)
223
224ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test)
225ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test)
226ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test)
227ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test)
228
229ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest)
230ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test)
231ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest)
232ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test)
233
234ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test)
235ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test)
236ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test)
237ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test)
238ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test)
239ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test)
240
241ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest)
242ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test)
243ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest)
244ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test)
245ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest)
246ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test)
247
248// Floor
249ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest)
250
251// Reshape
252ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeFloat32Test)
253ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeUint8Test)
254
Mohamed Nour Abouelseoud7420e552018-10-12 12:26:24 +0100255// Pad
Mohamed Nour Abouelseouddd6acea2018-10-18 12:26:19 +0100256ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest)
257ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest)
258ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest)
Mohamed Nour Abouelseoud7420e552018-10-12 12:26:24 +0100259
telsoa014fcda012018-03-09 14:13:49 +0000260// Permute
261ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteFloat32Test)
262ARMNN_AUTO_TEST_CASE(SimplePermuteUint8, SimplePermuteUint8Test)
surmeh01bceff2f2018-03-29 16:29:27 +0100263ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1, PermuteFloat32ValueSet1Test)
264ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2, PermuteFloat32ValueSet2Test)
265ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3, PermuteFloat32ValueSet3Test)
telsoa014fcda012018-03-09 14:13:49 +0000266
telsoa01c577f2c2018-08-31 09:22:23 +0100267// Lstm
268ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection,
Les Bellde9011b2018-10-03 10:37:52 +0100269 LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest)
telsoa01c577f2c2018-08-31 09:22:23 +0100270ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection,
271 LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest)
272ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection,
Les Bellde9011b2018-10-03 10:37:52 +0100273 LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest)
telsoa01c577f2c2018-08-31 09:22:23 +0100274
275// Convert from Float16 to Float32
276ARMNN_AUTO_TEST_CASE(SimpleConvertFp16ToFp32, SimpleConvertFp16ToFp32Test)
277// Convert from Float32 to Float16
278ARMNN_AUTO_TEST_CASE(SimpleConvertFp32ToFp16, SimpleConvertFp32ToFp16Test)
279
Éanna Ó Catháin47c1ddb2018-10-12 14:24:13 +0100280ARMNN_AUTO_TEST_CASE(AdditionAfterMaxPool, AdditionAfterMaxPoolTest)
281
Matteo Martincigh28dcab62018-10-19 16:40:03 +0100282// Mean
283ARMNN_AUTO_TEST_CASE(MeanUint8Simple, MeanUint8SimpleTest)
284ARMNN_AUTO_TEST_CASE(MeanUint8SimpleAxis, MeanUint8SimpleAxisTest)
285ARMNN_AUTO_TEST_CASE(MeanUint8KeepDims, MeanUint8KeepDimsTest)
286ARMNN_AUTO_TEST_CASE(MeanUint8MultipleDims, MeanUint8MultipleDimsTest)
287ARMNN_AUTO_TEST_CASE(MeanVtsUint8, MeanVtsUint8Test)
288
289ARMNN_AUTO_TEST_CASE(MeanFloatSimple, MeanFloatSimpleTest)
290ARMNN_AUTO_TEST_CASE(MeanFloatSimpleAxis, MeanFloatSimpleAxisTest)
291ARMNN_AUTO_TEST_CASE(MeanFloatKeepDims, MeanFloatKeepDimsTest)
292ARMNN_AUTO_TEST_CASE(MeanFloatMultipleDims, MeanFloatMultipleDimsTest)
293ARMNN_AUTO_TEST_CASE(MeanVtsFloat1, MeanVtsFloat1Test)
294ARMNN_AUTO_TEST_CASE(MeanVtsFloat2, MeanVtsFloat2Test)
295ARMNN_AUTO_TEST_CASE(MeanVtsFloat3, MeanVtsFloat3Test)
296
telsoa014fcda012018-03-09 14:13:49 +0000297// ============================================================================
298// COMPARE tests
299
300ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest)
301
302ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32, CompareDepthwiseConvolution2dTest<float>)
303ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8, CompareDepthwiseConvolution2dTest<uint8_t>)
304
305ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest,
306 armnn::NormalizationAlgorithmChannel::Within,
307 armnn::NormalizationAlgorithmMethod::LocalBrightness)
308ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest,
309 armnn::NormalizationAlgorithmChannel::Across,
310 armnn::NormalizationAlgorithmMethod::LocalBrightness)
311
312ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f)
313ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f)
314ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8, CompareSoftmaxUint8Test, 1.0f)
315
316ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithRef, ComparePooling2dTest, armnn::PoolingAlgorithm::Max)
317
318ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithRef, ComparePooling2dTest, armnn::PoolingAlgorithm::Average)
319ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithRefUint8, ComparePooling2dUint8Test,
320 armnn::PoolingAlgorithm::Average)
321
322ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithRef, ComparePooling2dTest, armnn::PoolingAlgorithm::L2)
323
324ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest)
325
326ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithRef, CompareMultiplicationTest)
327
328ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
329
330ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
331ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
332
333// ============================================================================
334// FIXTURE tests
335
336ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture,
337 CompareActivationTest, armnn::ActivationFunction::Sigmoid, 5u)
338
339ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture,
340 CompareActivationTest, armnn::ActivationFunction::TanH, 5u)
341
342ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture,
343 CompareActivationTest, armnn::ActivationFunction::Linear, 5u)
344
345ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture,
346 CompareActivationTest, armnn::ActivationFunction::ReLu, 5u)
347
348ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture,
349 CompareActivationTest, armnn::ActivationFunction::BoundedReLu, 5u)
350ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture,
351 CompareActivationUint8Test, armnn::ActivationFunction::BoundedReLu)
352
353ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture,
354 CompareActivationTest, armnn::ActivationFunction::SoftReLu, 5u)
355
356ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture,
357 CompareActivationTest, armnn::ActivationFunction::LeakyReLu, 5u)
358
359ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture,
360 CompareActivationTest, armnn::ActivationFunction::Abs, 5u)
361
362ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture,
363 CompareActivationTest, armnn::ActivationFunction::Sqrt, 5u)
364
365ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
366 CompareActivationTest, armnn::ActivationFunction::Square, 5u)
367
368BOOST_AUTO_TEST_SUITE_END()