blob: feb401eff2560efec550e3da88516b056cd7236a [file] [log] [blame]
Georgios Pinitasf92cb232018-03-29 11:51:54 +01001/*
2 * Copyright (c) 2018 ARM Limited.
3 *
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/GLES_COMPUTE/GCTensor.h"
27#include "arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h"
28#include "arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h"
29#include "tests/GLES_COMPUTE/GCAccessor.h"
30#include "tests/benchmark/fixtures/ActivationLayerFixture.h"
31#include "tests/datasets/system_tests/alexnet/AlexNetActivationLayerDataset.h"
32#include "tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ActivationLayerDataset.h"
33#include "tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ActivationLayerDataset.h"
34#include "tests/datasets/system_tests/lenet5/LeNet5ActivationLayerDataset.h"
35#include "tests/datasets/system_tests/mobilenet/MobileNetActivationLayerDataset.h"
36#include "tests/datasets/system_tests/squeezenet/SqueezeNetActivationLayerDataset.h"
37#include "tests/datasets/system_tests/vgg/vgg16/VGG16ActivationLayerDataset.h"
38#include "tests/datasets/system_tests/yolo/v2/YOLOV2ActivationLayerDataset.h"
39#include "tests/framework/Macros.h"
40#include "tests/framework/datasets/Datasets.h"
41#include "utils/TypePrinter.h"
42
43namespace arm_compute
44{
45namespace test
46{
47namespace benchmark
48{
49namespace
50{
51const auto data_types = framework::dataset::make("DataType", { DataType::F16, DataType::F32 });
52const auto data_types_mobilenet = framework::dataset::make("DataType", { DataType::F16, DataType::F32 });
53} // namespace
54
55using GCActivationLayerFixture = ActivationLayerFixture<GCTensor, GCActivationLayer, GCAccessor>;
56
57TEST_SUITE(GC)
58
59REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
60 framework::dataset::combine(framework::dataset::combine(datasets::AlexNetActivationLayerDataset(),
61 data_types),
62 framework::dataset::make("Batches", 1)));
63
64REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
65 framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ActivationLayerDataset(),
66 data_types),
67 framework::dataset::make("Batches", 1)));
68
69REGISTER_FIXTURE_DATA_TEST_CASE(MobileNetActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
70 framework::dataset::combine(framework::dataset::combine(datasets::MobileNetActivationLayerDataset(),
71 data_types_mobilenet),
72 framework::dataset::make("Batches", 1)));
73
74REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
75 framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1ActivationLayerDataset(),
76 data_types),
77 framework::dataset::make("Batches", 1)));
78
79REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
80 framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4ActivationLayerDataset(),
81 data_types),
82 framework::dataset::make("Batches", 1)));
83
84REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
85 framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetActivationLayerDataset(),
86 data_types),
87 framework::dataset::make("Batches", 1)));
88
89REGISTER_FIXTURE_DATA_TEST_CASE(VGG16ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
90 framework::dataset::combine(framework::dataset::combine(datasets::VGG16ActivationLayerDataset(),
91 data_types),
92 framework::dataset::make("Batches", 1)));
93
94REGISTER_FIXTURE_DATA_TEST_CASE(YOLOV2ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::ALL,
95 framework::dataset::combine(framework::dataset::combine(datasets::YOLOV2ActivationLayerDataset(),
96 data_types),
97 framework::dataset::make("Batches", 1)));
98
99TEST_SUITE(NIGHTLY)
100REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
101 framework::dataset::combine(framework::dataset::combine(datasets::AlexNetActivationLayerDataset(),
102 data_types),
103 framework::dataset::make("Batches", { 4, 8 })));
104
105REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
106 framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ActivationLayerDataset(),
107 data_types),
108 framework::dataset::make("Batches", { 4, 8 })));
109
110REGISTER_FIXTURE_DATA_TEST_CASE(MobileNetActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
111 framework::dataset::combine(framework::dataset::combine(datasets::MobileNetActivationLayerDataset(),
112 data_types_mobilenet),
113 framework::dataset::make("Batches", { 4, 8 })));
114
115REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
116 framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1ActivationLayerDataset(),
117 data_types),
118 framework::dataset::make("Batches", { 4, 8 })));
119
120REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
121 framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4ActivationLayerDataset(),
122 data_types),
123 framework::dataset::make("Batches", { 4, 8 })));
124
125REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
126 framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetActivationLayerDataset(),
127 data_types),
128 framework::dataset::make("Batches", { 4, 8 })));
129
130REGISTER_FIXTURE_DATA_TEST_CASE(VGG16ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
131 framework::dataset::combine(framework::dataset::combine(datasets::VGG16ActivationLayerDataset(),
132 data_types),
133 framework::dataset::make("Batches", { 4, 8 })));
134
135REGISTER_FIXTURE_DATA_TEST_CASE(YOLOV2ActivationLayer, GCActivationLayerFixture, framework::DatasetMode::NIGHTLY,
136 framework::dataset::combine(framework::dataset::combine(datasets::YOLOV2ActivationLayerDataset(),
137 data_types),
138 framework::dataset::make("Batches", { 4, 8 })));
139TEST_SUITE_END()
140TEST_SUITE_END()
141} // namespace benchmark
142} // namespace test
143} // namespace arm_compute