blob: 52afb716e4bc54a3bbfc68f7b25451ea95c07db4 [file] [log] [blame]
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +00001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2018-2020 Arm Limited.
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +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 */
Gian Marco Iodice7026b302019-06-26 17:18:11 +010024#include "arm_compute/core/KernelDescriptors.h"
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000025#include "arm_compute/core/Types.h"
26#include "arm_compute/core/utils/misc/ShapeCalculator.h"
27#include "arm_compute/runtime/CL/CLTensor.h"
28#include "arm_compute/runtime/CL/CLTensorAllocator.h"
Sang-Hoon Parkbef7fa22020-10-21 15:58:54 +010029#include "src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.h"
30#include "src/core/CL/kernels/CLGEMMReshapeLHSMatrixKernel.h"
31#include "src/core/CL/kernels/CLGEMMReshapeRHSMatrixKernel.h"
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000032#include "tests/CL/CLAccessor.h"
33#include "tests/CL/Helper.h"
34#include "tests/PaddingCalculator.h"
35#include "tests/datasets/ShapeDatasets.h"
36#include "tests/framework/Asserts.h"
37#include "tests/framework/Macros.h"
38#include "tests/framework/datasets/Datasets.h"
39#include "tests/validation/Validation.h"
40#include "tests/validation/fixtures/GEMMFixture.h"
41
42namespace arm_compute
43{
44namespace test
45{
46namespace validation
47{
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000048using namespace arm_compute::misc::shape_calculator;
49
50// Create function for CLGEMMReshapeLHSMatrixKernel
Gian Marco Iodicebacfec52019-01-11 11:30:55 +000051using CLGEMMReshapeLHSMatrix = CLSynthetizeFunction<CLGEMMReshapeLHSMatrixKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000052
53// Create function for CLGEMMReshapeRHSMatrixKernel
Gian Marco Iodicebacfec52019-01-11 11:30:55 +000054using CLGEMMReshapeRHSMatrix = CLSynthetizeFunction<CLGEMMReshapeRHSMatrixKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000055
56// Create function for CLGEMMMatrixMultiplyReshapedKernel
57using CLGEMMMatrixMultiplyReshaped = CLSynthetizeFunction<CLGEMMMatrixMultiplyReshapedKernel>;
58
59// Fixture for CLGEMMMatrixMultiplyReshaped
60template <typename T>
61using CLGEMMMatrixMultiplyReshapedFixture = GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
62
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010063// Fixture for CLGEMMMatrixMultiplyReshaped mixed precision
64template <typename T>
65using CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture =
66 GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
67
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000068// Fixture for CLGEMMMatrixMultiplyReshaped3D
69template <typename T>
70using CLGEMMMatrixMultiplyReshaped3DFixture = GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
71
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010072// Fixture for CLGEMMMatrixMultiplyReshaped3D mixed precision
73template <typename T>
74using CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture =
75 GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
76
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000077namespace
78{
79// *INDENT-OFF*
80// clang-format off
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000081RelativeTolerance<float> rel_tolerance_f32(0.001f);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000082constexpr float abs_tolerance_f32(0.0001f);
83
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010084RelativeTolerance<float> rel_tolerance_f16_mixed_precision(0.001f);
85constexpr float abs_tolerance_f16_mixed_precision(0.01f);
86
Gian Marco Iodice05639f62019-09-24 12:05:06 +010087RelativeTolerance<float> rel_tolerance_f16(0.001f);
88constexpr float abs_tolerance_f16(0.01f);
89
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000090/** M values to test */
morgolockaba2f912020-05-05 16:28:19 +010091const auto m_values = framework::dataset::make("M", 17);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000092
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000093/** M_W values to test */
94const auto m_w_values = framework::dataset::make("M_W", 5);
95
96/** M_H values to test */
97const auto m_h_values = framework::dataset::make("M_H", 7);
98
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000099/** N values to test */
morgolockaba2f912020-05-05 16:28:19 +0100100const auto n_values = framework::dataset::make("N", 21);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000101
102/** K values to test */
morgolockaba2f912020-05-05 16:28:19 +0100103const auto k_values = framework::dataset::make("K", 13);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000104
105/** Batch size values to test */
morgolockaba2f912020-05-05 16:28:19 +0100106const auto b_values = framework::dataset::make("batch_size", 2, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000107
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100108/** Activation values to test */
109const auto act_values = framework::dataset::make("Activation",
110{
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100111 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f),
112});
113
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100114/** Alpha values to test - Precommit */
115const auto a_values_precommit = framework::dataset::make("alpha", {-0.75f} );
116
117/** Beta values to test - Precommit */
118const auto beta_values_precommit = framework::dataset::make("beta", {-0.35f} );
119
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000120/** M0 values to test - Precommit */
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100121const auto m0_values_precommit = framework::dataset::make("M0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000122
123/** N0 values to test - Precommit */
Gian Marco Iodiced820db62019-08-05 14:23:23 +0100124const auto n0_values_precommit = framework::dataset::make("N0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000125
126/** K0 values to test - Precommit */
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000127const auto k0_values_precommit = framework::dataset::make("K0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000128
129/** V0 values to test - Precommit */
130const auto v0_values_precommit = framework::dataset::make("V0", 1, 3);
131
132/** H0 values to test - Precommit */
133const auto h0_values_precommit = framework::dataset::make("H0", 1, 3);
134
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100135/** Alpha values to test - Nightly */
136const auto a_values_nightly = framework::dataset::make("alpha", {1.0f} );
137
138/** Beta values to test - Nightly */
139const auto beta_values_nightly = framework::dataset::make("beta", {1.0f} );
140
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000141/** M0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100142const auto m0_values_nightly = framework::dataset::make("M0", { 8 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000143
144/** N0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100145const auto n0_values_nightly = framework::dataset::make("N0", { 8 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000146
147/** K0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100148const auto k0_values_nightly = framework::dataset::make("K0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000149
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100150/** N0 values to test with export to OpenCL image object - Nightly */
151const auto n0_export_to_cl_image_values_nightly = framework::dataset::make("N0", { 4, 8, 16 });
152
153/** K0 values to test with export to OpenCL image object - Nightly */
154const auto k0_export_to_cl_image_values_nightly = framework::dataset::make("K0", { 4, 8, 16 });
155
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000156/** V0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100157const auto v0_values_nightly = framework::dataset::make("V0", 1, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000158
159/** H0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100160const auto h0_values_nightly = framework::dataset::make("H0", 1, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000161
162/** Interleave values to test with LHS matrix */
163const auto i_values_lhs = framework::dataset::make("interleave_lhs", { true, false });
164
165/** Interleave values to test with RHS matrix */
166const auto i_values_rhs = framework::dataset::make("interleave_rhs", { true, false });
167
Gian Marco Iodicee16c8902019-06-14 16:11:10 +0100168/** Broadcast bias from vector to matrix */
Gian Marco Iodiced820db62019-08-05 14:23:23 +0100169const auto broadcast_bias_values = framework::dataset::make("broadcast_bias", { false, true } );
Gian Marco Iodicee16c8902019-06-14 16:11:10 +0100170
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100171/** LHS transposed values */
172const auto lhs_transpose_values = framework::dataset::make("lhs_transpose", { false, true } );
Gian Marco Iodice088d63a2020-08-11 14:14:06 +0100173
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000174} // namespace
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000175
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000176TEST_SUITE(CL)
177TEST_SUITE(GEMMMatrixMultiplyReshaped)
morgolockaba2f912020-05-05 16:28:19 +0100178
179// *INDENT-OFF*
180// clang-format off
181DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
182 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // OK
183 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK
184 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8), // Data type not supported
185 TensorInfo(TensorShape(10U, 5U, 2U), 1, DataType::F32), // Incorrect dimension bias
186 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // Mismatching shapes
187 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, do not broadcast bias
188 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, wider accummulation
189 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, RHS 4,4,2
190
191 }),
192 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32),
193 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
194 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8),
195 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32),
196 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
197 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
198 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
199 TensorInfo(TensorShape(128U, 3U, 2U), 1, DataType::F16),
200
201 })),
202 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(21U), 1, DataType::F32),
203 TensorInfo(TensorShape(21U), 1, DataType::F16),
204 TensorInfo(TensorShape(21U), 1, DataType::QASYMM8),
205 TensorInfo(TensorShape(21U), 1, DataType::F32),
206 TensorInfo(TensorShape(21U), 1, DataType::F32),
207 TensorInfo(TensorShape(21U,17U), 1, DataType::F16),
208 TensorInfo(TensorShape(21U,17U), 1, DataType::F16),
209 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
210
211 })),
212 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
213 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
214 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::QASYMM8),
215 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
216 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
217 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
218 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
219 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
220
221 })),
222 framework::dataset::make("LHSMInfo",{
223 GEMMLHSMatrixInfo(4,4,1,false,true),
224 GEMMLHSMatrixInfo(4,4,1,false,true),
225 GEMMLHSMatrixInfo(4,4,1,false,true),
226 GEMMLHSMatrixInfo(4,2,4,false,false),
227 GEMMLHSMatrixInfo(4,2,4,false,false),
228 GEMMLHSMatrixInfo(4,4,1,false,true),
229 GEMMLHSMatrixInfo(4,4,1,false,true),
230 GEMMLHSMatrixInfo(4,4,1,false,true),
231
232 })),
233 framework::dataset::make("RHSMInfo",{
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100234 GEMMRHSMatrixInfo(4,4,1,true,true,false),
235 GEMMRHSMatrixInfo(4,4,1,true,true,false),
236 GEMMRHSMatrixInfo(4,4,1,true,true,false),
237 GEMMRHSMatrixInfo(2,2,1,true,false,false),
238 GEMMRHSMatrixInfo(2,2,1,true,false,false),
239 GEMMRHSMatrixInfo(4,4,1,true,true,false),
240 GEMMRHSMatrixInfo(4,4,1,true,true,false),
241 GEMMRHSMatrixInfo(4,4,2,true,false,false),
morgolockaba2f912020-05-05 16:28:19 +0100242
243
244 })),
245
246
247 framework::dataset::make("GEMMInfo",{
248 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
249 21 /**<N Number of RHS columns*/,
250 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
251 false /**< reinterpret the input as 3D */,
252 true /**< Flag used to broadcast the bias addition */,
253 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100254 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100255 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
256 1 /**< Multiplication factor for the width of the 1xW transposed block */,
257 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
258 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100259 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100260 0 /**< Offset to be added to each element of the matrix A */,
261 0 /**< Offset to be added to each element of the matrix B */),
262
263 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
264 21 /**<N Number of RHS columns*/,
265 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
266 false /**< reinterpret the input as 3D */,
267 true /**< Flag used to broadcast the bias addition */,
268 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100269 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100270 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
271 1 /**< Multiplication factor for the width of the 1xW transposed block */,
272 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
273 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100274 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100275 0 /**< Offset to be added to each element of the matrix A */,
276 0 /**< Offset to be added to each element of the matrix B */),
277 GEMMKernelInfo(),
278 GEMMKernelInfo(),
279 GEMMKernelInfo(),
280
281 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
282 21 /**<N Number of RHS columns*/,
283 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
284 false /**< reinterpret the input as 3D */,
285 false /**< Flag used to broadcast the bias addition */,
286 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100287 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100288 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
289 1 /**< Multiplication factor for the width of the 1xW transposed block */,
290 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
291 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100292 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100293 0 /**< Offset to be added to each element of the matrix A */,
294 0 /**< Offset to be added to each element of the matrix B */),
295
296
297 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
298 21 /**<N Number of RHS columns*/,
299 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
300 false /**< reinterpret the input as 3D */,
301 false /**< Flag used to broadcast the bias addition */,
302 true /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100303 true /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100304 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
305 1 /**< Multiplication factor for the width of the 1xW transposed block */,
306 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
307 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100308 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100309 0 /**< Offset to be added to each element of the matrix A */,
310 0 /**< Offset to be added to each element of the matrix B */),
311
312 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
313 21 /**<N Number of RHS columns*/,
314 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
315 false /**< reinterpret the input as 3D */,
316 false /**< Flag used to broadcast the bias addition */,
317 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100318 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100319 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
320 1 /**< Multiplication factor for the width of the 1xW transposed block */,
321 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
322 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100323 GEMMRHSMatrixInfo(4,4,2,true,false,false),
morgolockaba2f912020-05-05 16:28:19 +0100324 0 /**< Offset to be added to each element of the matrix A */,
325 0 /**< Offset to be added to each element of the matrix B */),
326 })),
327 framework::dataset::make("Expected", { true, true, false, false, false, true, true,true})),
328 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
329{
330 ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
331 &input1_info.clone()->set_is_resizable(true),
332 &input2_info.clone()->set_is_resizable(true),
333 &output_info.clone()->set_is_resizable(true),1.f,1.f,
334 lhs_info,
335 rhs_info,
336 gemm_info)) == expected, framework::LogLevel::ERRORS);
337}
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000338TEST_SUITE(Float)
339TEST_SUITE(FP32)
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000340
341FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100342 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000343 m_values,
344 n_values),
345 k_values),
346 b_values),
347 m0_values_precommit),
348 n0_values_precommit),
349 k0_values_precommit),
350 v0_values_precommit),
351 h0_values_precommit),
352 i_values_lhs),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000353 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100354 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000355 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100356 a_values_precommit),
357 beta_values_precommit),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100358 broadcast_bias_values),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100359 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100360 act_values))
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000361{
362 // Validate output
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000363 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000364}
365
Michalis Spyrou1d897772019-12-09 18:47:29 +0000366FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100367 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000368 m_values,
369 n_values),
370 k_values),
371 b_values),
372 m0_values_nightly),
373 n0_values_nightly),
374 k0_values_nightly),
375 v0_values_nightly),
376 h0_values_nightly),
377 i_values_lhs),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000378 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100379 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000380 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100381 a_values_nightly),
382 beta_values_nightly),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100383 broadcast_bias_values),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100384 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100385 act_values))
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000386{
387 // Validate output
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000388 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000389}
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000390
391FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100392 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000393 m_w_values,
394 m_h_values),
395 n_values),
396 k_values),
397 b_values),
398 m0_values_precommit),
399 n0_values_precommit),
400 k0_values_precommit),
401 v0_values_precommit),
402 h0_values_precommit),
403 i_values_lhs),
404 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100405 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000406 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100407 a_values_precommit),
408 beta_values_precommit),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100409 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100410 act_values))
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000411{
412 // Validate output
413 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
414}
415
Michalis Spyrou1d897772019-12-09 18:47:29 +0000416FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100417 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000418 m_w_values,
419 m_h_values),
420 n_values),
421 k_values),
422 b_values),
423 m0_values_nightly),
424 n0_values_nightly),
425 k0_values_nightly),
426 v0_values_nightly),
427 h0_values_nightly),
428 i_values_lhs),
429 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100430 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000431 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100432 a_values_nightly),
433 beta_values_nightly),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100434 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100435 act_values))
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000436{
437 // Validate output
438 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
439}
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100440TEST_SUITE(ExportToCLImage)
441DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
442 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported
443 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported
444 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported
445 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect k0
446 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect n0
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100447
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100448 }),
449 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
450 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
451 TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F32),
452 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
453 TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F32),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100454
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100455 })),
456 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(64U), 1, DataType::F32),
457 TensorInfo(TensorShape(64U), 1, DataType::F32),
458 TensorInfo(TensorShape(64U), 1, DataType::F32),
459 TensorInfo(TensorShape(64U), 1, DataType::F32),
460 TensorInfo(TensorShape(64U), 1, DataType::F32),
461
462 })),
463 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
464 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
465 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
466 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
467 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
468 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
469
470 })),
471 framework::dataset::make("LHSMInfo",{
472 GEMMLHSMatrixInfo(4, 4, 1, false, true),
473 GEMMLHSMatrixInfo(4, 8, 1, false, true),
474 GEMMLHSMatrixInfo(4, 4, 1, false, true),
475 GEMMLHSMatrixInfo(4, 2, 1, false, false),
476 GEMMLHSMatrixInfo(4, 4, 1, false, false),
477
478 })),
479 framework::dataset::make("RHSMInfo",{
480 GEMMRHSMatrixInfo(4, 4, 1, true, true, true),
481 GEMMRHSMatrixInfo(4, 8, 1, true, true, true),
482 GEMMRHSMatrixInfo(8, 4, 1, true, true, true),
483 GEMMRHSMatrixInfo(4, 2, 1, true, false, true),
484 GEMMRHSMatrixInfo(2, 4, 1, true, false, true),
485 })),
486 framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
487 64 /**<N Number of RHS columns*/,
488 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
489 false /**< reinterpret the input as 3D */,
490 true /**< Flag used to broadcast the bias addition */,
491 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100492 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100493 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
494 1 /**< Multiplication factor for the width of the 1xW transposed block */,
495 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
496 GEMMLHSMatrixInfo(),
497 GEMMRHSMatrixInfo(),
498 0 /**< Offset to be added to each element of the matrix A */,
499 0 /**< Offset to be added to each element of the matrix B */),
500 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
501 64 /**<N Number of RHS columns*/,
502 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
503 false /**< reinterpret the input as 3D */,
504 true /**< Flag used to broadcast the bias addition */,
505 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100506 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100507 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
508 1 /**< Multiplication factor for the width of the 1xW transposed block */,
509 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
510 GEMMLHSMatrixInfo(),
511 GEMMRHSMatrixInfo(),
512 0 /**< Offset to be added to each element of the matrix A */,
513 0 /**< Offset to be added to each element of the matrix B */),
514 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
515 64 /**<N Number of RHS columns*/,
516 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
517 false /**< reinterpret the input as 3D */,
518 true /**< Flag used to broadcast the bias addition */,
519 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100520 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100521 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
522 1 /**< Multiplication factor for the width of the 1xW transposed block */,
523 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
524 GEMMLHSMatrixInfo(),
525 GEMMRHSMatrixInfo(),
526 0 /**< Offset to be added to each element of the matrix A */,
527 0 /**< Offset to be added to each element of the matrix B */),
528
529 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
530 64 /**<N Number of RHS columns*/,
531 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
532 false /**< reinterpret the input as 3D */,
533 true /**< Flag used to broadcast the bias addition */,
534 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100535 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100536 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
537 1 /**< Multiplication factor for the width of the 1xW transposed block */,
538 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
539 GEMMLHSMatrixInfo(),
540 GEMMRHSMatrixInfo(),
541 0 /**< Offset to be added to each element of the matrix A */,
542 0 /**< Offset to be added to each element of the matrix B */),
543 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
544 64 /**<N Number of RHS columns*/,
545 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
546 false /**< reinterpret the input as 3D */,
547 true /**< Flag used to broadcast the bias addition */,
548 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100549 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100550 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
551 1 /**< Multiplication factor for the width of the 1xW transposed block */,
552 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
553 GEMMLHSMatrixInfo(),
554 GEMMRHSMatrixInfo(),
555 0 /**< Offset to be added to each element of the matrix A */,
556 0 /**< Offset to be added to each element of the matrix B */)
557 })),
558 framework::dataset::make("Expected", { true,
559 true,
560 true,
561 false,
562 false})),
563 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
564{
565 ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
566 &input1_info.clone()->set_is_resizable(true),
567 &input2_info.clone()->set_is_resizable(true),
568 &output_info.clone()->set_is_resizable(true),1.f,1.f,
569 lhs_info,
570 rhs_info,
571 gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS);
572}
573
574FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL,
575 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100576 m_values,
577 n_values),
578 k_values),
579 b_values),
580 m0_values_precommit),
581 n0_values_precommit),
582 k0_values_precommit),
583 v0_values_precommit),
584 h0_values_precommit),
585 i_values_lhs),
586 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100587 framework::dataset::make("export_to_cl_image_rhs", true)),
588 framework::dataset::make("DataType", DataType::F32)),
589 a_values_precommit),
590 beta_values_precommit),
591 broadcast_bias_values),
592 lhs_transpose_values),
593 act_values))
594{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000595 // Validate output only if validate() is successful
596 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100597 {
598 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
599 }
600 else
601 {
602 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
603 framework::ARM_COMPUTE_PRINT_INFO();
604 }
605
606}
607
608FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::NIGHTLY,
609 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
610 m_values,
611 n_values),
612 k_values),
613 b_values),
614 m0_values_nightly),
615 n0_export_to_cl_image_values_nightly),
616 k0_export_to_cl_image_values_nightly),
617 v0_values_nightly),
618 h0_values_nightly),
619 i_values_lhs),
620 i_values_rhs),
621 framework::dataset::make("export_to_cl_image_rhs", true)),
622 framework::dataset::make("DataType", DataType::F32)),
623 a_values_nightly),
624 beta_values_nightly),
625 broadcast_bias_values),
626 lhs_transpose_values),
627 act_values))
628{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000629 // Validate output only if validate() is successful
630 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100631 {
632 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
633 }
634 else
635 {
636 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
637 framework::ARM_COMPUTE_PRINT_INFO();
638 }
639}
640
641FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL,
642 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
643 m_w_values,
644 m_h_values),
645 n_values),
646 k_values),
647 b_values),
648 m0_values_precommit),
649 n0_values_precommit),
650 k0_values_precommit),
651 v0_values_precommit),
652 h0_values_precommit),
653 i_values_lhs),
654 i_values_rhs),
655 framework::dataset::make("export_to_cl_image_rhs", true)),
656 framework::dataset::make("DataType", DataType::F32)),
657 a_values_precommit),
658 beta_values_precommit),
659 lhs_transpose_values),
660 act_values))
661{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000662 // Validate output only if validate() is successful
663 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100664 {
665 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
666 }
667 else
668 {
669 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
670 framework::ARM_COMPUTE_PRINT_INFO();
671 }
672}
673
674FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::NIGHTLY,
675 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
676 m_w_values,
677 m_h_values),
678 n_values),
679 k_values),
680 b_values),
681 m0_values_nightly),
682 n0_export_to_cl_image_values_nightly),
683 k0_export_to_cl_image_values_nightly),
684 v0_values_nightly),
685 h0_values_nightly),
686 i_values_lhs),
687 i_values_rhs),
688 framework::dataset::make("export_to_cl_image_rhs", true)),
689 framework::dataset::make("DataType", DataType::F32)),
690 a_values_nightly),
691 beta_values_nightly),
692 lhs_transpose_values),
693 act_values))
694{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000695 // Validate output only if validate() is successful
696 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100697 {
698 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
699 }
700 else
701 {
702 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
703 framework::ARM_COMPUTE_PRINT_INFO();
704 }
705}
706TEST_SUITE_END() // ExportToCLImage
707TEST_SUITE_END() // FP32
708
709TEST_SUITE(FP16)
710
711FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL,
712 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
713 m_values,
714 n_values),
715 k_values),
716 b_values),
717 m0_values_precommit),
718 n0_values_precommit),
719 k0_values_precommit),
720 v0_values_precommit),
721 h0_values_precommit),
722 i_values_lhs),
723 i_values_rhs),
724 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100725 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100726 a_values_precommit),
727 beta_values_precommit),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100728 broadcast_bias_values),
729 lhs_transpose_values),
730 act_values))
731{
732 // Validate output
733 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
734}
735
Michalis Spyrou1d897772019-12-09 18:47:29 +0000736FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100737 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100738 m_values,
739 n_values),
740 k_values),
741 b_values),
742 m0_values_nightly),
743 n0_values_nightly),
744 k0_values_nightly),
745 v0_values_nightly),
746 h0_values_nightly),
747 i_values_lhs),
748 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100749 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100750 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100751 a_values_nightly),
752 beta_values_nightly),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100753 broadcast_bias_values),
754 lhs_transpose_values),
755 act_values))
756{
757 // Validate output
758 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
759}
760
761FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100762 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100763 m_w_values,
764 m_h_values),
765 n_values),
766 k_values),
767 b_values),
768 m0_values_precommit),
769 n0_values_precommit),
770 k0_values_precommit),
771 v0_values_precommit),
772 h0_values_precommit),
773 i_values_lhs),
774 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100775 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100776 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100777 a_values_precommit),
778 beta_values_precommit),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100779 lhs_transpose_values),
780 act_values))
781{
782 // Validate output
783 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
784}
785
Michalis Spyrou1d897772019-12-09 18:47:29 +0000786FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100787 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100788 m_w_values,
789 m_h_values),
790 n_values),
791 k_values),
792 b_values),
793 m0_values_nightly),
794 n0_values_nightly),
795 k0_values_nightly),
796 v0_values_nightly),
797 h0_values_nightly),
798 i_values_lhs),
799 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100800 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100801 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100802 a_values_nightly),
803 beta_values_nightly),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100804 lhs_transpose_values),
805 act_values))
806{
807 // Validate output
808 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
809}
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100810
811TEST_SUITE(ExportToCLImage)
812DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
813 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported
814 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported
815 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported
816 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect k0
817 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect n0
818
819 }),
820 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
821 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
822 TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F16),
823 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
824 TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F16),
825
826 })),
827 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(64U), 1, DataType::F16),
828 TensorInfo(TensorShape(64U), 1, DataType::F16),
829 TensorInfo(TensorShape(64U), 1, DataType::F16),
830 TensorInfo(TensorShape(64U), 1, DataType::F16),
831 TensorInfo(TensorShape(64U), 1, DataType::F16),
832
833 })),
834 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
835 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
836 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
837 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
838 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
839 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
840
841 })),
842 framework::dataset::make("LHSMInfo",{
843 GEMMLHSMatrixInfo(4, 4, 1, false, true),
844 GEMMLHSMatrixInfo(4, 8, 1, false, true),
845 GEMMLHSMatrixInfo(4, 4, 1, false, true),
846 GEMMLHSMatrixInfo(4, 2, 1, false, false),
847 GEMMLHSMatrixInfo(4, 4, 1, false, false),
848
849 })),
850 framework::dataset::make("RHSMInfo",{
851 GEMMRHSMatrixInfo(4, 4, 1, true, true, true),
852 GEMMRHSMatrixInfo(4, 8, 1, true, true, true),
853 GEMMRHSMatrixInfo(8, 4, 1, true, true, true),
854 GEMMRHSMatrixInfo(4, 2, 1, true, false, true),
855 GEMMRHSMatrixInfo(2, 4, 1, true, false, true),
856 })),
857 framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
858 64 /**<N Number of RHS columns*/,
859 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
860 false /**< reinterpret the input as 3D */,
861 true /**< Flag used to broadcast the bias addition */,
862 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100863 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100864 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
865 1 /**< Multiplication factor for the width of the 1xW transposed block */,
866 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
867 GEMMLHSMatrixInfo(),
868 GEMMRHSMatrixInfo(),
869 0 /**< Offset to be added to each element of the matrix A */,
870 0 /**< Offset to be added to each element of the matrix B */),
871 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
872 64 /**<N Number of RHS columns*/,
873 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
874 false /**< reinterpret the input as 3D */,
875 true /**< Flag used to broadcast the bias addition */,
876 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100877 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100878 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
879 1 /**< Multiplication factor for the width of the 1xW transposed block */,
880 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
881 GEMMLHSMatrixInfo(),
882 GEMMRHSMatrixInfo(),
883 0 /**< Offset to be added to each element of the matrix A */,
884 0 /**< Offset to be added to each element of the matrix B */),
885 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
886 64 /**<N Number of RHS columns*/,
887 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
888 false /**< reinterpret the input as 3D */,
889 true /**< Flag used to broadcast the bias addition */,
890 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100891 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100892 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
893 1 /**< Multiplication factor for the width of the 1xW transposed block */,
894 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
895 GEMMLHSMatrixInfo(),
896 GEMMRHSMatrixInfo(),
897 0 /**< Offset to be added to each element of the matrix A */,
898 0 /**< Offset to be added to each element of the matrix B */),
899
900 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
901 64 /**<N Number of RHS columns*/,
902 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
903 false /**< reinterpret the input as 3D */,
904 true /**< Flag used to broadcast the bias addition */,
905 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100906 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100907 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
908 1 /**< Multiplication factor for the width of the 1xW transposed block */,
909 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
910 GEMMLHSMatrixInfo(),
911 GEMMRHSMatrixInfo(),
912 0 /**< Offset to be added to each element of the matrix A */,
913 0 /**< Offset to be added to each element of the matrix B */),
914 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
915 64 /**<N Number of RHS columns*/,
916 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
917 false /**< reinterpret the input as 3D */,
918 true /**< Flag used to broadcast the bias addition */,
919 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100920 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100921 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
922 1 /**< Multiplication factor for the width of the 1xW transposed block */,
923 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
924 GEMMLHSMatrixInfo(),
925 GEMMRHSMatrixInfo(),
926 0 /**< Offset to be added to each element of the matrix A */,
927 0 /**< Offset to be added to each element of the matrix B */)
928 })),
929 framework::dataset::make("Expected", { true,
930 true,
931 true,
932 false,
933 false})),
934 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
935{
936 ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
937 &input1_info.clone()->set_is_resizable(true),
938 &input2_info.clone()->set_is_resizable(true),
939 &output_info.clone()->set_is_resizable(true),1.f,1.f,
940 lhs_info,
941 rhs_info,
942 gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS);
943}
944
945FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL,
946 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
947 m_values,
948 n_values),
949 k_values),
950 b_values),
951 m0_values_precommit),
952 n0_values_precommit),
953 k0_values_precommit),
954 v0_values_precommit),
955 h0_values_precommit),
956 i_values_lhs),
957 i_values_rhs),
958 framework::dataset::make("export_to_cl_image_rhs", true)),
959 framework::dataset::make("DataType", DataType::F16)),
960 a_values_precommit),
961 beta_values_precommit),
962 broadcast_bias_values),
963 lhs_transpose_values),
964 act_values))
965{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000966 // Validate output only if validate() is successful
967 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100968 {
969 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
970 }
971 else
972 {
973 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
974 framework::ARM_COMPUTE_PRINT_INFO();
975 }
976
977}
978
979FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::NIGHTLY,
980 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
981 m_values,
982 n_values),
983 k_values),
984 b_values),
985 m0_values_nightly),
986 n0_export_to_cl_image_values_nightly),
987 k0_export_to_cl_image_values_nightly),
988 v0_values_nightly),
989 h0_values_nightly),
990 i_values_lhs),
991 i_values_rhs),
992 framework::dataset::make("export_to_cl_image_rhs", true)),
993 framework::dataset::make("DataType", DataType::F16)),
994 a_values_nightly),
995 beta_values_nightly),
996 broadcast_bias_values),
997 lhs_transpose_values),
998 act_values))
999{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001000 // Validate output only if validate() is successful
1001 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001002 {
1003 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1004 }
1005 else
1006 {
1007 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1008 framework::ARM_COMPUTE_PRINT_INFO();
1009 }
1010}
1011
1012FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL,
1013 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1014 m_w_values,
1015 m_h_values),
1016 n_values),
1017 k_values),
1018 b_values),
1019 m0_values_precommit),
1020 n0_values_precommit),
1021 k0_values_precommit),
1022 v0_values_precommit),
1023 h0_values_precommit),
1024 i_values_lhs),
1025 i_values_rhs),
1026 framework::dataset::make("export_to_cl_image_rhs", true)),
1027 framework::dataset::make("DataType", DataType::F16)),
1028 a_values_precommit),
1029 beta_values_precommit),
1030 lhs_transpose_values),
1031 act_values))
1032{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001033 // Validate output only if validate() is successful
1034 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001035 {
1036 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1037 }
1038 else
1039 {
1040 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1041 framework::ARM_COMPUTE_PRINT_INFO();
1042 }
1043}
1044
1045FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::NIGHTLY,
1046 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1047 m_w_values,
1048 m_h_values),
1049 n_values),
1050 k_values),
1051 b_values),
1052 m0_values_nightly),
1053 n0_export_to_cl_image_values_nightly),
1054 k0_export_to_cl_image_values_nightly),
1055 v0_values_nightly),
1056 h0_values_nightly),
1057 i_values_lhs),
1058 i_values_rhs),
1059 framework::dataset::make("export_to_cl_image_rhs", true)),
1060 framework::dataset::make("DataType", DataType::F16)),
1061 a_values_nightly),
1062 beta_values_nightly),
1063 lhs_transpose_values),
1064 act_values))
1065{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001066 // Validate output only if validate() is successful
1067 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001068 {
1069 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1070 }
1071 else
1072 {
1073 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1074 framework::ARM_COMPUTE_PRINT_INFO();
1075 }
1076}
1077TEST_SUITE_END() // ExportToCLImage
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001078TEST_SUITE_END() // FP16
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001079
1080TEST_SUITE(MixedPrecision)
1081
1082FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001083 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001084 m_values,
1085 n_values),
1086 k_values),
1087 b_values),
1088 m0_values_precommit),
1089 n0_values_precommit),
1090 k0_values_precommit),
1091 v0_values_precommit),
1092 h0_values_precommit),
1093 i_values_lhs),
1094 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001095 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001096 framework::dataset::make("DataType", DataType::F16)),
1097 a_values_precommit),
1098 beta_values_precommit),
1099 broadcast_bias_values),
1100 lhs_transpose_values),
1101 act_values))
1102{
1103 // Validate output
1104 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1105}
1106
Michalis Spyrou1d897772019-12-09 18:47:29 +00001107FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001108 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001109 m_values,
1110 n_values),
1111 k_values),
1112 b_values),
1113 m0_values_nightly),
1114 n0_values_nightly),
1115 k0_values_nightly),
1116 v0_values_nightly),
1117 h0_values_nightly),
1118 i_values_lhs),
1119 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001120 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001121 framework::dataset::make("DataType", DataType::F16)),
1122 a_values_nightly),
1123 beta_values_nightly),
1124 broadcast_bias_values),
1125 lhs_transpose_values),
1126 act_values))
1127{
1128 // Validate output
1129 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1130}
1131
1132FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001133 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001134 m_w_values,
1135 m_h_values),
1136 n_values),
1137 k_values),
1138 b_values),
1139 m0_values_precommit),
1140 n0_values_precommit),
1141 k0_values_precommit),
1142 v0_values_precommit),
1143 h0_values_precommit),
1144 i_values_lhs),
1145 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001146 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001147 framework::dataset::make("DataType", DataType::F16)),
1148 a_values_precommit),
1149 beta_values_precommit),
1150 lhs_transpose_values),
1151 act_values))
1152{
1153 // Validate output
1154 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1155}
1156
Michalis Spyrou1d897772019-12-09 18:47:29 +00001157FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001158 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001159 m_w_values,
1160 m_h_values),
1161 n_values),
1162 k_values),
1163 b_values),
1164 m0_values_nightly),
1165 n0_values_nightly),
1166 k0_values_nightly),
1167 v0_values_nightly),
1168 h0_values_nightly),
1169 i_values_lhs),
1170 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001171 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001172 framework::dataset::make("DataType", DataType::F16)),
1173 a_values_nightly),
1174 beta_values_nightly),
1175 lhs_transpose_values),
1176 act_values))
1177{
1178 // Validate output
1179 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1180}
1181TEST_SUITE_END() // MixedPrecision
Gian Marco Iodice9382ab32018-12-17 15:12:07 +00001182TEST_SUITE_END() // Float
Gian Marco Iodiced1f54762019-07-19 09:54:47 +01001183TEST_SUITE_END() // GEMMMatrixMultiplyReshaped
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +00001184TEST_SUITE_END() // CL
1185} // namespace validation
1186} // namespace test
Michele Di Giorgio2568c6b2019-09-17 12:08:46 +01001187} // namespace arm_compute