blob: 127979e60b3967be0f1da1047dece66c735ea7dd [file] [log] [blame]
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +01001/*
Dana Zlotnik256ac622022-02-02 15:06:11 +02002 * Copyright (c) 2017-2022 Arm Limited.
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +01003 *
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/NEGEMM.h"
26#include "arm_compute/runtime/Tensor.h"
27#include "arm_compute/runtime/TensorAllocator.h"
Michele Di Giorgio4dfc5532021-06-30 12:05:34 +010028#include "src/core/helpers/MemoryHelpers.h"
Georgios Pinitas7891a732021-08-20 21:39:25 +010029#include "src/cpu/kernels/CpuGemmInterleave4x4Kernel.h"
30#include "src/cpu/kernels/CpuGemmMatrixMultiplyKernel.h"
31#include "src/cpu/kernels/CpuGemmTranspose1xWKernel.h"
32#include "src/cpu/operators/CpuGemm.h"
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010033#include "tests/NEON/Accessor.h"
Pablo Tello2fdc4092017-11-23 15:50:08 +000034#include "tests/NEON/Helper.h"
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010035#include "tests/PaddingCalculator.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010036#include "tests/datasets/LargeGEMMDataset.h"
37#include "tests/datasets/SmallGEMMDataset.h"
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +000038#include "tests/datasets/TinyGEMMDataset.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010039#include "tests/framework/Asserts.h"
40#include "tests/framework/Macros.h"
41#include "tests/framework/datasets/Datasets.h"
42#include "tests/validation/Validation.h"
43#include "tests/validation/fixtures/GEMMFixture.h"
Pablo Tello2fdc4092017-11-23 15:50:08 +000044#include "tests/validation/fixtures/GEMMInterleave4x4Fixture.h"
Pablo Tello088cc7f2017-12-07 15:20:55 +000045#include "tests/validation/fixtures/GEMMTranspose1xWFixture.h"
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010046
47namespace arm_compute
48{
49namespace test
50{
51namespace validation
52{
53namespace
54{
Gian Marco Iodicefbf3ecc2018-08-23 17:26:21 +010055constexpr AbsoluteTolerance<float> tolerance_f(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for FP32 data types */
56#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
57RelativeTolerance<half_float::half> rel_tolerance_f16(half(0.2)); /**< Relative tolerance value for comparing reference's output against implementation's output for FP16 data types */
58const AbsoluteTolerance<float> abs_tolerance_f16(0.2f); /**< Absolute tolerance value for comparing reference's output against implementation's output for FP16 data types */
59constexpr float tolerance_num = 0.07f; /**< Tolerance number for FP16 data types */
60#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010061/** CNN data types */
62const auto CNNDataTypes = framework::dataset::make("DataType",
63{
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +000064#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010065 DataType::F16,
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +000066#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010067 DataType::F32,
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +010068});
Pablo Tello2fdc4092017-11-23 15:50:08 +000069
70const auto data_interleave = framework::dataset::make("M", 8, 12) * framework::dataset::make("N", 8, 12);
Pablo Tello088cc7f2017-12-07 15:20:55 +000071const auto data_transpose = framework::dataset::make("M", 8, 14) * framework::dataset::make("N", 7, 14);
72
Gian Marco Iodicefeaea102020-09-03 13:20:34 +010073/** Zero padding test */
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +010074template <typename FunctionType>
75bool validate_zero_padding(unsigned int dim0_value, unsigned int dim1_value)
Gian Marco Iodicefeaea102020-09-03 13:20:34 +010076{
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +010077 const TensorShape in_shape(dim0_value, dim1_value);
Michele Di Giorgio93b75e02021-06-21 12:00:43 +010078 TensorInfo in(in_shape, 1, DataType::U32);
79 TensorInfo dst;
80
81 ARM_COMPUTE_EXPECT(in.is_resizable(), framework::LogLevel::ERRORS);
82
83 // Validate zero-padding
84 FunctionType func;
85
86 func.configure(&in, &dst);
87
88 return in.padding().empty();
89}
90
Michele Di Giorgiocf9e29e2020-10-08 11:54:42 +010091/* Zero padding test for GEMM kernels */
92bool validate_gemm_zero_padding(const TensorShape shape0, const TensorShape shape1)
93{
94 // Create tensors
Michele Di Giorgio53832b22021-06-21 14:45:44 +010095 TensorInfo in0(shape0, 1, DataType::F32);
96 TensorInfo in1(shape1, 1, DataType::F32);
97 TensorInfo dst;
Michele Di Giorgiocf9e29e2020-10-08 11:54:42 +010098
99 // Validate zero-padding
Michele Di Giorgio53832b22021-06-21 14:45:44 +0100100 cpu::kernels::CpuGemmMatrixMultiplyKernel gemm;
Michele Di Giorgiocf9e29e2020-10-08 11:54:42 +0100101 gemm.configure(&in0, &in1, &dst, 1.0, false);
102
Michele Di Giorgio53832b22021-06-21 14:45:44 +0100103 return in0.padding().empty() && in1.padding().empty() && dst.padding().empty();
Michele Di Giorgiocf9e29e2020-10-08 11:54:42 +0100104}
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100105} // namespace
106
107TEST_SUITE(NEON)
108TEST_SUITE(GEMM)
109
Michele Di Giorgio4dfc5532021-06-30 12:05:34 +0100110/** Test case for memory injection in @ref cpu::CpuGemm.
111 *
112 * Configure the operator once and inject memory at run-time in multiple executions.
113 *
114 * Checks performed in order:
115 * - Both runs compute the same output
116 */
117TEST_CASE(MemoryInjection, framework::DatasetMode::ALL)
118{
119 auto gemm = std::make_unique<cpu::CpuGemm>();
120 const auto lhs_info = TensorInfo(TensorShape(3U, 3U), 1, DataType::F32);
121 const auto rhs_info = TensorInfo(TensorShape(4U, 3U), 1, DataType::F32);
122 const auto c_info = TensorInfo(TensorShape(4U, 3U), 1, DataType::F32);
123 auto dst_info = TensorInfo(TensorShape(4U, 3U), 1, DataType::F32);
124 const auto gemm_info = GEMMInfo{};
125 gemm->configure(&lhs_info, &rhs_info, &c_info, &dst_info, 1.f, 1.f, gemm_info);
126
127 // telhs are newly created every call of this lambda function
128 auto lhs = create_tensor<Tensor>(lhs_info);
129 auto rhs = create_tensor<Tensor>(rhs_info);
130 auto c = create_tensor<Tensor>(c_info);
131 lhs.allocator()->allocate();
132 rhs.allocator()->allocate();
133 c.allocator()->allocate();
134
135 ITensorPack run_pack{ { TensorType::ACL_SRC_0, &lhs }, { TensorType::ACL_SRC_1, &rhs }, { TensorType::ACL_SRC_2, &c } };
136 ITensorPack prep_pack{ { TensorType::ACL_SRC_1, &rhs }, { TensorType::ACL_SRC_2, &c } };
137
138 auto mg = MemoryGroup{};
139 auto ws = manage_workspace<Tensor>(gemm->workspace(), mg, run_pack, prep_pack);
140
141 auto run_conv = [&]() -> Tensor
142 {
143 auto dst = create_tensor<Tensor>(dst_info);
144 dst.allocator()->allocate();
145 run_pack.add_tensor(TensorType::ACL_DST, &dst);
146
147 library->fill_tensor_value(Accessor(lhs), 1.f);
148 library->fill_tensor_value(Accessor(rhs), 2.f);
149 library->fill_tensor_value(Accessor(c), 3.f);
150 // This operator is configured once and captured by this lambda.
151 gemm->prepare(prep_pack);
152 gemm->run(run_pack);
153 return dst;
154 };
155 auto result_0 = run_conv();
156 auto result_1 = run_conv();
157 for(size_t i = 0; i < result_0.info()->tensor_shape().total_size(); ++i)
158 {
159 ARM_COMPUTE_EXPECT(((float *)result_0.buffer())[i] == ((float *)result_1.buffer())[i], framework::LogLevel::ERRORS);
160 }
161}
162
163/** Test case for memory injection in @ref NEGEMM.
164 *
165 * Make sure @ref NEGEMM still works through injecting the memory at configure time using the old API.
166 *
167 * Checks performed in order:
168 * - Both runs compute the same output
169 */
170TEST_CASE(MultipleExecutionWithConfigure, framework::DatasetMode::ALL)
171{
172 auto gemm = std::make_unique<NEGEMM>();
173 const auto lhs_info = TensorInfo(TensorShape(3U, 3U), 1, DataType::F32);
174 const auto rhs_info = TensorInfo(TensorShape(4U, 3U), 1, DataType::F32);
175 const auto c_info = TensorInfo(TensorShape(4U, 3U), 1, DataType::F32);
176 auto dst_info = TensorInfo(TensorShape(4U, 3U), 1, DataType::F32);
177 const auto gemm_info = GEMMInfo{};
178 auto run_conv = [&]()
179 {
180 auto lhs = create_tensor<Tensor>(lhs_info);
181 auto rhs = create_tensor<Tensor>(rhs_info);
182 auto c = create_tensor<Tensor>(c_info);
183 auto dst = create_tensor<Tensor>(dst_info);
184 gemm->configure(&lhs, &rhs, &c, &dst, 1.f, 1.f, gemm_info);
185 lhs.allocator()->allocate();
186 rhs.allocator()->allocate();
187 c.allocator()->allocate();
188 dst.allocator()->allocate();
189 library->fill_tensor_value(Accessor(lhs), 1.f);
190 library->fill_tensor_value(Accessor(rhs), 2.f);
191 library->fill_tensor_value(Accessor(c), 3.f);
192 gemm->run();
193 return dst;
194 };
195 auto result_0 = run_conv();
196 auto result_1 = run_conv();
197 for(size_t i = 0; i < result_0.info()->tensor_shape().total_size(); ++i)
198 {
199 ARM_COMPUTE_EXPECT(((float *)result_0.buffer())[i] == ((float *)result_1.buffer())[i], framework::LogLevel::ERRORS);
200 }
201}
202
Dana Zlotnik256ac622022-02-02 15:06:11 +0200203TEST_SUITE(KERNEL_SELECTION)
204DATA_TEST_CASE(KernelSelection_mul_and_add, framework::DatasetMode::ALL,
205 combine(framework::dataset::make("CpuExt", std::string("NEON")),
206 framework::dataset::make("DataType", { DataType::F32,
207 DataType::F16
208 })),
209 cpu_ext, data_type)
210{
211 using namespace cpu::kernels;
212
213 cpuinfo::CpuIsaInfo cpu_isa{};
214 cpu_isa.neon = (cpu_ext == "NEON");
215 cpu_isa.fp16 = (data_type == DataType::F16);
216
217 const auto *selected_impl_mul = CpuGemmMatrixMultiplyKernel::get_implementation(DataTypeISASelectorData{ data_type, cpu_isa }, cpu::KernelSelectionType::Preferred);
218
219 ARM_COMPUTE_ERROR_ON_NULLPTR(selected_impl_mul);
220
221 std::string expected = lower_string(cpu_ext) + "_" + cpu_impl_dt(data_type) + "_gemm_matrix_mul";
222 std::string actual = selected_impl_mul->name;
223
224 ARM_COMPUTE_EXPECT_EQUAL(expected, actual, framework::LogLevel::ERRORS);
225
226 const auto *selected_impl_add = CpuGemmMatrixAdditionKernel::get_implementation(DataTypeISASelectorData{ data_type, cpu_isa }, cpu::KernelSelectionType::Preferred);
227
228 ARM_COMPUTE_ERROR_ON_NULLPTR(selected_impl_add);
229
230 expected = lower_string(cpu_ext) + "_" + cpu_impl_dt(data_type) + "_gemm_matrix_add";
231 actual = selected_impl_add->name;
232
233 ARM_COMPUTE_EXPECT_EQUAL(expected, actual, framework::LogLevel::ERRORS);
234}
235TEST_SUITE_END() // KERNEL_SELECTION
236
Pablo Tello088cc7f2017-12-07 15:20:55 +0000237TEST_SUITE(TRANSPOSE_1XW)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100238using CpuGemmTranspose1xW = NESynthetizeFunctionWithZeroConstantKernelBorder<cpu::kernels::CpuGemmTranspose1xWKernel>;
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +0100239DATA_TEST_CASE(ValidateZeroPadding, framework::DatasetMode::ALL, zip(
240 framework::dataset::make("N", { 1, 23, 63, 101 }),
241 framework::dataset::make("K", { 1, 47, 29, 27 })),
242 n_value, k_value)
243{
Michele Di Giorgio4dfc5532021-06-30 12:05:34 +0100244 bool status = validate_zero_padding<CpuGemmTranspose1xW>(n_value, k_value);
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +0100245 ARM_COMPUTE_EXPECT(status, framework::LogLevel::ERRORS);
246}
247
248TEST_SUITE(U32)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100249using CpuGemmTranspose1xWFixture = GEMMTranspose1xWValidationFixture<Tensor, Accessor, CpuGemmTranspose1xW, uint32_t>;
250FIXTURE_DATA_TEST_CASE(RunSmall, CpuGemmTranspose1xWFixture, framework::DatasetMode::PRECOMMIT, data_transpose * framework::dataset::make("DataType", DataType::U32))
Pablo Tello088cc7f2017-12-07 15:20:55 +0000251{
252 // Validate output
253 validate(Accessor(_target), _reference);
254}
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +0100255TEST_SUITE_END() // U32
256
257TEST_SUITE(U16)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100258using CpuGemmTranspose1xWFixture = GEMMTranspose1xWValidationFixture<Tensor, Accessor, CpuGemmTranspose1xW, uint16_t>;
259FIXTURE_DATA_TEST_CASE(RunSmall, CpuGemmTranspose1xWFixture, framework::DatasetMode::PRECOMMIT, data_transpose * framework::dataset::make("DataType", DataType::U16))
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +0100260{
261 // Validate output
262 validate(Accessor(_target), _reference);
263}
264TEST_SUITE_END() // U16
265
266TEST_SUITE(U8)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100267using CpuGemmTranspose1xWFixture = GEMMTranspose1xWValidationFixture<Tensor, Accessor, CpuGemmTranspose1xW, uint8_t>;
268FIXTURE_DATA_TEST_CASE(RunSmall, CpuGemmTranspose1xWFixture, framework::DatasetMode::PRECOMMIT, data_transpose * framework::dataset::make("DataType", DataType::U8))
Gian Marco Iodiceb3182b12020-09-04 08:44:52 +0100269{
270 // Validate output
271 validate(Accessor(_target), _reference);
272}
273TEST_SUITE_END() // U8
Pablo Tello088cc7f2017-12-07 15:20:55 +0000274
Pablo Tello088cc7f2017-12-07 15:20:55 +0000275TEST_SUITE_END() // TRANSPOSE_1XW
276
Pablo Tello2fdc4092017-11-23 15:50:08 +0000277TEST_SUITE(INTERLEAVE_4X4)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100278using CpuGemmInterleave4x4 = NESynthetizeFunctionWithZeroConstantKernelBorder<cpu::kernels::CpuGemmInterleave4x4Kernel>;
Pablo Tello2fdc4092017-11-23 15:50:08 +0000279
Gian Marco Iodicefeaea102020-09-03 13:20:34 +0100280DATA_TEST_CASE(ValidateZeroPadding, framework::DatasetMode::ALL, zip(
281 framework::dataset::make("M", { 1, 23, 63, 101 }),
282 framework::dataset::make("K", { 1, 47, 29, 27 })),
283 m_value, k_value)
284{
Michele Di Giorgio4dfc5532021-06-30 12:05:34 +0100285 bool status = validate_zero_padding<cpu::kernels::CpuGemmInterleave4x4Kernel>(m_value, k_value);
Gian Marco Iodicefeaea102020-09-03 13:20:34 +0100286 ARM_COMPUTE_EXPECT(status, framework::LogLevel::ERRORS);
287}
288
289TEST_SUITE(U32)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100290using CpuGemmInterleave4x4Fixture = GEMMInterleave4x4ValidationFixture<Tensor, Accessor, CpuGemmInterleave4x4, uint32_t>;
291FIXTURE_DATA_TEST_CASE(RunSmall, CpuGemmInterleave4x4Fixture, framework::DatasetMode::PRECOMMIT, data_interleave * framework::dataset::make("DataType", DataType::U32))
Pablo Tello2fdc4092017-11-23 15:50:08 +0000292{
293 // Validate output
294 validate(Accessor(_target), _reference);
295}
Gian Marco Iodicefeaea102020-09-03 13:20:34 +0100296TEST_SUITE_END() // U32
297
298TEST_SUITE(U16)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100299using CpuGemmInterleave4x4Fixture = GEMMInterleave4x4ValidationFixture<Tensor, Accessor, CpuGemmInterleave4x4, uint16_t>;
300FIXTURE_DATA_TEST_CASE(RunSmall, CpuGemmInterleave4x4Fixture, framework::DatasetMode::PRECOMMIT, data_interleave * framework::dataset::make("DataType", DataType::U16))
Gian Marco Iodicefeaea102020-09-03 13:20:34 +0100301{
302 // Validate output
303 validate(Accessor(_target), _reference);
304}
305TEST_SUITE_END() // U16
306
307TEST_SUITE(U8)
Michele Di Giorgio93b75e02021-06-21 12:00:43 +0100308using CpuGemmInterleave4x4Fixture = GEMMInterleave4x4ValidationFixture<Tensor, Accessor, CpuGemmInterleave4x4, uint8_t>;
309FIXTURE_DATA_TEST_CASE(RunSmall, CpuGemmInterleave4x4Fixture, framework::DatasetMode::PRECOMMIT, data_interleave * framework::dataset::make("DataType", DataType::QASYMM8))
Gian Marco Iodicefeaea102020-09-03 13:20:34 +0100310{
311 // Validate output
312 validate(Accessor(_target), _reference);
313}
314TEST_SUITE_END() // U8
Pablo Tello2fdc4092017-11-23 15:50:08 +0000315
Pablo Tello2fdc4092017-11-23 15:50:08 +0000316TEST_SUITE_END() // INTERLEAVE_4X4
317
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100318template <typename T>
319using NEGEMMFixture = GEMMValidationFixture<Tensor, Accessor, NEGEMM, T>;
320
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000321template <typename T>
Adnan AlSinan26c9d1a2022-09-07 13:54:53 +0100322using NEBatchedMatMulFixture = GEMMValidationFixture<Tensor, Accessor, NEGEMM, T, true, false, false, false, false, true>;
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000323
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100324TEST_SUITE(Float)
Michele Di Giorgiocf9e29e2020-10-08 11:54:42 +0100325DATA_TEST_CASE(ValidateZeroPadding, framework::DatasetMode::ALL, zip(framework::dataset::make("In0", { TensorShape(21U, 13U),
326 TensorShape(31U, 1U),
327 TensorShape(31U, 1U),
328 TensorShape(8U, 2U),
329 TensorShape(38U, 12U),
330 TensorShape(32U, 1U)
331 }),
332 framework::dataset::make("In1", { TensorShape(33U, 21U),
333 TensorShape(23U, 31U),
334 TensorShape(23U, 31U),
335 TensorShape(16U, 8U),
336 TensorShape(21U, 38U),
337 TensorShape(17U, 32U)
338 })),
339 shape0, shape1)
340{
341 bool status = validate_gemm_zero_padding(shape0, shape1);
342 ARM_COMPUTE_EXPECT(status, framework::LogLevel::ERRORS);
343}
344
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +0000345#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100346TEST_SUITE(FP16)
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000347FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallGEMMDataset(),
348 framework::dataset::make("ReshapeWeights", { true, false })),
349 framework::dataset::make("DataType", DataType::F16)))
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100350{
351 // Validate output
Gian Marco Iodicefbf3ecc2018-08-23 17:26:21 +0100352 validate(Accessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_f16);
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100353}
Adnan AlSinan304dfdb2022-09-21 13:20:45 +0100354
355TEST_SUITE(BATCHED_MATMUL)
356
357FIXTURE_DATA_TEST_CASE(RunSmall, NEBatchedMatMulFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallBatchedMatMulDataset(),
358 framework::dataset::make("ReshapeWeights", { false })),
359 framework::dataset::make("DataType", DataType::F16)))
360{
361 // Validate output
362 validate(Accessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_f16);
363}
364TEST_SUITE_END()
365
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000366FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeGEMMDataset(),
367 framework::dataset::make("ReshapeWeights", { true, false })),
368
369 framework::dataset::make("DataType", DataType::F16)))
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100370{
371 // Validate output
Gian Marco Iodicefbf3ecc2018-08-23 17:26:21 +0100372 validate(Accessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_f16);
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100373}
374TEST_SUITE_END()
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +0000375#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100376
377TEST_SUITE(FP32)
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000378FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallGEMMDataset(),
379 framework::dataset::make("ReshapeWeights", { true, false })),
380
381 framework::dataset::make("DataType", DataType::F32)))
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100382{
383 // Validate output
384 validate(Accessor(_target), _reference, tolerance_f);
385}
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000386FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeGEMMDataset(),
387 framework::dataset::make("ReshapeWeights", { true, false })),
388
389 framework::dataset::make("DataType", DataType::F32)))
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100390{
391 // Validate output
392 validate(Accessor(_target), _reference, tolerance_f);
393}
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000394
Adnan AlSinan26c9d1a2022-09-07 13:54:53 +0100395TEST_SUITE(BATCHED_MATMUL)
396
397TEST_SUITE(FP32)
398FIXTURE_DATA_TEST_CASE(RunSmall, NEBatchedMatMulFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallBatchedMatMulDataset(),
399 framework::dataset::make("ReshapeWeights", { false })),
Pablo Tello0e37b5c2018-10-30 11:18:37 +0000400 framework::dataset::make("DataType", DataType::F32)))
401{
402 // Validate output
403 validate(Accessor(_target), _reference, tolerance_f);
404}
405TEST_SUITE_END()
406
Adnan AlSinan26c9d1a2022-09-07 13:54:53 +0100407TEST_SUITE_END()
Gian Marco Iodice37a46112021-08-04 15:22:28 +0100408
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100409TEST_SUITE_END()
410TEST_SUITE_END()
411
Moritz Pflanzer4dfc2352017-08-02 14:51:36 +0100412TEST_SUITE_END()
413TEST_SUITE_END()
414} // namespace validation
415} // namespace test
416} // namespace arm_compute