MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / TEST_SUITE

Function TEST_SUITE

tests/validation/NEON/Scale.cpp:97–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95TEST_SUITE(NEON)
96TEST_SUITE(Scale)
97TEST_SUITE(Validate)
98
99/** Validate test suite is to test ARM_COMPUTE_RETURN_ON_* macros
100 * we use to check the validity of given arguments in @ref NEScale
101 * Since this is using validate() of @ref NEScale, which pre-adjust
102 * arguments for the kernel, the following conditions in
103 * the kernel are not currently tested.
104 * - The same input and output
105 * - Data type of offset, dx and dy
106 * This suite also tests two different validate() APIs - one is
107 * using @ref ScaleKernelInfo and the other one is more verbose
108 * one calls the other one - in the same test case. Even though
109 * there are possibility that it makes debugging for regression
110 * harder, belows are reasons of this test case implementation.
111 * - The more verbose one is just a wrapper function calls
112 * the other one without any additional logic. So we are
113 * safe to merge two tests into one.
114 * - A large amount of code duplication is test suite can be prevented.
115 */
116
117const auto input_shape = TensorShape{2, 3, 3, 2};
118const auto output_shape = TensorShape{4, 6, 3, 2};
119
120constexpr auto default_data_type = DataType::U8;
121constexpr auto default_data_layout = DataLayout::NHWC;
122constexpr auto default_interpolation_policy = InterpolationPolicy::NEAREST_NEIGHBOR;
123constexpr auto default_border_mode = BorderMode::CONSTANT;
124constexpr auto default_sampling_policy = SamplingPolicy::CENTER;
125
126TEST_CASE(NullPtr, framework::DatasetMode::ALL)
127{
128 const auto input = TensorInfo{input_shape, 1, default_data_type, default_data_layout};
129 const auto output = TensorInfo{output_shape, 1, default_data_type, default_data_layout};
130 Status result{};
131
132 // nullptr is given as input
133 result = NEScale::validate(nullptr, &output,
134 ScaleKernelInfo{default_interpolation_policy, default_border_mode, PixelValue(),
135 SamplingPolicy::CENTER, false});
136 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
137
138 // nullptr is given as output
139 result = NEScale::validate(&input, nullptr,
140 ScaleKernelInfo{default_interpolation_policy, default_border_mode, PixelValue(),
141 SamplingPolicy::CENTER, false});
142 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
143}
144
145TEST_CASE(SupportDataType, framework::DatasetMode::ALL)
146{
147 const std::map<DataType, bool> supported_data_types = {
148 {DataType::U8, true},
149 {DataType::S8, false},
150 {DataType::QSYMM8, false},
151 {DataType::QASYMM8, true},
152 {DataType::QASYMM8_SIGNED, true},
153 {DataType::QSYMM8_PER_CHANNEL, false},
154 {DataType::U16, false},

Callers 15

Scale.cppFile · 0.85
Scale.cppFile · 0.85
TensorPack.cppFile · 0.85
Tensor.cppFile · 0.85
Queue.cppFile · 0.85
Context.cppFile · 0.85
SafeIntegerOps.cppFile · 0.85
SubTensorInfo.cppFile · 0.85
Version.cppFile · 0.85
DataTypeUtils.cppFile · 0.85

Calls 13

TEST_SUITE_ENDFunction · 0.85
combineFunction · 0.85
Medium4DShapesClass · 0.85
PixelValueClass · 0.85
Small3DShapesClass · 0.85
DATA_TEST_CASEFunction · 0.70
makeFunction · 0.50
validateFunction · 0.50
infoMethod · 0.45
setMethod · 0.45
is_resizableMethod · 0.45
configureMethod · 0.45

Tested by

no test coverage detected