blob: 20828b77177d0cb1535d5027f12ac3a01021a2a2 [file] [log] [blame]
Moritz Pflanzeree493ae2017-07-05 10:52:21 +01001/*
Georgios Pinitas8be91482019-03-26 17:23:28 +00002 * Copyright (c) 2017-2019 ARM Limited.
Moritz Pflanzeree493ae2017-07-05 10:52:21 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#include "arm_compute/core/TensorShape.h"
25#include "arm_compute/core/Types.h"
26#include "arm_compute/runtime/CL/CLTensor.h"
27#include "arm_compute/runtime/CL/CLTensorAllocator.h"
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000028#include "arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h"
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010029#include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h"
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010030#include "tests/CL/CLAccessor.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010031#include "tests/benchmark/fixtures/ConvolutionLayerFixture.h"
Georgios Pinitas8be91482019-03-26 17:23:28 +000032#include "tests/benchmark/fixtures/FFTConvolutionLayerFixture.h"
Georgios Pinitas9fb11592018-04-26 20:34:58 +010033#include "tests/benchmark/fixtures/WinogradConvolutionLayerFixture.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010034#include "tests/datasets/system_tests/alexnet/AlexNetConvolutionLayerDataset.h"
35#include "tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ConvolutionLayerDataset.h"
36#include "tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ConvolutionLayerDataset.h"
37#include "tests/datasets/system_tests/lenet5/LeNet5ConvolutionLayerDataset.h"
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000038#include "tests/datasets/system_tests/mobilenet/MobileNetConvolutionLayerDataset.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010039#include "tests/datasets/system_tests/squeezenet/SqueezeNetConvolutionLayerDataset.h"
40#include "tests/datasets/system_tests/vgg/vgg16/VGG16ConvolutionLayerDataset.h"
41#include "tests/datasets/system_tests/yolo/v2/YOLOV2ConvolutionLayerDataset.h"
42#include "tests/framework/Macros.h"
43#include "tests/framework/datasets/Datasets.h"
Anthony Barbier2a07e182017-08-04 18:20:27 +010044#include "utils/TypePrinter.h"
Georgios Pinitas8be91482019-03-26 17:23:28 +000045#include <arm_compute/runtime/CL/functions/CLFFTConvolutionLayer.h>
46#include <tests/datasets/SmallConvolutionLayerDataset.h>
47#include <tests/datasets/system_tests/resnet12/ResNet12ConvolutionLayerDataset.h>
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010048
49namespace arm_compute
50{
51namespace test
52{
Michalis Spyrou724079d2017-12-15 11:37:37 +000053namespace benchmark
54{
SiCong Li1e5c1572017-07-27 17:58:52 +010055namespace
56{
Gian Marco Iodice1d2f2672018-07-10 13:15:34 +010057const auto data_types = framework::dataset::make("DataType", { DataType::F16, DataType::F32, DataType::QASYMM8 });
SiCong Li1e5c1572017-07-27 17:58:52 +010058} // namespace
59
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010060TEST_SUITE(CL)
61
Georgios Pinitas8be91482019-03-26 17:23:28 +000062using CLGEMMConvolutionLayerFixture = ConvolutionLayerFixture<CLTensor, CLGEMMConvolutionLayer, CLAccessor>;
63using CLWinogradLayerFixture = WinogradConvolutionLayerFixture<CLTensor, CLWinogradConvolutionLayer, CLAccessor>;
64using CLFFTConvolutionLayerFixture = FFTConvolutionLayerFixture<CLTensor, CLFFTConvolutionLayer, CLAccessor>;
65
66REGISTER_FIXTURE_DATA_TEST_CASE(ResNet12FFTLayer, CLFFTConvolutionLayerFixture, framework::DatasetMode::ALL,
67 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::ResNet12FFTConvolutionLayerDataset(),
68 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
69 framework::dataset::make("DataType", { DataType::F32 })),
70 framework::dataset::make("Batches", 1)));
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010071
72REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
73 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetWinogradLayerDataset(),
74 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010075 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010076 framework::dataset::make("Batches", 1)));
77
78REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
79 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1WinogradLayerDataset(),
80 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010081 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010082 framework::dataset::make("Batches", 1)));
83
84REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
85 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4WinogradLayerDataset(),
86 framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010087 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010088 framework::dataset::make("Batches", 1)));
89
90REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
91 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetWinogradLayerDataset(),
92 framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010093 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010094 framework::dataset::make("Batches", 1)));
95
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000096REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +000097 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
98 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +010099 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100100 framework::dataset::make("Batches", 1)));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100101
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000102REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000103 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
SiCong Li1e5c1572017-07-27 17:58:52 +0100104 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100105 framework::dataset::make("Batches", 1)));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100106
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000107REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000108 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
109 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100110 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100111 framework::dataset::make("Batches", 1)));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100112
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000113REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000114 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
115 ActivationLayerInfo())),
SiCong Lif583fb72017-08-15 15:09:18 +0100116 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100117 framework::dataset::make("Batches", 1)));
SiCong Lif583fb72017-08-15 15:09:18 +0100118
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000119REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000120 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
121 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100122 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100123 framework::dataset::make("Batches", 1)));
SiCong Li0aea8902017-07-21 18:24:36 +0100124
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000125REGISTER_FIXTURE_DATA_TEST_CASE(MobileNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000126 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::MobileNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
127 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000128 data_types),
129 framework::dataset::make("Batches", 1)));
130
SiCong Li1e5c1572017-07-27 17:58:52 +0100131TEST_SUITE(NIGHTLY)
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000132REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000133 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
134 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100135 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100136 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100137
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000138REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000139 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
SiCong Li1e5c1572017-07-27 17:58:52 +0100140 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100141 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100142
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000143REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000144 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
145 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100146 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100147 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100148
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000149REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000150 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
151 ActivationLayerInfo())),
SiCong Lif583fb72017-08-15 15:09:18 +0100152 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100153 framework::dataset::make("Batches", { 4, 8 })));
SiCong Lif583fb72017-08-15 15:09:18 +0100154
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000155REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000156 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
157 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100158 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100159 framework::dataset::make("Batches", { 4, 8 })));
160
Moritz Pflanzer351c20a2017-09-11 14:28:56 +0100161// 8 batches use about 1.8GB of memory which is too much for most devices!
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000162REGISTER_FIXTURE_DATA_TEST_CASE(VGG16ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000163 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::VGG16ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
164 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Licc65bbe2017-08-18 11:58:21 +0100165 data_types),
Moritz Pflanzer351c20a2017-09-11 14:28:56 +0100166 framework::dataset::make("Batches", { 1, 4 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100167
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000168REGISTER_FIXTURE_DATA_TEST_CASE(YOLOV2ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000169 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::YOLOV2ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
SiCong Li1e5c1572017-07-27 17:58:52 +0100170 data_types),
171 framework::dataset::make("Batches", { 1, 4, 8 })));
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100172
173REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
174 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetWinogradLayerDataset(),
175 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100176 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100177 framework::dataset::make("Batches", { 4, 8 })));
178
179REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
180 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1WinogradLayerDataset(),
181 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100182 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100183 framework::dataset::make("Batches", { 4, 8 })));
184
185REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
186 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4WinogradLayerDataset(),
187 framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100188 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100189 framework::dataset::make("Batches", { 4, 8 })));
190
191REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
192 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetWinogradLayerDataset(),
193 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100194 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100195 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100196TEST_SUITE_END()
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100197TEST_SUITE_END()
Michalis Spyrou724079d2017-12-15 11:37:37 +0000198} // namespace benchmark
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100199} // namespace test
200} // namespace arm_compute