blob: 19a41ee9d61c89be52af1282b4fd83c1023e9921 [file] [log] [blame]
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +01001/*
2 * Copyright (c) 2017 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/Types.h"
25#include "arm_compute/runtime/NEON/functions/NEDepthConcatenate.h"
26#include "arm_compute/runtime/Tensor.h"
27#include "arm_compute/runtime/TensorAllocator.h"
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +010028#include "tests/NEON/Accessor.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010029#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#include "tests/validation/fixtures/DepthConcatenateLayerFixture.h"
35#include "tests/validation/half.h"
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +010036
37namespace arm_compute
38{
39namespace test
40{
41namespace validation
42{
43TEST_SUITE(NEON)
44TEST_SUITE(DepthConcatenateLayer)
45
46//TODO(COMPMID-415): Add configuration test?
47
48template <typename T>
49using NEDepthConcatenateLayerFixture = DepthConcatenateValidationFixture<Tensor, Accessor, NEDepthConcatenate, T>;
50
51TEST_SUITE(Float)
52#ifdef ARM_COMPUTE_ENABLE_FP16
53TEST_SUITE(FP16)
54FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
55 DataType::F16)))
56{
57 // Validate output
58 validate(Accessor(_target), _reference);
59}
60FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
61 DataType::F16)))
62{
63 // Validate output
64 validate(Accessor(_target), _reference);
65}
66TEST_SUITE_END()
67#endif /* ARM_COMPUTE_ENABLE_FP16 */
68
69TEST_SUITE(FP32)
70FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
71 DataType::F32)))
72{
73 // Validate output
74 validate(Accessor(_target), _reference);
75}
76FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
77 DataType::F32)))
78{
79 // Validate output
80 validate(Accessor(_target), _reference);
81}
82TEST_SUITE_END()
83TEST_SUITE_END()
84
85TEST_SUITE(Quantized)
86TEST_SUITE(QS8)
87FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(),
88 framework::dataset::make("DataType",
89 DataType::QS8)))
90{
91 // Validate output
92 validate(Accessor(_target), _reference);
93}
94FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(),
95 framework::dataset::make("DataType",
96 DataType::QS8)))
97{
98 // Validate output
99 validate(Accessor(_target), _reference);
100}
101TEST_SUITE_END()
102
103TEST_SUITE(QS16)
104FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(),
105 framework::dataset::make("DataType",
106 DataType::QS16)))
107{
108 // Validate output
109 validate(Accessor(_target), _reference);
110}
111FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(),
112 framework::dataset::make("DataType",
113 DataType::QS16)))
114{
115 // Validate output
116 validate(Accessor(_target), _reference);
117}
118TEST_SUITE_END()
119TEST_SUITE_END()
120
121TEST_SUITE_END()
122TEST_SUITE_END()
123} // namespace validation
124} // namespace test
125} // namespace arm_compute