blob: 473d6429fbdbd82a9a745828628b2cf457025453 [file] [log] [blame]
Moritz Pflanzeree493ae2017-07-05 10:52:21 +01001/*
Georgios Pinitas51a67302018-01-17 12:55:26 +00002 * Copyright (c) 2017-2018 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/NEON/functions/NEGEMM.h"
27#include "arm_compute/runtime/Tensor.h"
28#include "arm_compute/runtime/TensorAllocator.h"
Pablo Tello39b4e4d2017-08-18 10:59:02 +010029#include "tests/NEON/Accessor.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010030#include "tests/benchmark/fixtures/GEMMFixture.h"
Moritz Pflanzer36db7f52017-09-23 09:55:34 +010031#include "tests/datasets/GoogleNetGEMMDataset.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010032#include "tests/datasets/MatrixMultiplyGEMMDataset.h"
33#include "tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1GEMMDataset.h"
34#include "tests/framework/Macros.h"
35#include "tests/framework/datasets/Datasets.h"
Anthony Barbier2a07e182017-08-04 18:20:27 +010036#include "utils/TypePrinter.h"
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010037
38namespace arm_compute
39{
40namespace test
41{
42namespace
43{
Moritz Pflanzerec69f932017-07-19 12:03:33 +010044const auto data_types = framework::dataset::make("DataType",
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010045{
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +000046#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010047 DataType::F16,
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +000048#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
Georgios Pinitas51a67302018-01-17 12:55:26 +000049 DataType::F32
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010050});
Gian Marco1aede362018-02-05 15:07:36 +000051const auto reshape_b_only_once = framework::dataset::make("ReshapeBOnlyOnce", { false, true });
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010052} // namespace
53
Pablo Tello39b4e4d2017-08-18 10:59:02 +010054using NEGEMMFixture = GEMMFixture<Tensor, NEGEMM, Accessor>;
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010055
56TEST_SUITE(NEON)
57
Gian Marco1aede362018-02-05 15:07:36 +000058REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1GEMM, NEGEMMFixture, framework::DatasetMode::ALL,
59 framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1GEMMDataset(),
60 data_types),
61 reshape_b_only_once));
62REGISTER_FIXTURE_DATA_TEST_CASE(MatrixMultiplyGEMM, NEGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::MatrixMultiplyGEMMDataset(),
63 data_types),
64 reshape_b_only_once));
65REGISTER_FIXTURE_DATA_TEST_CASE(GoogleNetGEMM, NEGEMMFixture, framework::DatasetMode::NIGHTLY, framework::dataset::combine(framework::dataset::combine(datasets::GoogleNetGEMMDataset(),
66 data_types),
67 reshape_b_only_once));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010068
69TEST_SUITE_END()
70} // namespace test
71} // namespace arm_compute