24.02.1
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
*/
24
#include "
arm_compute/runtime/NEON/functions/NEFill.h
"
25
#include "
tests/Globals.h
"
26
#include "
tests/NEON/Accessor.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
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
55
TEST_SUITE
(S8)
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
63
TEST_SUITE
(QASYMM8)
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
71
TEST_SUITE
(U16)
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
79
TEST_SUITE
(S16)
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
87
TEST_SUITE
(F16)
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
95
TEST_SUITE
(U32)
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
103
TEST_SUITE
(S32)
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
111
TEST_SUITE
(F32)
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
Datasets.h
arm_compute::test::validation::TEST_SUITE_END
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
Definition:
DequantizationLayer.cpp:111
arm_compute::test::validation::FIXTURE_DATA_TEST_CASE
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
Definition:
AbsLayer.cpp:50
arm_compute::test::validation::combine
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
Definition:
AbsLayer.cpp:65
arm_compute::test::Accessor
Accessor implementation for Tensor objects.
Definition:
Accessor.h:35
arm_compute::test::validation::TEST_SUITE
TEST_SUITE(QASYMM8_to_F32) FIXTURE_DATA_TEST_CASE(RunSmall
arm_compute::test::validation::validate
validate(CLAccessor(output_state), expected_output)
arm_compute::half
half_float::half half
16-bit floating point type
Definition:
CoreTypes.h:36
NEFill.h
Accessor.h
Macros.h
arm_compute::test::framework::dataset::make
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Definition:
ContainerDataset.h:160
Validation.h
Globals.h
arm_compute
Copyright (c) 2017-2024 Arm Limited.
Definition:
introduction.dox:24
arm_compute::test::validation::NEFillFixture
FillFixture< Tensor, Accessor, NEFill, T > NEFillFixture
Definition:
Fill.cpp:45
arm_compute::test::framework::DatasetMode
DatasetMode
Possible dataset modes.
Definition:
DatasetModes.h:40
arm_compute::DataType
DataType
Available data types.
Definition:
CoreTypes.h:83
tests
validation
NEON
Fill.cpp
Generated on Mon Mar 18 2024 11:32:05 for Compute Library by
1.8.17