blob: 0f21c27369b81225c832d8ce13c72f3284471368 [file] [log] [blame]
Pablo Tello6a14adb2019-03-05 17:33:08 +00001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2019 Arm Limited.
Pablo Tello6a14adb2019-03-05 17:33:08 +00003 *
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/Types.h"
25#include "arm_compute/runtime/CL/CLTensor.h"
26#include "arm_compute/runtime/CL/CLTensorAllocator.h"
27#include "arm_compute/runtime/CL/functions/CLConcatenateLayer.h"
28#include "tests/CL/CLAccessor.h"
29#include "tests/datasets/ShapeDatasets.h"
30#include "tests/framework/Asserts.h"
31#include "tests/framework/Macros.h"
32#include "tests/framework/datasets/Datasets.h"
33#include "tests/validation/Validation.h"
34
35#include "tests/validation/fixtures/ConcatenateLayerFixture.h"
36
37namespace arm_compute
38{
39namespace test
40{
41namespace validation
42{
43TEST_SUITE(CL)
44TEST_SUITE(HeightConcatenateLayer)
45
46template <typename T>
47using CLHeightConcatenateLayerFixture = ConcatenateLayerValidationFixture<CLTensor, ICLTensor, CLAccessor, CLConcatenateLayer, T>;
48
49TEST_SUITE(Float)
50TEST_SUITE(FP16)
51FIXTURE_DATA_TEST_CASE(RunSmall, CLHeightConcatenateLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(concat(datasets::Small2DShapes(), datasets::Tiny4DShapes()),
52 framework::dataset::make("DataType",
53 DataType::F16)),
54 framework::dataset::make("Axis", 1)))
55
56{
57 // Validate output
58 validate(CLAccessor(_target), _reference);
59}
60FIXTURE_DATA_TEST_CASE(RunLarge, CLHeightConcatenateLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(concat(datasets::Large2DShapes(), datasets::Small4DShapes()),
61 framework::dataset::make("DataType",
62 DataType::F16)),
63 framework::dataset::make("Axis", 1)))
64
65{
66 // Validate output
67 validate(CLAccessor(_target), _reference);
68}
69TEST_SUITE_END()
70
71TEST_SUITE(FP32)
72FIXTURE_DATA_TEST_CASE(RunSmall, CLHeightConcatenateLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(concat(datasets::Small2DShapes(), datasets::Tiny4DShapes()),
73 framework::dataset::make("DataType",
74 DataType::F32)),
75 framework::dataset::make("Axis", 1)))
76
77{
78 // Validate output
79 validate(CLAccessor(_target), _reference);
80}
81FIXTURE_DATA_TEST_CASE(RunLarge, CLHeightConcatenateLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::ConcatenateLayerShapes(), framework::dataset::make("DataType",
82 DataType::F32)),
83 framework::dataset::make("Axis", 1)))
84
85{
86 // Validate output
87 validate(CLAccessor(_target), _reference);
88}
89TEST_SUITE_END()
90TEST_SUITE_END()
91
92TEST_SUITE(Quantized)
93TEST_SUITE(QASYMM8)
94FIXTURE_DATA_TEST_CASE(RunSmall, CLHeightConcatenateLayerFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(concat(datasets::Small2DShapes(), datasets::Tiny4DShapes()),
95 framework::dataset::make("DataType",
96 DataType::QASYMM8)),
97 framework::dataset::make("Axis", 1)))
98
99{
100 // Validate output
101 validate(CLAccessor(_target), _reference);
102}
103FIXTURE_DATA_TEST_CASE(RunLarge, CLHeightConcatenateLayerFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::ConcatenateLayerShapes(), framework::dataset::make("DataType",
104 DataType::QASYMM8)),
105 framework::dataset::make("Axis", 1)))
106
107{
108 // Validate output
109 validate(CLAccessor(_target), _reference);
110}
111TEST_SUITE_END()
112TEST_SUITE_END()
113
114TEST_SUITE_END()
115TEST_SUITE_END()
116} // namespace validation
117} // namespace test
118} // namespace arm_compute