telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | #pragma once |
| 6 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 7 | #include <armnn/ArmNN.hpp> |
| 8 | #include <armnn/Tensor.hpp> |
| 9 | |
| 10 | #include <Half.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 11 | |
| 12 | #include <boost/multi_array.hpp> |
| 13 | #include <boost/assert.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 14 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 15 | #include <array> |
| 16 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 17 | // Layer callables. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 18 | |
| 19 | namespace armnn |
| 20 | { |
| 21 | class IWorkloadFactory; |
| 22 | } |
| 23 | |
| 24 | template <std::size_t n> |
| 25 | boost::array<unsigned int, n> GetTensorShapeAsArray(const armnn::TensorInfo& tensorInfo) |
| 26 | { |
| 27 | BOOST_ASSERT_MSG(n == tensorInfo.GetNumDimensions(), |
| 28 | "Attempting to construct a shape array of mismatching size"); |
| 29 | |
| 30 | boost::array<unsigned int, n> shape; |
| 31 | for (unsigned int i = 0; i < n; i++) |
| 32 | { |
| 33 | shape[i] = tensorInfo.GetShape()[i]; |
| 34 | } |
| 35 | return shape; |
| 36 | } |
| 37 | |
| 38 | template <typename T, std::size_t n> |
| 39 | struct LayerTestResult |
| 40 | { |
| 41 | LayerTestResult(const armnn::TensorInfo& outputInfo) |
| 42 | { |
| 43 | auto shape( GetTensorShapeAsArray<n>(outputInfo) ); |
| 44 | output.resize(shape); |
| 45 | outputExpected.resize(shape); |
| 46 | supported = true; |
| 47 | } |
| 48 | |
| 49 | boost::multi_array<T, n> output; |
| 50 | boost::multi_array<T, n> outputExpected; |
| 51 | bool supported; |
| 52 | }; |
| 53 | |
| 54 | LayerTestResult<float, 4> SimpleConvolution2d3x5Test(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | 0a088a6 | 2018-10-25 17:05:05 +0100 | [diff] [blame] | 55 | bool biasEnabled, |
| 56 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 57 | |
| 58 | LayerTestResult<float, 4> SimpleConvolution2d3x3Test(armnn::IWorkloadFactory& workloadFactory, |
narpra01 | 5f70318 | 2018-10-26 16:24:58 +0100 | [diff] [blame] | 59 | bool biasEnabled, |
| 60 | const armnn::DataLayoutIndexed& layout); |
Francis Murtagh | d59116e | 2018-10-04 16:03:07 +0100 | [diff] [blame] | 61 | |
| 62 | LayerTestResult<float, 4> SimpleConvolution2d3x3NhwcTest(armnn::IWorkloadFactory& workloadFactory, |
| 63 | bool biasEnabled); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 64 | |
| 65 | LayerTestResult<float, 4> |
narpra01 | 5f70318 | 2018-10-26 16:24:58 +0100 | [diff] [blame] | 66 | Convolution2dAsymmetricPaddingLargerThanHalfKernelSizeTest(armnn::IWorkloadFactory& workloadFactory, |
| 67 | const armnn::DataLayoutIndexed& layout); |
| 68 | LayerTestResult<float, 4> Convolution2dAsymmetricPaddingTest(armnn::IWorkloadFactory& workloadFactory, |
| 69 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 70 | |
| 71 | |
narpra01 | 5f70318 | 2018-10-26 16:24:58 +0100 | [diff] [blame] | 72 | LayerTestResult<float, 4> Convolution1dTest(armnn::IWorkloadFactory& workloadFactory, |
| 73 | bool biasEnabled); |
| 74 | LayerTestResult<uint8_t, 4> Convolution1dUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 75 | bool biasEnabled); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | |
jimfly01 | d84216a | 2018-10-26 12:56:21 +0100 | [diff] [blame] | 77 | LayerTestResult<float, 4> DepthwiseConvolution2dTest(armnn::IWorkloadFactory& workloadFactory, |
| 78 | bool biasEnabled, |
| 79 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 80 | |
Nikhil Raj | cec6b65 | 2018-10-12 13:51:57 +0100 | [diff] [blame] | 81 | LayerTestResult<float, 4> DepthwiseConvolution2dDepthNhwcTest(armnn::IWorkloadFactory& workloadFactory, |
| 82 | bool biasEnabled); |
| 83 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 84 | LayerTestResult<float, 4> DepthwiseConvolution2dDepthMul1Test(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | b9c8963 | 2018-10-26 16:50:13 +0100 | [diff] [blame] | 85 | bool biasEnabled, |
| 86 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 87 | |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 88 | LayerTestResult<float, 4> DepthwiseConvolution2dAsymmetricTest(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | 382a91d | 2018-10-26 15:55:50 +0100 | [diff] [blame] | 89 | bool biasEnabled, |
| 90 | const armnn::DataLayoutIndexed& layout); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 91 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 92 | LayerTestResult<float, 4> SimpleMaxPooling2dSize2x2Stride2x2Test(armnn::IWorkloadFactory& workloadFactory, |
| 93 | bool forceNoPadding); |
| 94 | LayerTestResult<uint8_t, 4> SimpleMaxPooling2dSize2x2Stride2x2Uint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 95 | bool forceNoPadding); |
| 96 | LayerTestResult<float, 4> SimpleMaxPooling2dSize3x3Stride2x4Test(armnn::IWorkloadFactory& workloadFactory, |
| 97 | bool forceNoPadding); |
| 98 | LayerTestResult<uint8_t, 4> SimpleMaxPooling2dSize3x3Stride2x4Uint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 99 | bool forceNoPadding ); |
| 100 | LayerTestResult<float, 4> IgnorePaddingSimpleMaxPooling2dTest(armnn::IWorkloadFactory& workloadFactory); |
| 101 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleMaxPooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 102 | LayerTestResult<float, 4> IgnorePaddingMaxPooling2dSize3Test(armnn::IWorkloadFactory& workloadFactory); |
| 103 | LayerTestResult<uint8_t, 4> IgnorePaddingMaxPooling2dSize3Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 104 | |
James Conroy | 45a9b77 | 2018-10-31 11:47:53 +0000 | [diff] [blame] | 105 | LayerTestResult<float, 4> SimpleMaxPooling2dTest(armnn::IWorkloadFactory& workloadFactory, |
| 106 | const armnn::DataLayoutIndexed& dataLayout); |
| 107 | LayerTestResult<uint8_t, 4> SimpleMaxPooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 108 | const armnn::DataLayoutIndexed& dataLayout); |
| 109 | |
| 110 | LayerTestResult<float, 4> SimpleAveragePooling2dTest(armnn::IWorkloadFactory& workloadFactory, |
| 111 | const armnn::DataLayoutIndexed& dataLayout); |
| 112 | LayerTestResult<uint8_t, 4> SimpleAveragePooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 113 | const armnn::DataLayoutIndexed& dataLayout); |
| 114 | |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 115 | LayerTestResult<float, 4> IgnorePaddingAveragePooling2dSize3x2Stride2x2Test(armnn::IWorkloadFactory& workloadFactory, |
| 116 | bool forceNoPadding); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 117 | LayerTestResult<float, 4> IgnorePaddingSimpleAveragePooling2dTest(armnn::IWorkloadFactory& workloadFactory); |
| 118 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleAveragePooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 119 | LayerTestResult<float, 4> IgnorePaddingSimpleAveragePooling2dNoPaddingTest(armnn::IWorkloadFactory& workloadFactory); |
| 120 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test( |
| 121 | armnn::IWorkloadFactory& workloadFactory); |
| 122 | LayerTestResult<float, 4> IgnorePaddingAveragePooling2dSize3Test(armnn::IWorkloadFactory& workloadFactory); |
| 123 | LayerTestResult<uint8_t, 4> IgnorePaddingAveragePooling2dSize3Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 124 | |
James Conroy | 45a9b77 | 2018-10-31 11:47:53 +0000 | [diff] [blame] | 125 | LayerTestResult<float, 4> SimpleL2Pooling2dTest(armnn::IWorkloadFactory& workloadFactory, |
| 126 | const armnn::DataLayoutIndexed& dataLayout); |
| 127 | LayerTestResult<uint8_t, 4> SimpleL2Pooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 128 | const armnn::DataLayoutIndexed& dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 129 | |
| 130 | LayerTestResult<float, 4> L2Pooling2dSize3Stride1Test(armnn::IWorkloadFactory& workloadFactory); |
| 131 | LayerTestResult<uint8_t, 4> L2Pooling2dSize3Stride1Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 132 | LayerTestResult<float, 4> L2Pooling2dSize3Stride3Test(armnn::IWorkloadFactory& workloadFactory); |
| 133 | LayerTestResult<uint8_t, 4> L2Pooling2dSize3Stride3Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 134 | LayerTestResult<float, 4> L2Pooling2dSize3Stride4Test(armnn::IWorkloadFactory& workloadFactory); |
| 135 | LayerTestResult<uint8_t, 4> L2Pooling2dSize3Stride4Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 136 | LayerTestResult<float, 4> L2Pooling2dSize7Test(armnn::IWorkloadFactory& workloadFactory); |
| 137 | LayerTestResult<uint8_t, 4> L2Pooling2dSize7Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 138 | LayerTestResult<float, 4> L2Pooling2dSize9Test(armnn::IWorkloadFactory& workloadFactory); |
| 139 | LayerTestResult<uint8_t, 4> L2Pooling2dSize9Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 140 | LayerTestResult<float, 4> LargeTensorsAveragePooling2dTest(armnn::IWorkloadFactory& workloadFactory); |
| 141 | LayerTestResult<uint8_t, 4> LargeTensorsAveragePooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 142 | |
| 143 | LayerTestResult<float, 4> IgnorePaddingSimpleL2Pooling2dTest(armnn::IWorkloadFactory& workloadFactory); |
| 144 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleL2Pooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 145 | LayerTestResult<float, 4> IgnorePaddingL2Pooling2dSize3Test(armnn::IWorkloadFactory& workloadFactory); |
| 146 | LayerTestResult<uint8_t, 4> IgnorePaddingL2Pooling2dSize3Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 147 | |
| 148 | LayerTestResult<float, 4> AsymmetricNonSquarePooling2dTest(armnn::IWorkloadFactory& workloadFactory); |
| 149 | LayerTestResult<uint8_t, 4> AsymmetricNonSquarePooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 150 | |
| 151 | LayerTestResult<float, 4> ComparePooling2dTest(armnn::IWorkloadFactory& workloadFactory, |
| 152 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 153 | armnn::PoolingAlgorithm poolingType); |
| 154 | LayerTestResult<uint8_t, 4> ComparePooling2dUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 155 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 156 | armnn::PoolingAlgorithm poolingType); |
| 157 | |
| 158 | LayerTestResult<float, 4> ConstantLinearActivationTest(armnn::IWorkloadFactory& workloadFactory); |
| 159 | |
| 160 | LayerTestResult<float, 4> SimpleNormalizationAcrossTest(armnn::IWorkloadFactory& workloadFactory); |
| 161 | LayerTestResult<float, 4> SimpleNormalizationWithinTest(armnn::IWorkloadFactory& workloadFactory); |
narpra01 | 55a97bc | 2018-10-02 14:35:53 +0100 | [diff] [blame] | 162 | LayerTestResult<float,4> SimpleNormalizationAcrossNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 163 | |
| 164 | LayerTestResult<float, 2> SimpleSoftmaxTest(armnn::IWorkloadFactory& workloadFactory, float beta); |
| 165 | LayerTestResult<uint8_t, 2> SimpleSoftmaxUint8Test(armnn::IWorkloadFactory& workloadFactory, float beta); |
| 166 | |
| 167 | LayerTestResult<float, 4> SimpleSigmoidTest(armnn::IWorkloadFactory& workloadFactory); |
| 168 | |
| 169 | LayerTestResult<float, 4> SimpleReshapeFloat32Test(armnn::IWorkloadFactory& workloadFactory); |
| 170 | LayerTestResult<uint8_t, 4> SimpleReshapeUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 171 | |
| 172 | LayerTestResult<float, 4> SimpleFloorTest(armnn::IWorkloadFactory& workloadFactory); |
| 173 | |
| 174 | LayerTestResult<float, 1> Concatenation1dTest(armnn::IWorkloadFactory& workloadFactory); |
| 175 | LayerTestResult<float, 2> Concatenation2dDim0Test(armnn::IWorkloadFactory& workloadFactory); |
| 176 | LayerTestResult<float, 2> Concatenation2dDim1Test(armnn::IWorkloadFactory& workloadFactory); |
| 177 | LayerTestResult<float, 2> Concatenation2dDim0DiffInputDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 178 | LayerTestResult<float, 2> Concatenation2dDim1DiffInputDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 179 | LayerTestResult<float, 3> Concatenation3dDim0Test(armnn::IWorkloadFactory& workloadFactory); |
| 180 | LayerTestResult<float, 3> Concatenation3dDim1Test(armnn::IWorkloadFactory& workloadFactory); |
| 181 | LayerTestResult<float, 3> Concatenation3dDim2Test(armnn::IWorkloadFactory& workloadFactory); |
| 182 | LayerTestResult<float, 3> Concatenation3dDim0DiffInputDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 183 | LayerTestResult<float, 3> Concatenation3dDim1DiffInputDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 184 | LayerTestResult<float, 3> Concatenation3dDim2DiffInputDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 185 | |
| 186 | LayerTestResult<uint8_t, 4> SimpleSigmoidUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 187 | |
| 188 | LayerTestResult<float, 4> CompareConvolution2dTest(armnn::IWorkloadFactory& workloadFactory, |
| 189 | armnn::IWorkloadFactory& refWorkloadFactory); |
| 190 | |
| 191 | template<typename T> |
| 192 | LayerTestResult<T, 4> CompareDepthwiseConvolution2dTest(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | 7af00da | 2018-10-31 14:43:53 +0000 | [diff] [blame] | 193 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 194 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 195 | |
| 196 | LayerTestResult<float, 4> CompareNormalizationTest(armnn::IWorkloadFactory& workloadFactory, |
| 197 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 198 | armnn::NormalizationAlgorithmChannel normChannel, |
| 199 | armnn::NormalizationAlgorithmMethod normMethod); |
| 200 | |
| 201 | LayerTestResult<float, 2> CompareSoftmaxTest(armnn::IWorkloadFactory& workloadFactory, |
| 202 | armnn::IWorkloadFactory& refWorkloadFactory, float beta); |
| 203 | |
| 204 | LayerTestResult<float, 2> FullyConnectedFloat32Test(armnn::IWorkloadFactory& workloadFactory, |
| 205 | bool biasEnabled, |
| 206 | bool transposeWeights); |
| 207 | |
| 208 | std::vector<LayerTestResult<float, 3>> SplitterTest(armnn::IWorkloadFactory& workloadFactory); |
| 209 | LayerTestResult<float, 3> CopyViaSplitterTest(armnn::IWorkloadFactory& workloadFactory); |
| 210 | |
| 211 | LayerTestResult<float, 3> MergerTest(armnn::IWorkloadFactory& workloadFactory); |
| 212 | |
| 213 | LayerTestResult<float, 4> AdditionTest(armnn::IWorkloadFactory& workloadFactory); |
| 214 | LayerTestResult<float, 4> AdditionBroadcast1ElementTest(armnn::IWorkloadFactory& workloadFactory); |
| 215 | LayerTestResult<float, 4> AdditionBroadcastTest(armnn::IWorkloadFactory& workloadFactory); |
| 216 | |
| 217 | LayerTestResult<float, 4> CompareAdditionTest(armnn::IWorkloadFactory& workloadFactory, |
David Beck | f195f03 | 2018-09-06 16:46:34 +0100 | [diff] [blame] | 218 | armnn::IWorkloadFactory& refWorkloadFactory); |
| 219 | |
| 220 | LayerTestResult<float, 4> SubtractionTest(armnn::IWorkloadFactory& workloadFactory); |
| 221 | LayerTestResult<float, 4> SubtractionBroadcast1ElementTest(armnn::IWorkloadFactory& workloadFactory); |
| 222 | LayerTestResult<float, 4> SubtractionBroadcastTest(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 223 | |
| 224 | LayerTestResult<float, 4> CompareActivationTest(armnn::IWorkloadFactory& workloadFactory, |
| 225 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 226 | armnn::ActivationFunction f, |
| 227 | unsigned int batchSize); |
| 228 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 229 | LayerTestResult<float, 4> DivisionTest(armnn::IWorkloadFactory& workloadFactory); |
Francis Murtagh | 8c5e3dc | 2018-08-30 17:18:37 +0100 | [diff] [blame] | 230 | LayerTestResult<float, 4> DivisionByZeroTest(armnn::IWorkloadFactory& workloadFactory); |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 231 | LayerTestResult<float, 4> DivisionBroadcast1ElementTest(armnn::IWorkloadFactory& workloadFactory); |
| 232 | LayerTestResult<float, 4> DivisionBroadcast1DVectorTest(armnn::IWorkloadFactory& workloadFactory); |
| 233 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 234 | LayerTestResult<float, 4> MultiplicationTest(armnn::IWorkloadFactory& workloadFactory); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 235 | LayerTestResult<float, 4> MultiplicationBroadcast1ElementTest(armnn::IWorkloadFactory& workloadFactory); |
| 236 | LayerTestResult<float, 4> MultiplicationBroadcast1DVectorTest(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 237 | |
| 238 | LayerTestResult<float, 4> CompareMultiplicationTest(armnn::IWorkloadFactory& workloadFactory, |
| 239 | armnn::IWorkloadFactory& refWorkloadFactory); |
| 240 | |
| 241 | LayerTestResult<float, 4> BatchNormTest(armnn::IWorkloadFactory& workloadFactory); |
Matteo Martincigh | 8eb675e | 2018-10-17 14:43:29 +0100 | [diff] [blame] | 242 | LayerTestResult<float, 4> BatchNormNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 243 | |
| 244 | LayerTestResult<float, 4> CompareBatchNormTest(armnn::IWorkloadFactory& workloadFactory, |
| 245 | armnn::IWorkloadFactory& refWorkloadFactory); |
| 246 | |
| 247 | LayerTestResult<float, 4> BoundedReLuUpperAndLowerBoundTest(armnn::IWorkloadFactory& workloadFactory); |
| 248 | LayerTestResult<uint8_t, 4> BoundedReLuUint8UpperAndLowerBoundTest(armnn::IWorkloadFactory& workloadFactory); |
| 249 | LayerTestResult<float, 4> BoundedReLuUpperBoundOnlyTest(armnn::IWorkloadFactory& workloadFactory); |
| 250 | LayerTestResult<uint8_t, 4> BoundedReLuUint8UpperBoundOnlyTest(armnn::IWorkloadFactory& workloadFactory); |
| 251 | |
| 252 | LayerTestResult<float, 4> CompareBoundedReLuTest(armnn::IWorkloadFactory& workloadFactory, |
| 253 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 254 | float upperBound, |
| 255 | float lowerBound); |
| 256 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 257 | // Tests that the output should be identical to the input when the output dimensions match the input ones. |
James Conroy | 6b96582 | 2018-11-01 11:33:09 +0000 | [diff] [blame] | 258 | LayerTestResult<float, 4> ResizeBilinearNopTest(armnn::IWorkloadFactory& workloadFactory, |
| 259 | const armnn::DataLayoutIndexed& dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 260 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 261 | // Tests the behaviour of the resize bilinear operation when rescaling a 2x2 image into a 1x1 image. |
James Conroy | 6b96582 | 2018-11-01 11:33:09 +0000 | [diff] [blame] | 262 | LayerTestResult<float, 4> SimpleResizeBilinearTest(armnn::IWorkloadFactory& workloadFactory, |
| 263 | const armnn::DataLayoutIndexed& dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 264 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 265 | // Tests the resize bilinear for minification of a square input matrix (also: input dimensions are a |
| 266 | // multiple of output dimensions). |
James Conroy | 6b96582 | 2018-11-01 11:33:09 +0000 | [diff] [blame] | 267 | LayerTestResult<float, 4> ResizeBilinearSqMinTest(armnn::IWorkloadFactory& workloadFactory, |
| 268 | const armnn::DataLayoutIndexed& dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 269 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 270 | // Tests the resize bilinear for minification (output dimensions smaller than input dimensions). |
James Conroy | 6b96582 | 2018-11-01 11:33:09 +0000 | [diff] [blame] | 271 | LayerTestResult<float, 4> ResizeBilinearMinTest(armnn::IWorkloadFactory& workloadFactory, |
| 272 | const armnn::DataLayoutIndexed& dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 273 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 274 | // Tests the resize bilinear for magnification (output dimensions bigger than input dimensions). |
James Conroy | 6b96582 | 2018-11-01 11:33:09 +0000 | [diff] [blame] | 275 | LayerTestResult<float, 4> ResizeBilinearMagTest(armnn::IWorkloadFactory& workloadFactory, |
| 276 | const armnn::DataLayoutIndexed& dataLayout); |
James Conroy | 074f371 | 2018-10-03 09:32:03 +0100 | [diff] [blame] | 277 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 278 | LayerTestResult<float, 4> BatchNormTest(armnn::IWorkloadFactory& workloadFactory); |
Nikhil Raj | d134093 | 2018-10-18 14:27:50 +0100 | [diff] [blame] | 279 | LayerTestResult<float, 4> BatchNormNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 280 | |
| 281 | LayerTestResult<float, 2> FakeQuantizationTest(armnn::IWorkloadFactory& workloadFactory); |
| 282 | |
| 283 | LayerTestResult<float, 4> L2Normalization1dTest(armnn::IWorkloadFactory& workloadFactory); |
| 284 | LayerTestResult<float, 4> L2Normalization2dTest(armnn::IWorkloadFactory& workloadFactory); |
| 285 | LayerTestResult<float, 4> L2Normalization3dTest(armnn::IWorkloadFactory& workloadFactory); |
| 286 | LayerTestResult<float, 4> L2Normalization4dTest(armnn::IWorkloadFactory& workloadFactory); |
| 287 | |
Matteo Martincigh | 539b44d | 2018-10-01 09:26:39 +0100 | [diff] [blame] | 288 | LayerTestResult<float, 4> L2Normalization1dNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
| 289 | LayerTestResult<float, 4> L2Normalization2dNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
| 290 | LayerTestResult<float, 4> L2Normalization3dNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
| 291 | LayerTestResult<float, 4> L2Normalization4dNhwcTest(armnn::IWorkloadFactory& workloadFactory); |
| 292 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 293 | LayerTestResult<float, 4> ConstantTest(armnn::IWorkloadFactory& workloadFactory); |
| 294 | |
| 295 | LayerTestResult<uint8_t, 4> ConstantTestUint8(armnn::IWorkloadFactory& workloadFactory); |
| 296 | |
| 297 | LayerTestResult<uint8_t, 4> BoundedReLuUint8Test(armnn::IWorkloadFactory& workloadFactory, float upperBound); |
| 298 | LayerTestResult<uint8_t, 4> BoundedReLuUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 299 | float upperBound, |
| 300 | float lowerBound); |
| 301 | |
| 302 | LayerTestResult<uint8_t, 2> FullyConnectedUint8Test(armnn::IWorkloadFactory& workloadFactory, bool biasEnabled); |
| 303 | |
| 304 | std::vector<LayerTestResult<uint8_t, 3>> SplitterUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 305 | LayerTestResult<uint8_t, 3> CopyViaSplitterUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 306 | |
| 307 | LayerTestResult<uint8_t, 3> MergerUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 308 | |
| 309 | LayerTestResult<uint8_t, 4> AdditionUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 310 | LayerTestResult<uint8_t, 4> AdditionBroadcast1ElementUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 311 | LayerTestResult<uint8_t, 4> AdditionBroadcastUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 312 | |
David Beck | f195f03 | 2018-09-06 16:46:34 +0100 | [diff] [blame] | 313 | LayerTestResult<uint8_t, 4> SubtractionUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 314 | LayerTestResult<uint8_t, 4> SubtractionBroadcast1ElementUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 315 | LayerTestResult<uint8_t, 4> SubtractionBroadcastUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 316 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 317 | LayerTestResult<uint8_t, 4> CompareActivationUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 318 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 319 | armnn::ActivationFunction f); |
| 320 | |
| 321 | LayerTestResult<uint8_t, 2> CompareSoftmaxUint8Test(armnn::IWorkloadFactory& workloadFactory, |
| 322 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 323 | float beta); |
| 324 | |
| 325 | LayerTestResult<uint8_t, 4> MultiplicationUint8Test(armnn::IWorkloadFactory& workloadFactory); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 326 | LayerTestResult<uint8_t, 4> MultiplicationBroadcast1ElementUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 327 | LayerTestResult<uint8_t, 4> MultiplicationBroadcast1DVectorUint8Test(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 328 | |
David Beck | 5cd01f3 | 2018-09-12 16:00:08 +0100 | [diff] [blame] | 329 | LayerTestResult<uint8_t, 4> DivisionUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 330 | LayerTestResult<uint8_t, 4> DivisionBroadcast1ElementUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 331 | LayerTestResult<uint8_t, 4> DivisionBroadcast1DVectorUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 332 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 333 | LayerTestResult<uint8_t, 4> SimpleConvolution2d3x5Uint8Test(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | 0a088a6 | 2018-10-25 17:05:05 +0100 | [diff] [blame] | 334 | bool biasEnabled, |
| 335 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 336 | |
| 337 | LayerTestResult<uint8_t, 4> SimpleConvolution2d3x3Uint8Test(armnn::IWorkloadFactory& workloadFactory, |
narpra01 | 5f70318 | 2018-10-26 16:24:58 +0100 | [diff] [blame] | 338 | bool biasEnabled, |
| 339 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 340 | |
| 341 | LayerTestResult<uint8_t, 4> DepthwiseConvolution2dUint8Test(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | d84216a | 2018-10-26 12:56:21 +0100 | [diff] [blame] | 342 | bool biasEnabled, |
| 343 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 344 | |
| 345 | LayerTestResult<uint8_t, 4> DepthwiseConvolution2dDepthMul1Uint8Test(armnn::IWorkloadFactory& workloadFactory, |
jimfly01 | b9c8963 | 2018-10-26 16:50:13 +0100 | [diff] [blame] | 346 | bool biasEnabled, |
| 347 | const armnn::DataLayoutIndexed& layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 348 | |
| 349 | LayerTestResult<uint8_t, 4> ConstantLinearActivationUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 350 | |
| 351 | LayerTestResult<uint8_t, 4> ResizeBilinearNopUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 352 | LayerTestResult<uint8_t, 4> SimpleResizeBilinearUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 353 | LayerTestResult<uint8_t, 4> ResizeBilinearSqMinUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 354 | LayerTestResult<uint8_t, 4> ResizeBilinearMinUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 355 | LayerTestResult<uint8_t, 4> ResizeBilinearMagUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 356 | |
| 357 | LayerTestResult<uint8_t, 4> BatchNormUint8Test(armnn::IWorkloadFactory& workloadFactory); |
Matteo Martincigh | 8eb675e | 2018-10-17 14:43:29 +0100 | [diff] [blame] | 358 | LayerTestResult<uint8_t, 4> BatchNormUint8NhwcTest(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 359 | |
| 360 | LayerTestResult<uint8_t, 4> ConstantUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 361 | |
| 362 | LayerTestResult<uint8_t, 1> Concatenation1dUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 363 | LayerTestResult<uint8_t, 2> Concatenation2dDim0Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 364 | LayerTestResult<uint8_t, 2> Concatenation2dDim1Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 365 | LayerTestResult<uint8_t, 2> Concatenation2dDim0DiffInputDimsUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 366 | LayerTestResult<uint8_t, 2> Concatenation2dDim1DiffInputDimsUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 367 | LayerTestResult<uint8_t, 3> Concatenation3dDim0Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 368 | LayerTestResult<uint8_t, 3> Concatenation3dDim1Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 369 | LayerTestResult<uint8_t, 3> Concatenation3dDim2Uint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 370 | LayerTestResult<uint8_t, 3> Concatenation3dDim0DiffInputDimsUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 371 | LayerTestResult<uint8_t, 3> Concatenation3dDim1DiffInputDimsUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 372 | LayerTestResult<uint8_t, 3> Concatenation3dDim2DiffInputDimsUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 373 | |
| 374 | |
| 375 | LayerTestResult<float, 2> FullyConnectedLargeTest(armnn::IWorkloadFactory& workloadFactory, |
| 376 | bool transposeWeights); |
| 377 | LayerTestResult<float, 4> SimplePermuteFloat32Test(armnn::IWorkloadFactory& workloadFactory); |
| 378 | LayerTestResult<uint8_t, 4> SimplePermuteUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 379 | |
Mohamed Nour Abouelseoud | dd6acea | 2018-10-18 12:26:19 +0100 | [diff] [blame] | 380 | LayerTestResult<uint8_t, 2> PadUint82dTest(armnn::IWorkloadFactory& workloadFactory); |
| 381 | LayerTestResult<uint8_t, 3> PadUint83dTest(armnn::IWorkloadFactory& workloadFactory); |
| 382 | LayerTestResult<uint8_t, 4> PadUint84dTest(armnn::IWorkloadFactory& workloadFactory); |
Mohamed Nour Abouelseoud | 7420e55 | 2018-10-12 12:26:24 +0100 | [diff] [blame] | 383 | |
Mohamed Nour Abouelseoud | dd6acea | 2018-10-18 12:26:19 +0100 | [diff] [blame] | 384 | LayerTestResult<float, 2> PadFloat322dTest(armnn::IWorkloadFactory& workloadFactory); |
| 385 | LayerTestResult<float, 3> PadFloat323dTest(armnn::IWorkloadFactory& workloadFactory); |
| 386 | LayerTestResult<float, 4> PadFloat324dTest(armnn::IWorkloadFactory& workloadFactory); |
Mohamed Nour Abouelseoud | 7420e55 | 2018-10-12 12:26:24 +0100 | [diff] [blame] | 387 | |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 388 | LayerTestResult<float, 4> PermuteFloat32ValueSet1Test(armnn::IWorkloadFactory& workloadFactory); |
| 389 | LayerTestResult<float, 4> PermuteFloat32ValueSet2Test(armnn::IWorkloadFactory& workloadFactory); |
| 390 | LayerTestResult<float, 4> PermuteFloat32ValueSet3Test(armnn::IWorkloadFactory& workloadFactory); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 391 | |
| 392 | LayerTestResult<float, 2> LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest |
| 393 | (armnn::IWorkloadFactory& workloadFactory); |
| 394 | LayerTestResult<float, 2> |
| 395 | LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest(armnn::IWorkloadFactory& workloadFactory); |
| 396 | LayerTestResult<float, 2> |
| 397 | LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest(armnn::IWorkloadFactory& workloadFactory); |
| 398 | |
| 399 | LayerTestResult<float, 4> SimpleConvertFp16ToFp32Test(armnn::IWorkloadFactory& workloadFactory); |
| 400 | LayerTestResult<armnn::Half, 4> SimpleConvertFp32ToFp16Test(armnn::IWorkloadFactory& workloadFactory); |
narpra01 | 1e4c31d | 2018-09-28 11:07:51 +0100 | [diff] [blame] | 401 | |
| 402 | |
| 403 | LayerTestResult<uint8_t, 1> MeanUint8SimpleTest(armnn::IWorkloadFactory& workloadFactory); |
| 404 | LayerTestResult<uint8_t, 3> MeanUint8SimpleAxisTest(armnn::IWorkloadFactory& workloadFactory); |
| 405 | LayerTestResult<uint8_t, 4> MeanUint8KeepDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 406 | LayerTestResult<uint8_t, 4> MeanUint8MultipleDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 407 | LayerTestResult<uint8_t, 1> MeanVtsUint8Test(armnn::IWorkloadFactory& workloadFactory); |
| 408 | LayerTestResult<float, 1> MeanFloatSimpleTest(armnn::IWorkloadFactory& workloadFactory); |
| 409 | LayerTestResult<float, 3> MeanFloatSimpleAxisTest(armnn::IWorkloadFactory& workloadFactory); |
| 410 | LayerTestResult<float, 4> MeanFloatKeepDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 411 | LayerTestResult<float, 4> MeanFloatMultipleDimsTest(armnn::IWorkloadFactory& workloadFactory); |
| 412 | LayerTestResult<float, 1> MeanVtsFloat1Test(armnn::IWorkloadFactory& workloadFactory); |
| 413 | LayerTestResult<float, 3> MeanVtsFloat2Test(armnn::IWorkloadFactory& workloadFactory); |
Matteo Martincigh | 28dcab6 | 2018-10-19 16:40:03 +0100 | [diff] [blame] | 414 | LayerTestResult<float, 3> MeanVtsFloat3Test(armnn::IWorkloadFactory& workloadFactory); |
| 415 | |
Matteo Martincigh | 8eb675e | 2018-10-17 14:43:29 +0100 | [diff] [blame] | 416 | LayerTestResult<float, 4> AdditionAfterMaxPoolTest(armnn::IWorkloadFactory& workloadFactory); |