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 | // |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 5 | |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 6 | #include "NeonWorkloadFactoryHelper.hpp" |
| 7 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 8 | #include <test/TensorHelpers.hpp> |
| 9 | #include <test/UnitTests.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 10 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 11 | #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> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 19 | |
arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 20 | #include <boost/test/unit_test.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 21 | |
| 22 | BOOST_AUTO_TEST_SUITE(Compute_ArmComputeNeon) |
| 23 | using FactoryType = armnn::NeonWorkloadFactory; |
| 24 | |
| 25 | // ============================================================================ |
| 26 | // UNIT tests |
| 27 | |
| 28 | // Convolution |
| 29 | ARMNN_AUTO_TEST_CASE(SimpleConvolution1d, Convolution1dTest, true) |
| 30 | |
jimfly01 | 0a088a6 | 2018-10-25 17:05:05 +0100 | [diff] [blame] | 31 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2d, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NCHW) |
| 32 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2dNhwc, SimpleConvolution2d3x5Test, true, armnn::DataLayout::NHWC) |
narpra01 | 5f70318 | 2018-10-26 16:24:58 +0100 | [diff] [blame] | 33 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NCHW) |
| 34 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2d3x3Uint8Nhwc, SimpleConvolution2d3x3Uint8Test, true, armnn::DataLayout::NHWC) |
jimfly01 | 0a088a6 | 2018-10-25 17:05:05 +0100 | [diff] [blame] | 35 | ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2d, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NCHW) |
| 36 | ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dNhwc, SimpleConvolution2d3x5Test, false, armnn::DataLayout::NHWC) |
Mike Kelly | 7332ed8 | 2018-12-20 17:03:06 +0000 | [diff] [blame] | 37 | ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dStride2x2Nhwc, |
| 38 | SimpleConvolution2d3x3Stride2x2Test, false, armnn::DataLayout::NHWC) |
jimfly01 | 0a088a6 | 2018-10-25 17:05:05 +0100 | [diff] [blame] | 39 | |
narpra01 | 5f70318 | 2018-10-26 16:24:58 +0100 | [diff] [blame] | 40 | ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquare, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NCHW) |
| 41 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPadding, Convolution2dAsymmetricPaddingTest, armnn::DataLayout::NCHW) |
| 42 | |
| 43 | ARMNN_AUTO_TEST_CASE(UnbiasedConvolution2dSquareNhwc, SimpleConvolution2d3x3Test, false, armnn::DataLayout::NHWC) |
| 44 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2dAsymmetricPaddingNhwc, |
| 45 | Convolution2dAsymmetricPaddingTest, |
| 46 | armnn::DataLayout::NHWC) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 47 | |
Francis Murtagh | d59116e | 2018-10-04 16:03:07 +0100 | [diff] [blame] | 48 | ARMNN_AUTO_TEST_CASE(SimpleConvolution2dSquareNhwc, SimpleConvolution2d3x3NhwcTest, false) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 49 | |
| 50 | // Depthwise Convolution |
jimfly01 | b9c8963 | 2018-10-26 16:50:13 +0100 | [diff] [blame] | 51 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1, |
| 52 | DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NCHW) |
| 53 | ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1, |
| 54 | DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NCHW) |
| 55 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8, |
| 56 | DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NCHW) |
| 57 | ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8, |
| 58 | DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NCHW) |
| 59 | |
| 60 | // NHWC Depthwise Convolution |
| 61 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1NHhwc, |
| 62 | DepthwiseConvolution2dDepthMul1Test, true, armnn::DataLayout::NHWC) |
| 63 | ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Nhwc, |
| 64 | DepthwiseConvolution2dDepthMul1Test, false, armnn::DataLayout::NHWC) |
| 65 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1Uint8Nhwc, |
| 66 | DepthwiseConvolution2dDepthMul1Uint8Test, true, armnn::DataLayout::NHWC) |
| 67 | ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dDepthMul1Uint8Nhwc, |
| 68 | DepthwiseConvolution2dDepthMul1Uint8Test, false, armnn::DataLayout::NHWC) |
| 69 | |
Nikhil Raj | cec6b65 | 2018-10-12 13:51:57 +0100 | [diff] [blame] | 70 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthNhwc, DepthwiseConvolution2dDepthNhwcTest, false) |
Bruno Goncalves | 22972f0 | 2019-04-26 21:03:24 -0300 | [diff] [blame] | 71 | ARMNN_AUTO_TEST_CASE(SimpleDepthwiseConvolution2d3x3Dilation3x3Nhwc, |
| 72 | SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTest) |
jimfly01 | b9c8963 | 2018-10-26 16:50:13 +0100 | [diff] [blame] | 73 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 74 | |
jimfly01 | 382a91d | 2018-10-26 15:55:50 +0100 | [diff] [blame] | 75 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetric, |
| 76 | DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NCHW) |
| 77 | ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetric, |
| 78 | DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NCHW) |
| 79 | ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetricNhwc, |
| 80 | DepthwiseConvolution2dAsymmetricTest, true, armnn::DataLayout::NHWC) |
| 81 | ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetricNhwc, |
| 82 | DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NHWC) |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 83 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 84 | namespace |
| 85 | { |
| 86 | |
| 87 | armnn::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 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 91 | boost::ignore_unused(depthMultiplier); |
| 92 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 93 | armnn::DepthwiseConvolution2dDescriptor desc; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 94 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 95 | desc.m_PadLeft = padLeft; |
| 96 | desc.m_PadRight = padRight; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 97 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 98 | desc.m_PadTop = padTop; |
| 99 | desc.m_PadBottom = padBottom; |
| 100 | desc.m_StrideX = strideX; |
| 101 | desc.m_StrideY = strideY; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 102 | desc.m_BiasEnabled = false; |
| 103 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 104 | return desc; |
| 105 | } |
| 106 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 107 | armnn::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 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | BOOST_AUTO_TEST_CASE(DepthwiseConv2dUtils) |
| 137 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 138 | 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-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 146 | armnn::NeonLayerSupport layerSupport; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 147 | |
| 148 | // Strides supported: 1,2,3 |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 149 | descriptor = MakeDepthwiseConv2dDesc(1, 1); |
| 150 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 151 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 152 | weightsInfo3x3, biasesInfo)); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 153 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 154 | descriptor = MakeDepthwiseConv2dDesc(1, 2); |
| 155 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 156 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 157 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 158 | |
| 159 | descriptor = MakeDepthwiseConv2dDesc(1, 3); |
| 160 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 161 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 162 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 163 | |
| 164 | descriptor = MakeDepthwiseConv2dDesc(2, 1); |
| 165 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 166 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 167 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 168 | |
| 169 | descriptor = MakeDepthwiseConv2dDesc(2, 2); |
| 170 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 171 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 172 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 173 | |
| 174 | descriptor = MakeDepthwiseConv2dDesc(2, 3); |
| 175 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 176 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 177 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 178 | |
| 179 | descriptor = MakeDepthwiseConv2dDesc(3, 1); |
| 180 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 181 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 182 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 183 | |
| 184 | descriptor = MakeDepthwiseConv2dDesc(3, 2); |
| 185 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 186 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 187 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 188 | |
| 189 | descriptor = MakeDepthwiseConv2dDesc(3, 3); |
| 190 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 191 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 192 | weightsInfo3x3, biasesInfo)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 193 | |
| 194 | // Supported stride 4 |
| 195 | descriptor = MakeDepthwiseConv2dDesc(4, 1); |
| 196 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 197 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 198 | weightsInfo3x3, biasesInfo)); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 199 | |
| 200 | // Supported weights shape 1x1 |
| 201 | armnn::TensorInfo weightsInfo1x1({ 1, 1, 1, 1 }, armnn::DataType::Float32); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 202 | descriptor = MakeDepthwiseConv2dDesc(1, 1); |
| 203 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo1x1, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 204 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 205 | weightsInfo1x1, biasesInfo)); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 206 | |
| 207 | // Supported shape 2x2 |
| 208 | armnn::TensorInfo weightsInfo2x2({ 1, 1, 2, 2 }, armnn::DataType::Float32); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 209 | descriptor = MakeDepthwiseConv2dDesc(1, 1); |
| 210 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo2x2, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 211 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 212 | weightsInfo2x2, biasesInfo)); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 213 | |
| 214 | // Asymmetric padding |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 215 | descriptor = MakeDepthwiseConv2dDesc(1, 1, 1, 1, 2, 1, 2); |
| 216 | outputInfo = CreateOutputTensorInfo(inputInfo, weightsInfo3x3, descriptor, dataType); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 217 | BOOST_TEST(layerSupport.IsDepthwiseConvolutionSupported(inputInfo, outputInfo, descriptor, |
| 218 | weightsInfo3x3, biasesInfo)); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | // Pooling |
| 222 | ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4, SimpleMaxPooling2dSize3x3Stride2x4Test, true) |
| 223 | ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dSize3x3Stride2x4Uint8, SimpleMaxPooling2dSize3x3Stride2x4Uint8Test, true) |
James Conroy | 45a9b77 | 2018-10-31 11:47:53 +0000 | [diff] [blame] | 224 | |
| 225 | ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2d, SimpleMaxPooling2dTest, armnn::DataLayout::NCHW) |
| 226 | ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dNhwc, SimpleMaxPooling2dTest, armnn::DataLayout::NHWC) |
| 227 | ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NCHW) |
| 228 | ARMNN_AUTO_TEST_CASE(SimpleMaxPooling2dUint8Nhwc, SimpleMaxPooling2dUint8Test, armnn::DataLayout::NHWC) |
| 229 | |
| 230 | ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2d, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW) |
| 231 | ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dNhwc, SimpleAveragePooling2dTest, armnn::DataLayout::NCHW) |
| 232 | ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NCHW) |
| 233 | ARMNN_AUTO_TEST_CASE(SimpleAveragePooling2dUint8Nhwc, SimpleAveragePooling2dUint8Test, armnn::DataLayout::NHWC) |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 234 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 235 | ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2d, LargeTensorsAveragePooling2dTest) |
| 236 | ARMNN_AUTO_TEST_CASE(LargeTensorsAveragePooling2dUint8, LargeTensorsAveragePooling2dUint8Test) |
| 237 | |
James Conroy | 45a9b77 | 2018-10-31 11:47:53 +0000 | [diff] [blame] | 238 | ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2d, SimpleL2Pooling2dTest, armnn::DataLayout::NCHW) |
| 239 | ARMNN_AUTO_TEST_CASE(SimpleL2Pooling2dNeon, SimpleL2Pooling2dTest, armnn::DataLayout::NHWC) |
| 240 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_SimpleL2Pooling2dUint8, SimpleL2Pooling2dUint8Test, armnn::DataLayout::NCHW) |
| 241 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 242 | ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride1, L2Pooling2dSize3Stride1Test) |
| 243 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride1Uint8, L2Pooling2dSize3Stride1Uint8Test) |
| 244 | ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride3, L2Pooling2dSize3Stride3Test) |
| 245 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride3Uint8, L2Pooling2dSize3Stride3Uint8Test) |
| 246 | ARMNN_AUTO_TEST_CASE(L2Pooling2dSize3Stride4, L2Pooling2dSize3Stride4Test) |
| 247 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize3Stride4Uint8, L2Pooling2dSize3Stride4Uint8Test) |
| 248 | ARMNN_AUTO_TEST_CASE(L2Pooling2dSize7, L2Pooling2dSize7Test) |
| 249 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize7Uint8, L2Pooling2dSize7Uint8Test) |
| 250 | ARMNN_AUTO_TEST_CASE(L2Pooling2dSize9, L2Pooling2dSize9Test) |
| 251 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_L2Pooling2dSize9Uint8, L2Pooling2dSize9Uint8Test) |
| 252 | |
| 253 | // Ignore padding values for pooling but count padding fields into the divisor |
| 254 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2d, IgnorePaddingSimpleMaxPooling2dTest) |
| 255 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleMaxPooling2dUint8, IgnorePaddingSimpleMaxPooling2dUint8Test) |
| 256 | ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3, IgnorePaddingMaxPooling2dSize3Test) |
| 257 | ARMNN_AUTO_TEST_CASE(IgnorePaddingMaxPooling2dSize3Uint8, IgnorePaddingMaxPooling2dSize3Uint8Test) |
| 258 | |
| 259 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2d, IgnorePaddingSimpleAveragePooling2dTest) |
| 260 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dUint8, IgnorePaddingSimpleAveragePooling2dUint8Test) |
| 261 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPadding, IgnorePaddingSimpleAveragePooling2dNoPaddingTest) |
| 262 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleAveragePooling2dNoPaddingUint8, |
| 263 | IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test) |
| 264 | ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3, IgnorePaddingAveragePooling2dSize3Test) |
| 265 | ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3Uint8, IgnorePaddingAveragePooling2dSize3Uint8Test) |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 266 | ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2, |
| 267 | IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, false) |
| 268 | ARMNN_AUTO_TEST_CASE(IgnorePaddingAveragePooling2dSize3x2Stride2x2NoPadding, |
| 269 | IgnorePaddingAveragePooling2dSize3x2Stride2x2Test, |
| 270 | true) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 271 | |
| 272 | ARMNN_AUTO_TEST_CASE(IgnorePaddingSimpleL2Pooling2d, IgnorePaddingSimpleL2Pooling2dTest) |
| 273 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingSimpleL2Pooling2dUint8, IgnorePaddingSimpleL2Pooling2dUint8Test) |
| 274 | ARMNN_AUTO_TEST_CASE(IgnorePaddingL2Pooling2dSize3, IgnorePaddingL2Pooling2dSize3Test) |
| 275 | ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddingL2Pooling2dSize3Uint8Test) |
| 276 | |
| 277 | // Activation |
| 278 | ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest) |
| 279 | |
Narumol Prangnawarat | 65d3096 | 2019-03-14 11:55:03 +0000 | [diff] [blame] | 280 | // ReLu |
| 281 | ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest) |
| 282 | ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest) |
| 283 | |
Narumol Prangnawarat | b98bbcf | 2019-04-15 14:14:27 +0100 | [diff] [blame] | 284 | // Sigmoid |
| 285 | ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest) |
| 286 | ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test) |
| 287 | |
Narumol Prangnawarat | 65d3096 | 2019-03-14 11:55:03 +0000 | [diff] [blame] | 288 | // Softmax |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 289 | ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f) |
| 290 | ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 291 | ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1Uint8, SimpleSoftmaxUint8Test, 1.0f) |
| 292 | ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f) |
| 293 | |
Narumol Prangnawarat | 65d3096 | 2019-03-14 11:55:03 +0000 | [diff] [blame] | 294 | ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1, Simple3dSoftmaxTest, 1.0f) |
| 295 | ARMNN_AUTO_TEST_CASE(Simple3dSoftmaxBeta1Uint8, Simple3dSoftmaxUint8Test, 1.0f) |
| 296 | |
| 297 | ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1, Simple4dSoftmaxTest, 1.0f) |
| 298 | ARMNN_AUTO_TEST_CASE(Simple4dSoftmaxBeta1Uint8, Simple4dSoftmaxUint8Test, 1.0f) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 299 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 300 | // Splitter |
| 301 | ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest) |
| 302 | ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 303 | |
| 304 | ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest) |
| 305 | ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test) |
| 306 | |
| 307 | // Merger |
| 308 | ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest) |
| 309 | ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test) |
| 310 | |
| 311 | // Fully Connected |
| 312 | ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false) |
| 313 | ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithBias, FullyConnectedFloat32Test, true, false) |
| 314 | ARMNN_AUTO_TEST_CASE(SimpleFullyConnectedWithTranspose, FullyConnectedFloat32Test, false, true) |
| 315 | ARMNN_AUTO_TEST_CASE(FullyConnectedLarge, FullyConnectedLargeTest, false) |
| 316 | ARMNN_AUTO_TEST_CASE(FullyConnectedLargeTransposed, FullyConnectedLargeTest, true) |
kevmay01 | e448be3 | 2018-09-26 10:21:55 +0100 | [diff] [blame] | 317 | ARMNN_AUTO_TEST_CASE(FullyConnectedUint8, FullyConnectedUint8Test, false) |
| 318 | ARMNN_AUTO_TEST_CASE(FullyConnectedBiasedUint8, FullyConnectedUint8Test, true) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 319 | |
| 320 | // Add |
| 321 | ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest) |
David Beck | bc39245 | 2018-09-10 14:47:28 +0100 | [diff] [blame] | 322 | ARMNN_AUTO_TEST_CASE(AddBroadcast, AdditionBroadcastTest) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 323 | ARMNN_AUTO_TEST_CASE(AddBroadcast1Element, AdditionBroadcast1ElementTest) |
| 324 | |
David Beck | bc39245 | 2018-09-10 14:47:28 +0100 | [diff] [blame] | 325 | // Sub |
| 326 | ARMNN_AUTO_TEST_CASE(SimpleSub, SubtractionTest) |
Mohamed Nour Abouelseoud | 3d93bc4 | 2018-11-21 10:35:17 +0000 | [diff] [blame] | 327 | ARMNN_AUTO_TEST_CASE(SubBroadcast1Element, SubtractionBroadcast1ElementTest) |
| 328 | ARMNN_AUTO_TEST_CASE(SubBroadcast, SubtractionBroadcastTest) |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 329 | ARMNN_AUTO_TEST_CASE(SubtractionUint8, SubtractionUint8Test) |
| 330 | ARMNN_AUTO_TEST_CASE(SubBroadcastUint8, SubtractionBroadcastUint8Test) |
| 331 | ARMNN_AUTO_TEST_CASE(SubBroadcast1ElementUint8, SubtractionBroadcast1ElementUint8Test) |
David Beck | bc39245 | 2018-09-10 14:47:28 +0100 | [diff] [blame] | 332 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 333 | // Mul |
| 334 | ARMNN_AUTO_TEST_CASE(SimpleMultiplication, MultiplicationTest) |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 335 | ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1Element, MultiplicationBroadcast1ElementTest) |
| 336 | ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVector, MultiplicationBroadcast1DVectorTest) |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 337 | ARMNN_AUTO_TEST_CASE(MultiplicationUint8, MultiplicationUint8Test) |
| 338 | ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1ElementUint8, MultiplicationBroadcast1ElementUint8Test) |
| 339 | ARMNN_AUTO_TEST_CASE(MultiplicationBroadcast1DVectorUint8, MultiplicationBroadcast1DVectorUint8Test) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 340 | |
| 341 | // Batch Norm |
| 342 | ARMNN_AUTO_TEST_CASE(BatchNorm, BatchNormTest) |
Nikhil Raj | d134093 | 2018-10-18 14:27:50 +0100 | [diff] [blame] | 343 | ARMNN_AUTO_TEST_CASE(BatchNormNhwc, BatchNormNhwcTest) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 344 | |
| 345 | // Constant |
| 346 | ARMNN_AUTO_TEST_CASE(Constant, ConstantTest) |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame^] | 347 | ARMNN_AUTO_TEST_CASE(ConstantUint8, ConstantUint8SimpleQuantizationScaleNoOffsetTest) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 348 | |
| 349 | // Concatenation |
| 350 | ARMNN_AUTO_TEST_CASE(Concatenation1d, Concatenation1dTest) |
| 351 | ARMNN_AUTO_TEST_CASE(Concatenation1dUint8, Concatenation1dUint8Test) |
| 352 | |
| 353 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim0, Concatenation2dDim0Test) |
| 354 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim0Uint8, Concatenation2dDim0Uint8Test) |
| 355 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim1, Concatenation2dDim1Test) |
| 356 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim1Uint8, Concatenation2dDim1Uint8Test) |
| 357 | |
| 358 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDims, Concatenation2dDim0DiffInputDimsTest) |
| 359 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim0DiffInputDimsUint8, Concatenation2dDim0DiffInputDimsUint8Test) |
| 360 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDims, Concatenation2dDim1DiffInputDimsTest) |
| 361 | ARMNN_AUTO_TEST_CASE(Concatenation2dDim1DiffInputDimsUint8, Concatenation2dDim1DiffInputDimsUint8Test) |
| 362 | |
| 363 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim0, Concatenation3dDim0Test) |
| 364 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim0Uint8, Concatenation3dDim0Uint8Test) |
| 365 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim1, Concatenation3dDim1Test) |
| 366 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim1Uint8, Concatenation3dDim1Uint8Test) |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 367 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim2, Concatenation3dDim2Test, false) |
| 368 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim2Uint8, Concatenation3dDim2Uint8Test, false) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 369 | |
| 370 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDims, Concatenation3dDim0DiffInputDimsTest) |
| 371 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim0DiffInputDimsUint8, Concatenation3dDim0DiffInputDimsUint8Test) |
| 372 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDims, Concatenation3dDim1DiffInputDimsTest) |
| 373 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim1DiffInputDimsUint8, Concatenation3dDim1DiffInputDimsUint8Test) |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 374 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDims, Concatenation3dDim2DiffInputDimsTest, false) |
| 375 | ARMNN_AUTO_TEST_CASE(Concatenation3dDim2DiffInputDimsUint8, Concatenation3dDim2DiffInputDimsUint8Test, false) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 376 | |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 377 | ARMNN_AUTO_TEST_CASE(Concatenation4dDim0, Concatenation4dDim0Test) |
| 378 | ARMNN_AUTO_TEST_CASE(Concatenation4dDim1, Concatenation4dDim1Test) |
| 379 | ARMNN_AUTO_TEST_CASE(Concatenation4dDim3, Concatenation4dDim3Test, false) |
| 380 | ARMNN_AUTO_TEST_CASE(Concatenation4dDim0Uint8, Concatenation4dDim0Uint8Test) |
| 381 | ARMNN_AUTO_TEST_CASE(Concatenation4dDim1Uint8, Concatenation4dDim1Uint8Test) |
| 382 | ARMNN_AUTO_TEST_CASE(Concatenation4dDim3Uint8, Concatenation4dDim3Uint8Test, false) |
| 383 | |
| 384 | ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0, Concatenation4dDiffShapeDim0Test) |
| 385 | ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1, Concatenation4dDiffShapeDim1Test) |
| 386 | ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3, Concatenation4dDiffShapeDim3Test, false) |
| 387 | ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim0Uint8, Concatenation4dDiffShapeDim0Uint8Test) |
| 388 | ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim1Uint8, Concatenation4dDiffShapeDim1Uint8Test) |
| 389 | ARMNN_AUTO_TEST_CASE(Concatenation4dDiffShapeDim3Uint8, Concatenation4dDiffShapeDim3Uint8Test, false) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 390 | // L2 Normalization |
jimfly01 | 3aab7c3 | 2018-11-12 13:32:08 +0000 | [diff] [blame] | 391 | ARMNN_AUTO_TEST_CASE(L2Normalization1d, L2Normalization1dTest, armnn::DataLayout::NCHW) |
| 392 | ARMNN_AUTO_TEST_CASE(L2Normalization2d, L2Normalization2dTest, armnn::DataLayout::NCHW) |
| 393 | ARMNN_AUTO_TEST_CASE(L2Normalization3d, L2Normalization3dTest, armnn::DataLayout::NCHW) |
| 394 | ARMNN_AUTO_TEST_CASE(L2Normalization4d, L2Normalization4dTest, armnn::DataLayout::NCHW) |
Matteo Martincigh | 539b44d | 2018-10-01 09:26:39 +0100 | [diff] [blame] | 395 | |
jimfly01 | 3aab7c3 | 2018-11-12 13:32:08 +0000 | [diff] [blame] | 396 | ARMNN_AUTO_TEST_CASE(L2Normalization1dNhwc, L2Normalization1dTest, armnn::DataLayout::NHWC) |
| 397 | ARMNN_AUTO_TEST_CASE(L2Normalization2dNhwc, L2Normalization2dTest, armnn::DataLayout::NHWC) |
| 398 | ARMNN_AUTO_TEST_CASE(L2Normalization3dNhwc, L2Normalization3dTest, armnn::DataLayout::NHWC) |
| 399 | ARMNN_AUTO_TEST_CASE(L2Normalization4dNhwc, L2Normalization4dTest, armnn::DataLayout::NHWC) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 400 | |
| 401 | // Floor |
| 402 | ARMNN_AUTO_TEST_CASE(SimpleFloor, SimpleFloorTest) |
| 403 | |
kevmay01 | eed8592 | 2019-01-28 08:37:25 +0000 | [diff] [blame] | 404 | // Greater |
| 405 | ARMNN_AUTO_TEST_CASE(SimpleGreater, GreaterSimpleTest) |
| 406 | ARMNN_AUTO_TEST_CASE(GreaterBroadcast1Element, GreaterBroadcast1ElementTest) |
| 407 | ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVector, GreaterBroadcast1DVectorTest) |
| 408 | ARMNN_AUTO_TEST_CASE(GreaterUint8, GreaterUint8Test) |
| 409 | ARMNN_AUTO_TEST_CASE(GreaterBroadcast1ElementUint8, GreaterBroadcast1ElementUint8Test) |
| 410 | ARMNN_AUTO_TEST_CASE(GreaterBroadcast1DVectorUint8, GreaterBroadcast1DVectorUint8Test) |
| 411 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 412 | // Reshape |
| 413 | ARMNN_AUTO_TEST_CASE(SimpleReshapeFloat32, SimpleReshapeFloat32Test) |
| 414 | ARMNN_AUTO_TEST_CASE(SimpleReshapeUint8, SimpleReshapeUint8Test) |
| 415 | |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 416 | // Pad |
| 417 | ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest) |
| 418 | ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest) |
| 419 | ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest) |
| 420 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 421 | // Permute |
| 422 | ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteFloat32Test) |
| 423 | ARMNN_AUTO_TEST_CASE(SimplePermuteUint8, SimplePermuteUint8Test) |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 424 | ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet1, PermuteFloat32ValueSet1Test) |
| 425 | ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet2, PermuteFloat32ValueSet2Test) |
| 426 | ARMNN_AUTO_TEST_CASE(PermuteFloat32ValueSet3, PermuteFloat32ValueSet3Test) |
| 427 | |
Les Bell | de9011b | 2018-10-03 10:37:52 +0100 | [diff] [blame] | 428 | // Lstm |
| 429 | ARMNN_AUTO_TEST_CASE(LstmLayerFloat32WithCifgWithPeepholeNoProjection, |
| 430 | LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest) |
| 431 | ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgNoPeepholeNoProjection, |
| 432 | LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest) |
| 433 | ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection, |
| 434 | LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest) |
| 435 | |
Matthew Bentham | fd89996 | 2018-12-31 15:49:42 +0000 | [diff] [blame] | 436 | // Mean |
| 437 | ARMNN_AUTO_TEST_CASE(MeanUint8Simple, MeanUint8SimpleTest) |
| 438 | ARMNN_AUTO_TEST_CASE(MeanUint8SimpleAxis, MeanUint8SimpleAxisTest) |
| 439 | ARMNN_AUTO_TEST_CASE(MeanUint8KeepDims, MeanUint8KeepDimsTest) |
| 440 | ARMNN_AUTO_TEST_CASE(MeanUint8MultipleDims, MeanUint8MultipleDimsTest) |
| 441 | ARMNN_AUTO_TEST_CASE(MeanVtsUint8, MeanVtsUint8Test) |
| 442 | |
| 443 | ARMNN_AUTO_TEST_CASE(MeanFloatSimple, MeanFloatSimpleTest) |
| 444 | ARMNN_AUTO_TEST_CASE(MeanFloatSimpleAxis, MeanFloatSimpleAxisTest) |
| 445 | ARMNN_AUTO_TEST_CASE(MeanFloatKeepDims, MeanFloatKeepDimsTest) |
| 446 | ARMNN_AUTO_TEST_CASE(MeanFloatMultipleDims, MeanFloatMultipleDimsTest) |
| 447 | ARMNN_AUTO_TEST_CASE(MeanVtsFloat1, MeanVtsFloat1Test) |
| 448 | ARMNN_AUTO_TEST_CASE(MeanVtsFloat2, MeanVtsFloat2Test) |
| 449 | ARMNN_AUTO_TEST_CASE(MeanVtsFloat3, MeanVtsFloat3Test) |
| 450 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 451 | // Max |
| 452 | ARMNN_AUTO_TEST_CASE(SimpleMaximum, MaximumSimpleTest) |
| 453 | ARMNN_AUTO_TEST_CASE(MaximumBroadcast1Element, MaximumBroadcast1ElementTest) |
| 454 | ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVector, MaximumBroadcast1DVectorTest) |
| 455 | ARMNN_AUTO_TEST_CASE(MaximumUint8, MaximumUint8Test) |
| 456 | ARMNN_AUTO_TEST_CASE(MaximumBroadcast1ElementUint8, MaximumBroadcast1ElementUint8Test) |
| 457 | ARMNN_AUTO_TEST_CASE(MaximumBroadcast1DVectorUint8, MaximumBroadcast1DVectorUint8Test) |
| 458 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 459 | // Min |
| 460 | ARMNN_AUTO_TEST_CASE(SimpleMinimum1, MinimumBroadcast1ElementTest1) |
| 461 | ARMNN_AUTO_TEST_CASE(SimpleMinimum2, MinimumBroadcast1ElementTest2) |
| 462 | ARMNN_AUTO_TEST_CASE(Minimum1DVectorUint8, MinimumBroadcast1DVectorUint8Test) |
| 463 | |
narpra01 | 55a97bc | 2018-10-02 14:35:53 +0100 | [diff] [blame] | 464 | // Normalization |
| 465 | ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest) |
| 466 | ARMNN_AUTO_TEST_CASE(SimpleNormalizationWithin, SimpleNormalizationWithinTest) |
| 467 | ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcrossNhwc, SimpleNormalizationAcrossNhwcTest) |
| 468 | |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 469 | // Resize Bilinear - NCHW data layout |
| 470 | ARMNN_AUTO_TEST_CASE(ResizeBilinearNop, ResizeBilinearNopTest, armnn::DataLayout::NCHW) |
| 471 | ARMNN_AUTO_TEST_CASE(SimpleResizeBilinear, SimpleResizeBilinearTest, armnn::DataLayout::NCHW) |
| 472 | ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMin, ResizeBilinearSqMinTest, armnn::DataLayout::NCHW) |
| 473 | ARMNN_AUTO_TEST_CASE(ResizeBilinearMin, ResizeBilinearMinTest, armnn::DataLayout::NCHW) |
| 474 | ARMNN_AUTO_TEST_CASE(ResizeBilinearMag, ResizeBilinearMagTest, armnn::DataLayout::NCHW) |
| 475 | |
Conor Kennedy | dc1c082 | 2019-02-01 07:23:17 +0000 | [diff] [blame] | 476 | ARMNN_AUTO_TEST_CASE(ResizeBilinearNopUint8, ResizeBilinearNopUint8Test) |
| 477 | ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearUint8, SimpleResizeBilinearUint8Test) |
| 478 | ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinUint8, ResizeBilinearSqMinUint8Test) |
| 479 | ARMNN_AUTO_TEST_CASE(ResizeBilinearMinUint8, ResizeBilinearMinUint8Test) |
| 480 | ARMNN_AUTO_TEST_CASE(ResizeBilinearMagUint8, ResizeBilinearMagUint8Test) |
| 481 | |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 482 | // Resize Bilinear - NHWC data layout |
| 483 | ARMNN_AUTO_TEST_CASE(ResizeBilinearNopNhwc, ResizeBilinearNopTest, armnn::DataLayout::NHWC) |
| 484 | ARMNN_AUTO_TEST_CASE(SimpleResizeBilinearNhwc, SimpleResizeBilinearTest, armnn::DataLayout::NHWC) |
| 485 | ARMNN_AUTO_TEST_CASE(ResizeBilinearSqMinNhwc, ResizeBilinearSqMinTest, armnn::DataLayout::NHWC) |
| 486 | ARMNN_AUTO_TEST_CASE(ResizeBilinearMinNhwc, ResizeBilinearMinTest, armnn::DataLayout::NHWC) |
| 487 | ARMNN_AUTO_TEST_CASE(ResizeBilinearMagNhwc, ResizeBilinearMagTest, armnn::DataLayout::NHWC) |
| 488 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 489 | // ============================================================================ |
| 490 | // COMPARE tests |
| 491 | |
| 492 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareConv2dWithReference, CompareConvolution2dTest) |
| 493 | |
jimfly01 | 7af00da | 2018-10-31 14:43:53 +0000 | [diff] [blame] | 494 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32, |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 495 | CompareDepthwiseConvolution2dFloatTest, |
jimfly01 | 7af00da | 2018-10-31 14:43:53 +0000 | [diff] [blame] | 496 | armnn::DataLayout::NCHW) |
| 497 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8, |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 498 | CompareDepthwiseConvolution2dUint8Test, |
jimfly01 | 7af00da | 2018-10-31 14:43:53 +0000 | [diff] [blame] | 499 | armnn::DataLayout::NCHW) |
| 500 | |
| 501 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceFloat32Nhwc, |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 502 | CompareDepthwiseConvolution2dFloatTest, |
jimfly01 | 7af00da | 2018-10-31 14:43:53 +0000 | [diff] [blame] | 503 | armnn::DataLayout::NHWC) |
| 504 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareDepthwiseConv2dWithReferenceUint8Nhwc, |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 505 | CompareDepthwiseConvolution2dUint8Test, |
jimfly01 | 7af00da | 2018-10-31 14:43:53 +0000 | [diff] [blame] | 506 | armnn::DataLayout::NHWC) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 507 | |
| 508 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationWithinWithReference, CompareNormalizationTest, |
| 509 | armnn::NormalizationAlgorithmChannel::Within, |
| 510 | armnn::NormalizationAlgorithmMethod::LocalBrightness) |
| 511 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareNormalizationAcrossWithReference, CompareNormalizationTest, |
| 512 | armnn::NormalizationAlgorithmChannel::Across, |
| 513 | armnn::NormalizationAlgorithmMethod::LocalBrightness) |
| 514 | |
| 515 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::Max) |
| 516 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMaxPooling2dWithReferenceUint8, ComparePooling2dUint8Test, |
| 517 | armnn::PoolingAlgorithm::Max) |
| 518 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReference, ComparePooling2dTest, |
| 519 | armnn::PoolingAlgorithm::Average) |
| 520 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAveragePooling2dWithReferenceUint8, ComparePooling2dUint8Test, |
| 521 | armnn::PoolingAlgorithm::Average) |
| 522 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareL2Pooling2dWithReference, ComparePooling2dTest, armnn::PoolingAlgorithm::L2) |
| 523 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(UNSUPPORTED_CompareL2Pooling2dWithReferenceUint8, ComparePooling2dUint8Test, |
| 524 | armnn::PoolingAlgorithm::L2) |
| 525 | |
| 526 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta1WithReference, CompareSoftmaxTest, 1.0f) |
| 527 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxBeta2WithReference, CompareSoftmaxTest, 2.0f) |
| 528 | |
| 529 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta1WithReference, CompareSoftmaxUint8Test, 1.0f) |
| 530 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareSoftmaxUint8Beta2WithReference, CompareSoftmaxUint8Test, 2.0f) |
| 531 | |
| 532 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareAddition, CompareAdditionTest) |
| 533 | |
| 534 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMultiplicationTest) |
| 535 | |
| 536 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest) |
| 537 | |
| 538 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f) |
| 539 | ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f) |
| 540 | |
| 541 | // ============================================================================ |
| 542 | // FIXTURE tests |
| 543 | |
| 544 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSigmoidActivationWithReference, ActivationFixture, |
| 545 | CompareActivationTest, armnn::ActivationFunction::Sigmoid, 5u) |
| 546 | |
| 547 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareTanhActivationWithReference, ActivationFixture, |
| 548 | CompareActivationTest, armnn::ActivationFunction::TanH, 5u) |
| 549 | |
| 550 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLinearActivationWithReference, ActivationFixture, |
| 551 | CompareActivationTest, armnn::ActivationFunction::Linear, 5u) |
| 552 | |
| 553 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareReLuActivationWithReference, ActivationFixture, |
| 554 | CompareActivationTest, armnn::ActivationFunction::ReLu, 5u) |
| 555 | |
| 556 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReference, ActivationFixture, |
| 557 | CompareActivationTest, armnn::ActivationFunction::BoundedReLu, 5u) |
| 558 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareBoundedReLuActivationWithReferenceUint8, ActivationFixture, |
| 559 | CompareActivationUint8Test, armnn::ActivationFunction::BoundedReLu) |
| 560 | |
| 561 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSoftReLuActivationWithReference, ActivationFixture, |
| 562 | CompareActivationTest, armnn::ActivationFunction::SoftReLu, 1u) |
| 563 | |
| 564 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareLeakyReLuActivationWithReference, ActivationFixture, |
| 565 | CompareActivationTest, armnn::ActivationFunction::LeakyReLu, 5u) |
| 566 | |
| 567 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareAbsActivationWithReference, ActivationFixture, |
| 568 | CompareActivationTest, armnn::ActivationFunction::Abs, 5u) |
| 569 | |
| 570 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, PositiveActivationFixture, |
| 571 | CompareActivationTest, armnn::ActivationFunction::Sqrt, 5u) |
| 572 | |
| 573 | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture, |
| 574 | CompareActivationTest, armnn::ActivationFunction::Square, 5u) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 575 | BOOST_AUTO_TEST_SUITE_END() |