blob: b86dae10fd37eaf9c98bab704e540b3854657511 [file] [log] [blame]
Kurtis Charnock9afc41a2019-11-11 17:24:37 +00001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2019 Arm Limited.
Kurtis Charnock9afc41a2019-11-11 17:24:37 +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/runtime/CL/functions/CLFill.h"
25#include "tests/CL/CLAccessor.h"
26#include "tests/Globals.h"
27#include "tests/datasets/ShapeDatasets.h"
28#include "tests/framework/Macros.h"
29#include "tests/framework/datasets/Datasets.h"
30#include "tests/framework/datasets/Datasets.h"
31#include "tests/validation/Validation.h"
32#include "tests/validation/fixtures/FillFixture.h"
33#include <cstdint>
34
35namespace arm_compute
36{
37namespace test
38{
39namespace validation
40{
41TEST_SUITE(CL)
42TEST_SUITE(Fill)
43
44template <typename T>
45using CLFillFixture = FillFixture<CLTensor, CLAccessor, CLFill, T>;
46
47TEST_SUITE(U8)
48FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<uint8_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)))
49{
50 // Validate output
51 validate(CLAccessor(_target), _reference);
52}
53TEST_SUITE_END() // U8
54
55TEST_SUITE(S8)
56FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<int8_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S8)))
57{
58 // Validate output
59 validate(CLAccessor(_target), _reference);
60}
61TEST_SUITE_END() // S8
62
63TEST_SUITE(QASYMM8)
64FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<uint8_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8)))
65{
66 // Validate output
67 validate(CLAccessor(_target), _reference);
68}
69TEST_SUITE_END() // QASYMM8
70
71TEST_SUITE(U16)
72FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<uint16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U16)))
73{
74 // Validate output
75 validate(CLAccessor(_target), _reference);
76}
77TEST_SUITE_END() // U16
78
79TEST_SUITE(S16)
80FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<int16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S16)))
81{
82 // Validate output
83 validate(CLAccessor(_target), _reference);
84}
85TEST_SUITE_END() // S16
86
87TEST_SUITE(F16)
88FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<half>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
89{
90 // Validate output
91 validate(CLAccessor(_target), _reference);
92}
93TEST_SUITE_END() // F16
94
95TEST_SUITE(U32)
96FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<uint32_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U32)))
97{
98 // Validate output
99 validate(CLAccessor(_target), _reference);
100}
101TEST_SUITE_END() // U32
102
103TEST_SUITE(S32)
104FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<int32_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S32)))
105{
106 // Validate output
107 validate(CLAccessor(_target), _reference);
108}
109TEST_SUITE_END() // S32
110
111TEST_SUITE(F32)
112FIXTURE_DATA_TEST_CASE(RunSmall, CLFillFixture<float>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
113{
114 // Validate output
115 validate(CLAccessor(_target), _reference);
116}
117TEST_SUITE_END() // F32
118
119TEST_SUITE_END() // Fill
120TEST_SUITE_END() // CL
121} // namespace validation
122} // namespace test
123} // namespace arm_compute