Compute Library
 22.11
Fill.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2021 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  */
25 #include "tests/Globals.h"
26 #include "tests/NEON/Accessor.h"
27 #include "tests/datasets/ShapeDatasets.h"
28 #include "tests/framework/Macros.h"
32 #include "tests/validation/fixtures/FillFixture.h"
33 #include <cstdint>
34 
35 namespace arm_compute
36 {
37 namespace test
38 {
39 namespace validation
40 {
41 TEST_SUITE(NEON)
42 TEST_SUITE(Fill)
43 
44 template <typename T>
45 using NEFillFixture = FillFixture<Tensor, Accessor, NEFill, T>;
46 
47 TEST_SUITE(U8)
48 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<uint8_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)))
49 {
50  // Validate output
51  validate(Accessor(_target), _reference);
52 }
53 TEST_SUITE_END() // U8
54 
56 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<int8_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S8)))
57 {
58  // Validate output
59  validate(Accessor(_target), _reference);
60 }
61 TEST_SUITE_END() // S8
62 
64 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<uint8_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8)))
65 {
66  // Validate output
67  validate(Accessor(_target), _reference);
68 }
69 TEST_SUITE_END() // QASYMM8
70 
72 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<uint16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U16)))
73 {
74  // Validate output
75  validate(Accessor(_target), _reference);
76 }
77 TEST_SUITE_END() // U16
78 
80 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<int16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S16)))
81 {
82  // Validate output
83  validate(Accessor(_target), _reference);
84 }
85 TEST_SUITE_END() // S16
86 
88 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<half>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
89 {
90  // Validate output
91  validate(Accessor(_target), _reference);
92 }
93 TEST_SUITE_END() // F16
94 
96 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<uint32_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U32)))
97 {
98  // Validate output
99  validate(Accessor(_target), _reference);
100 }
101 TEST_SUITE_END() // U32
102 
104 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<int32_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S32)))
105 {
106  // Validate output
107  validate(Accessor(_target), _reference);
108 }
109 TEST_SUITE_END() // S32
110 
112 FIXTURE_DATA_TEST_CASE(RunSmall, NEFillFixture<float>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
113 {
114  // Validate output
115  validate(Accessor(_target), _reference);
116 }
117 TEST_SUITE_END() // F32
118 
119 TEST_SUITE_END() // Fill
120 TEST_SUITE_END() // Neon
121 } // namespace validation
122 } // namespace test
123 } // namespace arm_compute
half_float::half half
16-bit floating point type
Definition: Types.h:48
1 channel, 1 F32 per channel
1 channel, 1 U16 per channel
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Copyright (c) 2017-2022 Arm Limited.
1 channel, 1 F16 per channel
1 channel, 1 S32 per channel
Accessor implementation for Tensor objects.
Definition: Accessor.h:35
DatasetMode
Possible dataset modes.
Definition: DatasetModes.h:40
1 channel, 1 U32 per channel
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
validate(CLAccessor(output_state), expected_output)
FillFixture< Tensor, Accessor, NEFill, T > NEFillFixture
Definition: Fill.cpp:45
1 channel, 1 S16 per channel
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
Definition: AbsLayer.cpp:50
TEST_SUITE(QASYMM8_to_F32) FIXTURE_DATA_TEST_CASE(RunSmall
DataType
Available data types.
Definition: Types.h:79
signed 8-bit number
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
Definition: AbsLayer.cpp:65