blob: 6f368a96504f47e787e0bded237455872db9fd8d [file] [log] [blame]
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +00001/*
Georgios Pinitas856f66e2021-04-22 21:13:21 +01002 * Copyright (c) 2018-2021 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"
Georgios Pinitas856f66e2021-04-22 21:13:21 +010029#include "src/core/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedKernel.h"
30#include "src/core/gpu/cl/kernels/ClGemmReshapeLhsMatrixKernel.h"
31#include "src/core/gpu/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;
Georgios Pinitas856f66e2021-04-22 21:13:21 +010049using namespace arm_compute::opencl::kernels;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000050
Georgios Pinitas856f66e2021-04-22 21:13:21 +010051// Create function for ClGemmReshapeLhsMatrixKernel
52using CLGEMMReshapeLHSMatrix = CLSynthetizeOperator<ClGemmReshapeLhsMatrixKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000053
Georgios Pinitas856f66e2021-04-22 21:13:21 +010054// Create function for ClGemmReshapeRhsMatrixKernel
55using CLGEMMReshapeRHSMatrix = CLSynthetizeOperator<ClGemmReshapeRhsMatrixKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000056
Georgios Pinitas856f66e2021-04-22 21:13:21 +010057// Create function for ClGemmMatrixMultiplyReshapedKernel
58using CLGEMMMatrixMultiplyReshaped = CLSynthetizeOperator<ClGemmMatrixMultiplyReshapedKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000059
60// Fixture for CLGEMMMatrixMultiplyReshaped
61template <typename T>
62using CLGEMMMatrixMultiplyReshapedFixture = GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
63
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010064// Fixture for CLGEMMMatrixMultiplyReshaped mixed precision
65template <typename T>
66using CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture =
67 GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
68
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000069// Fixture for CLGEMMMatrixMultiplyReshaped3D
70template <typename T>
71using CLGEMMMatrixMultiplyReshaped3DFixture = GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
72
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010073// Fixture for CLGEMMMatrixMultiplyReshaped3D mixed precision
74template <typename T>
75using CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture =
76 GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
77
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000078namespace
79{
80// *INDENT-OFF*
81// clang-format off
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000082RelativeTolerance<float> rel_tolerance_f32(0.001f);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000083constexpr float abs_tolerance_f32(0.0001f);
84
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010085RelativeTolerance<float> rel_tolerance_f16_mixed_precision(0.001f);
86constexpr float abs_tolerance_f16_mixed_precision(0.01f);
87
Gian Marco Iodice05639f62019-09-24 12:05:06 +010088RelativeTolerance<float> rel_tolerance_f16(0.001f);
89constexpr float abs_tolerance_f16(0.01f);
90
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000091/** M values to test */
morgolockaba2f912020-05-05 16:28:19 +010092const auto m_values = framework::dataset::make("M", 17);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000093
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000094/** M_W values to test */
95const auto m_w_values = framework::dataset::make("M_W", 5);
96
97/** M_H values to test */
98const auto m_h_values = framework::dataset::make("M_H", 7);
99
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000100/** N values to test */
morgolockaba2f912020-05-05 16:28:19 +0100101const auto n_values = framework::dataset::make("N", 21);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000102
103/** K values to test */
morgolockaba2f912020-05-05 16:28:19 +0100104const auto k_values = framework::dataset::make("K", 13);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000105
106/** Batch size values to test */
morgolockaba2f912020-05-05 16:28:19 +0100107const auto b_values = framework::dataset::make("batch_size", 2, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000108
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100109/** Activation values to test */
110const auto act_values = framework::dataset::make("Activation",
111{
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100112 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f),
113});
114
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100115/** Alpha values to test - Precommit */
116const auto a_values_precommit = framework::dataset::make("alpha", {-0.75f} );
117
118/** Beta values to test - Precommit */
119const auto beta_values_precommit = framework::dataset::make("beta", {-0.35f} );
120
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000121/** M0 values to test - Precommit */
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100122const auto m0_values_precommit = framework::dataset::make("M0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000123
124/** N0 values to test - Precommit */
Gian Marco Iodiced820db62019-08-05 14:23:23 +0100125const auto n0_values_precommit = framework::dataset::make("N0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000126
127/** K0 values to test - Precommit */
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000128const auto k0_values_precommit = framework::dataset::make("K0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000129
130/** V0 values to test - Precommit */
131const auto v0_values_precommit = framework::dataset::make("V0", 1, 3);
132
133/** H0 values to test - Precommit */
134const auto h0_values_precommit = framework::dataset::make("H0", 1, 3);
135
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100136/** Alpha values to test - Nightly */
137const auto a_values_nightly = framework::dataset::make("alpha", {1.0f} );
138
139/** Beta values to test - Nightly */
140const auto beta_values_nightly = framework::dataset::make("beta", {1.0f} );
141
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000142/** M0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100143const auto m0_values_nightly = framework::dataset::make("M0", { 8 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000144
145/** N0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100146const auto n0_values_nightly = framework::dataset::make("N0", { 8 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000147
148/** K0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100149const auto k0_values_nightly = framework::dataset::make("K0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000150
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100151/** N0 values to test with export to OpenCL image object - Nightly */
152const auto n0_export_to_cl_image_values_nightly = framework::dataset::make("N0", { 4, 8, 16 });
153
154/** K0 values to test with export to OpenCL image object - Nightly */
155const auto k0_export_to_cl_image_values_nightly = framework::dataset::make("K0", { 4, 8, 16 });
156
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000157/** V0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100158const auto v0_values_nightly = framework::dataset::make("V0", 1, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000159
160/** H0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100161const auto h0_values_nightly = framework::dataset::make("H0", 1, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000162
163/** Interleave values to test with LHS matrix */
164const auto i_values_lhs = framework::dataset::make("interleave_lhs", { true, false });
165
166/** Interleave values to test with RHS matrix */
167const auto i_values_rhs = framework::dataset::make("interleave_rhs", { true, false });
168
Gian Marco Iodicee16c8902019-06-14 16:11:10 +0100169/** Broadcast bias from vector to matrix */
Gian Marco Iodiced820db62019-08-05 14:23:23 +0100170const auto broadcast_bias_values = framework::dataset::make("broadcast_bias", { false, true } );
Gian Marco Iodicee16c8902019-06-14 16:11:10 +0100171
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100172/** LHS transposed values */
173const auto lhs_transpose_values = framework::dataset::make("lhs_transpose", { false, true } );
Gian Marco Iodice088d63a2020-08-11 14:14:06 +0100174
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000175} // namespace
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000176
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000177TEST_SUITE(CL)
178TEST_SUITE(GEMMMatrixMultiplyReshaped)
morgolockaba2f912020-05-05 16:28:19 +0100179
180// *INDENT-OFF*
181// clang-format off
182DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
183 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // OK
184 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK
185 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8), // Data type not supported
186 TensorInfo(TensorShape(10U, 5U, 2U), 1, DataType::F32), // Incorrect dimension bias
187 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // Mismatching shapes
188 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, do not broadcast bias
189 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, wider accummulation
190 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, RHS 4,4,2
191
192 }),
193 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32),
194 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
195 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8),
196 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32),
197 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
198 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
199 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
200 TensorInfo(TensorShape(128U, 3U, 2U), 1, DataType::F16),
201
202 })),
203 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(21U), 1, DataType::F32),
204 TensorInfo(TensorShape(21U), 1, DataType::F16),
205 TensorInfo(TensorShape(21U), 1, DataType::QASYMM8),
206 TensorInfo(TensorShape(21U), 1, DataType::F32),
207 TensorInfo(TensorShape(21U), 1, DataType::F32),
208 TensorInfo(TensorShape(21U,17U), 1, DataType::F16),
209 TensorInfo(TensorShape(21U,17U), 1, DataType::F16),
210 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
211
212 })),
213 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
214 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
215 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::QASYMM8),
216 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
217 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
218 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
219 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
220 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
221
222 })),
223 framework::dataset::make("LHSMInfo",{
224 GEMMLHSMatrixInfo(4,4,1,false,true),
225 GEMMLHSMatrixInfo(4,4,1,false,true),
226 GEMMLHSMatrixInfo(4,4,1,false,true),
227 GEMMLHSMatrixInfo(4,2,4,false,false),
228 GEMMLHSMatrixInfo(4,2,4,false,false),
229 GEMMLHSMatrixInfo(4,4,1,false,true),
230 GEMMLHSMatrixInfo(4,4,1,false,true),
231 GEMMLHSMatrixInfo(4,4,1,false,true),
232
233 })),
234 framework::dataset::make("RHSMInfo",{
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100235 GEMMRHSMatrixInfo(4,4,1,true,true,false),
236 GEMMRHSMatrixInfo(4,4,1,true,true,false),
237 GEMMRHSMatrixInfo(4,4,1,true,true,false),
238 GEMMRHSMatrixInfo(2,2,1,true,false,false),
239 GEMMRHSMatrixInfo(2,2,1,true,false,false),
240 GEMMRHSMatrixInfo(4,4,1,true,true,false),
241 GEMMRHSMatrixInfo(4,4,1,true,true,false),
242 GEMMRHSMatrixInfo(4,4,2,true,false,false),
morgolockaba2f912020-05-05 16:28:19 +0100243
244
245 })),
246
247
248 framework::dataset::make("GEMMInfo",{
249 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
250 21 /**<N Number of RHS columns*/,
251 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
252 false /**< reinterpret the input as 3D */,
253 true /**< Flag used to broadcast the bias addition */,
254 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100255 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100256 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
257 1 /**< Multiplication factor for the width of the 1xW transposed block */,
258 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
259 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100260 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100261 0 /**< Offset to be added to each element of the matrix A */,
262 0 /**< Offset to be added to each element of the matrix B */),
263
264 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
265 21 /**<N Number of RHS columns*/,
266 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
267 false /**< reinterpret the input as 3D */,
268 true /**< Flag used to broadcast the bias addition */,
269 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100270 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100271 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
272 1 /**< Multiplication factor for the width of the 1xW transposed block */,
273 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
274 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100275 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100276 0 /**< Offset to be added to each element of the matrix A */,
277 0 /**< Offset to be added to each element of the matrix B */),
278 GEMMKernelInfo(),
279 GEMMKernelInfo(),
280 GEMMKernelInfo(),
281
282 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
283 21 /**<N Number of RHS columns*/,
284 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
285 false /**< reinterpret the input as 3D */,
286 false /**< Flag used to broadcast the bias addition */,
287 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100288 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100289 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
290 1 /**< Multiplication factor for the width of the 1xW transposed block */,
291 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
292 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100293 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100294 0 /**< Offset to be added to each element of the matrix A */,
295 0 /**< Offset to be added to each element of the matrix B */),
296
297
298 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
299 21 /**<N Number of RHS columns*/,
300 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
301 false /**< reinterpret the input as 3D */,
302 false /**< Flag used to broadcast the bias addition */,
303 true /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100304 true /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100305 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
306 1 /**< Multiplication factor for the width of the 1xW transposed block */,
307 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
308 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100309 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100310 0 /**< Offset to be added to each element of the matrix A */,
311 0 /**< Offset to be added to each element of the matrix B */),
312
313 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
314 21 /**<N Number of RHS columns*/,
315 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
316 false /**< reinterpret the input as 3D */,
317 false /**< Flag used to broadcast the bias addition */,
318 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100319 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100320 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
321 1 /**< Multiplication factor for the width of the 1xW transposed block */,
322 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
323 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100324 GEMMRHSMatrixInfo(4,4,2,true,false,false),
morgolockaba2f912020-05-05 16:28:19 +0100325 0 /**< Offset to be added to each element of the matrix A */,
326 0 /**< Offset to be added to each element of the matrix B */),
327 })),
328 framework::dataset::make("Expected", { true, true, false, false, false, true, true,true})),
329 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
330{
Georgios Pinitas856f66e2021-04-22 21:13:21 +0100331 ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
morgolockaba2f912020-05-05 16:28:19 +0100332 &input1_info.clone()->set_is_resizable(true),
333 &input2_info.clone()->set_is_resizable(true),
334 &output_info.clone()->set_is_resizable(true),1.f,1.f,
335 lhs_info,
336 rhs_info,
337 gemm_info)) == expected, framework::LogLevel::ERRORS);
338}
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000339TEST_SUITE(Float)
340TEST_SUITE(FP32)
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000341
342FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100343 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 +0000344 m_values,
345 n_values),
346 k_values),
347 b_values),
348 m0_values_precommit),
349 n0_values_precommit),
350 k0_values_precommit),
351 v0_values_precommit),
352 h0_values_precommit),
353 i_values_lhs),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000354 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100355 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000356 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100357 a_values_precommit),
358 beta_values_precommit),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100359 broadcast_bias_values),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100360 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100361 act_values))
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000362{
363 // Validate output
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000364 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000365}
366
Michalis Spyrou1d897772019-12-09 18:47:29 +0000367FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100368 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 +0000369 m_values,
370 n_values),
371 k_values),
372 b_values),
373 m0_values_nightly),
374 n0_values_nightly),
375 k0_values_nightly),
376 v0_values_nightly),
377 h0_values_nightly),
378 i_values_lhs),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000379 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100380 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000381 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100382 a_values_nightly),
383 beta_values_nightly),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100384 broadcast_bias_values),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100385 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100386 act_values))
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000387{
388 // Validate output
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000389 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000390}
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000391
392FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100393 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 +0000394 m_w_values,
395 m_h_values),
396 n_values),
397 k_values),
398 b_values),
399 m0_values_precommit),
400 n0_values_precommit),
401 k0_values_precommit),
402 v0_values_precommit),
403 h0_values_precommit),
404 i_values_lhs),
405 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100406 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000407 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100408 a_values_precommit),
409 beta_values_precommit),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100410 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100411 act_values))
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000412{
413 // Validate output
414 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
415}
416
Michalis Spyrou1d897772019-12-09 18:47:29 +0000417FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100418 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 +0000419 m_w_values,
420 m_h_values),
421 n_values),
422 k_values),
423 b_values),
424 m0_values_nightly),
425 n0_values_nightly),
426 k0_values_nightly),
427 v0_values_nightly),
428 h0_values_nightly),
429 i_values_lhs),
430 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100431 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000432 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100433 a_values_nightly),
434 beta_values_nightly),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100435 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100436 act_values))
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000437{
438 // Validate output
439 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
440}
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100441TEST_SUITE(ExportToCLImage)
442DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
443 framework::dataset::make("Input0Info", { 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), // OK or incorrect if cl_khr_image2d_from_buffer not supported
446 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect k0
447 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect n0
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100448
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100449 }),
450 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
451 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
452 TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F32),
453 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
454 TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F32),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100455
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100456 })),
457 framework::dataset::make("Input2Info", { 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 TensorInfo(TensorShape(64U), 1, DataType::F32),
462
463 })),
464 framework::dataset::make("OutputInfo",{ 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 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
470
471 })),
472 framework::dataset::make("LHSMInfo",{
473 GEMMLHSMatrixInfo(4, 4, 1, false, true),
474 GEMMLHSMatrixInfo(4, 8, 1, false, true),
475 GEMMLHSMatrixInfo(4, 4, 1, false, true),
476 GEMMLHSMatrixInfo(4, 2, 1, false, false),
477 GEMMLHSMatrixInfo(4, 4, 1, false, false),
478
479 })),
480 framework::dataset::make("RHSMInfo",{
481 GEMMRHSMatrixInfo(4, 4, 1, true, true, true),
482 GEMMRHSMatrixInfo(4, 8, 1, true, true, true),
483 GEMMRHSMatrixInfo(8, 4, 1, true, true, true),
484 GEMMRHSMatrixInfo(4, 2, 1, true, false, true),
485 GEMMRHSMatrixInfo(2, 4, 1, true, false, true),
486 })),
487 framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
488 64 /**<N Number of RHS columns*/,
489 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
490 false /**< reinterpret the input as 3D */,
491 true /**< Flag used to broadcast the bias addition */,
492 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100493 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100494 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
495 1 /**< Multiplication factor for the width of the 1xW transposed block */,
496 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
497 GEMMLHSMatrixInfo(),
498 GEMMRHSMatrixInfo(),
499 0 /**< Offset to be added to each element of the matrix A */,
500 0 /**< Offset to be added to each element of the matrix B */),
501 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
502 64 /**<N Number of RHS columns*/,
503 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
504 false /**< reinterpret the input as 3D */,
505 true /**< Flag used to broadcast the bias addition */,
506 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100507 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100508 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
509 1 /**< Multiplication factor for the width of the 1xW transposed block */,
510 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
511 GEMMLHSMatrixInfo(),
512 GEMMRHSMatrixInfo(),
513 0 /**< Offset to be added to each element of the matrix A */,
514 0 /**< Offset to be added to each element of the matrix B */),
515 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
516 64 /**<N Number of RHS columns*/,
517 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
518 false /**< reinterpret the input as 3D */,
519 true /**< Flag used to broadcast the bias addition */,
520 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100521 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100522 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
523 1 /**< Multiplication factor for the width of the 1xW transposed block */,
524 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
525 GEMMLHSMatrixInfo(),
526 GEMMRHSMatrixInfo(),
527 0 /**< Offset to be added to each element of the matrix A */,
528 0 /**< Offset to be added to each element of the matrix B */),
529
530 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
531 64 /**<N Number of RHS columns*/,
532 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
533 false /**< reinterpret the input as 3D */,
534 true /**< Flag used to broadcast the bias addition */,
535 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100536 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100537 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
538 1 /**< Multiplication factor for the width of the 1xW transposed block */,
539 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
540 GEMMLHSMatrixInfo(),
541 GEMMRHSMatrixInfo(),
542 0 /**< Offset to be added to each element of the matrix A */,
543 0 /**< Offset to be added to each element of the matrix B */),
544 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
545 64 /**<N Number of RHS columns*/,
546 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
547 false /**< reinterpret the input as 3D */,
548 true /**< Flag used to broadcast the bias addition */,
549 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100550 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100551 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
552 1 /**< Multiplication factor for the width of the 1xW transposed block */,
553 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
554 GEMMLHSMatrixInfo(),
555 GEMMRHSMatrixInfo(),
556 0 /**< Offset to be added to each element of the matrix A */,
557 0 /**< Offset to be added to each element of the matrix B */)
558 })),
559 framework::dataset::make("Expected", { true,
560 true,
561 true,
562 false,
563 false})),
564 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
565{
Georgios Pinitas856f66e2021-04-22 21:13:21 +0100566 ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100567 &input1_info.clone()->set_is_resizable(true),
568 &input2_info.clone()->set_is_resizable(true),
569 &output_info.clone()->set_is_resizable(true),1.f,1.f,
570 lhs_info,
571 rhs_info,
572 gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS);
573}
574
575FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL,
576 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 +0100577 m_values,
578 n_values),
579 k_values),
580 b_values),
581 m0_values_precommit),
582 n0_values_precommit),
583 k0_values_precommit),
584 v0_values_precommit),
585 h0_values_precommit),
586 i_values_lhs),
587 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100588 framework::dataset::make("export_to_cl_image_rhs", true)),
589 framework::dataset::make("DataType", DataType::F32)),
590 a_values_precommit),
591 beta_values_precommit),
592 broadcast_bias_values),
593 lhs_transpose_values),
594 act_values))
595{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000596 // Validate output only if validate() is successful
597 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100598 {
599 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
600 }
601 else
602 {
603 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
604 framework::ARM_COMPUTE_PRINT_INFO();
605 }
606
607}
608
609FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::NIGHTLY,
610 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
611 m_values,
612 n_values),
613 k_values),
614 b_values),
615 m0_values_nightly),
616 n0_export_to_cl_image_values_nightly),
617 k0_export_to_cl_image_values_nightly),
618 v0_values_nightly),
619 h0_values_nightly),
620 i_values_lhs),
621 i_values_rhs),
622 framework::dataset::make("export_to_cl_image_rhs", true)),
623 framework::dataset::make("DataType", DataType::F32)),
624 a_values_nightly),
625 beta_values_nightly),
626 broadcast_bias_values),
627 lhs_transpose_values),
628 act_values))
629{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000630 // Validate output only if validate() is successful
631 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100632 {
633 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
634 }
635 else
636 {
637 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
638 framework::ARM_COMPUTE_PRINT_INFO();
639 }
640}
641
642FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL,
643 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
644 m_w_values,
645 m_h_values),
646 n_values),
647 k_values),
648 b_values),
649 m0_values_precommit),
650 n0_values_precommit),
651 k0_values_precommit),
652 v0_values_precommit),
653 h0_values_precommit),
654 i_values_lhs),
655 i_values_rhs),
656 framework::dataset::make("export_to_cl_image_rhs", true)),
657 framework::dataset::make("DataType", DataType::F32)),
658 a_values_precommit),
659 beta_values_precommit),
660 lhs_transpose_values),
661 act_values))
662{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000663 // Validate output only if validate() is successful
664 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100665 {
666 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
667 }
668 else
669 {
670 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
671 framework::ARM_COMPUTE_PRINT_INFO();
672 }
673}
674
675FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::NIGHTLY,
676 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
677 m_w_values,
678 m_h_values),
679 n_values),
680 k_values),
681 b_values),
682 m0_values_nightly),
683 n0_export_to_cl_image_values_nightly),
684 k0_export_to_cl_image_values_nightly),
685 v0_values_nightly),
686 h0_values_nightly),
687 i_values_lhs),
688 i_values_rhs),
689 framework::dataset::make("export_to_cl_image_rhs", true)),
690 framework::dataset::make("DataType", DataType::F32)),
691 a_values_nightly),
692 beta_values_nightly),
693 lhs_transpose_values),
694 act_values))
695{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000696 // Validate output only if validate() is successful
697 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100698 {
699 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
700 }
701 else
702 {
703 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
704 framework::ARM_COMPUTE_PRINT_INFO();
705 }
706}
707TEST_SUITE_END() // ExportToCLImage
708TEST_SUITE_END() // FP32
709
710TEST_SUITE(FP16)
711
712FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL,
713 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
714 m_values,
715 n_values),
716 k_values),
717 b_values),
718 m0_values_precommit),
719 n0_values_precommit),
720 k0_values_precommit),
721 v0_values_precommit),
722 h0_values_precommit),
723 i_values_lhs),
724 i_values_rhs),
725 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100726 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100727 a_values_precommit),
728 beta_values_precommit),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100729 broadcast_bias_values),
730 lhs_transpose_values),
731 act_values))
732{
733 // Validate output
734 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
735}
736
Michalis Spyrou1d897772019-12-09 18:47:29 +0000737FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100738 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 +0100739 m_values,
740 n_values),
741 k_values),
742 b_values),
743 m0_values_nightly),
744 n0_values_nightly),
745 k0_values_nightly),
746 v0_values_nightly),
747 h0_values_nightly),
748 i_values_lhs),
749 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100750 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100751 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100752 a_values_nightly),
753 beta_values_nightly),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100754 broadcast_bias_values),
755 lhs_transpose_values),
756 act_values))
757{
758 // Validate output
759 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
760}
761
762FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100763 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 +0100764 m_w_values,
765 m_h_values),
766 n_values),
767 k_values),
768 b_values),
769 m0_values_precommit),
770 n0_values_precommit),
771 k0_values_precommit),
772 v0_values_precommit),
773 h0_values_precommit),
774 i_values_lhs),
775 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100776 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100777 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100778 a_values_precommit),
779 beta_values_precommit),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100780 lhs_transpose_values),
781 act_values))
782{
783 // Validate output
784 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
785}
786
Michalis Spyrou1d897772019-12-09 18:47:29 +0000787FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100788 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 +0100789 m_w_values,
790 m_h_values),
791 n_values),
792 k_values),
793 b_values),
794 m0_values_nightly),
795 n0_values_nightly),
796 k0_values_nightly),
797 v0_values_nightly),
798 h0_values_nightly),
799 i_values_lhs),
800 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100801 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100802 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100803 a_values_nightly),
804 beta_values_nightly),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100805 lhs_transpose_values),
806 act_values))
807{
808 // Validate output
809 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
810}
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100811
812TEST_SUITE(ExportToCLImage)
813DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
814 framework::dataset::make("Input0Info", { 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), // OK or incorrect if cl_khr_image2d_from_buffer not supported
817 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect k0
818 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect n0
819
820 }),
821 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
822 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
823 TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F16),
824 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
825 TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F16),
826
827 })),
828 framework::dataset::make("Input2Info", { 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 TensorInfo(TensorShape(64U), 1, DataType::F16),
833
834 })),
835 framework::dataset::make("OutputInfo",{ 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 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
841
842 })),
843 framework::dataset::make("LHSMInfo",{
844 GEMMLHSMatrixInfo(4, 4, 1, false, true),
845 GEMMLHSMatrixInfo(4, 8, 1, false, true),
846 GEMMLHSMatrixInfo(4, 4, 1, false, true),
847 GEMMLHSMatrixInfo(4, 2, 1, false, false),
848 GEMMLHSMatrixInfo(4, 4, 1, false, false),
849
850 })),
851 framework::dataset::make("RHSMInfo",{
852 GEMMRHSMatrixInfo(4, 4, 1, true, true, true),
853 GEMMRHSMatrixInfo(4, 8, 1, true, true, true),
854 GEMMRHSMatrixInfo(8, 4, 1, true, true, true),
855 GEMMRHSMatrixInfo(4, 2, 1, true, false, true),
856 GEMMRHSMatrixInfo(2, 4, 1, true, false, true),
857 })),
858 framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
859 64 /**<N Number of RHS columns*/,
860 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
861 false /**< reinterpret the input as 3D */,
862 true /**< Flag used to broadcast the bias addition */,
863 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100864 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100865 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
866 1 /**< Multiplication factor for the width of the 1xW transposed block */,
867 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
868 GEMMLHSMatrixInfo(),
869 GEMMRHSMatrixInfo(),
870 0 /**< Offset to be added to each element of the matrix A */,
871 0 /**< Offset to be added to each element of the matrix B */),
872 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
873 64 /**<N Number of RHS columns*/,
874 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
875 false /**< reinterpret the input as 3D */,
876 true /**< Flag used to broadcast the bias addition */,
877 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100878 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100879 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
880 1 /**< Multiplication factor for the width of the 1xW transposed block */,
881 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
882 GEMMLHSMatrixInfo(),
883 GEMMRHSMatrixInfo(),
884 0 /**< Offset to be added to each element of the matrix A */,
885 0 /**< Offset to be added to each element of the matrix B */),
886 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
887 64 /**<N Number of RHS columns*/,
888 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
889 false /**< reinterpret the input as 3D */,
890 true /**< Flag used to broadcast the bias addition */,
891 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100892 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100893 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
894 1 /**< Multiplication factor for the width of the 1xW transposed block */,
895 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
896 GEMMLHSMatrixInfo(),
897 GEMMRHSMatrixInfo(),
898 0 /**< Offset to be added to each element of the matrix A */,
899 0 /**< Offset to be added to each element of the matrix B */),
900
901 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
902 64 /**<N Number of RHS columns*/,
903 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
904 false /**< reinterpret the input as 3D */,
905 true /**< Flag used to broadcast the bias addition */,
906 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100907 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100908 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
909 1 /**< Multiplication factor for the width of the 1xW transposed block */,
910 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
911 GEMMLHSMatrixInfo(),
912 GEMMRHSMatrixInfo(),
913 0 /**< Offset to be added to each element of the matrix A */,
914 0 /**< Offset to be added to each element of the matrix B */),
915 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
916 64 /**<N Number of RHS columns*/,
917 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
918 false /**< reinterpret the input as 3D */,
919 true /**< Flag used to broadcast the bias addition */,
920 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100921 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100922 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
923 1 /**< Multiplication factor for the width of the 1xW transposed block */,
924 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
925 GEMMLHSMatrixInfo(),
926 GEMMRHSMatrixInfo(),
927 0 /**< Offset to be added to each element of the matrix A */,
928 0 /**< Offset to be added to each element of the matrix B */)
929 })),
930 framework::dataset::make("Expected", { true,
931 true,
932 true,
933 false,
934 false})),
935 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
936{
Georgios Pinitas856f66e2021-04-22 21:13:21 +0100937 ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100938 &input1_info.clone()->set_is_resizable(true),
939 &input2_info.clone()->set_is_resizable(true),
940 &output_info.clone()->set_is_resizable(true),1.f,1.f,
941 lhs_info,
942 rhs_info,
943 gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS);
944}
945
946FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL,
947 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
948 m_values,
949 n_values),
950 k_values),
951 b_values),
952 m0_values_precommit),
953 n0_values_precommit),
954 k0_values_precommit),
955 v0_values_precommit),
956 h0_values_precommit),
957 i_values_lhs),
958 i_values_rhs),
959 framework::dataset::make("export_to_cl_image_rhs", true)),
960 framework::dataset::make("DataType", DataType::F16)),
961 a_values_precommit),
962 beta_values_precommit),
963 broadcast_bias_values),
964 lhs_transpose_values),
965 act_values))
966{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000967 // Validate output only if validate() is successful
968 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100969 {
970 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
971 }
972 else
973 {
974 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
975 framework::ARM_COMPUTE_PRINT_INFO();
976 }
977
978}
979
980FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::NIGHTLY,
981 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
982 m_values,
983 n_values),
984 k_values),
985 b_values),
986 m0_values_nightly),
987 n0_export_to_cl_image_values_nightly),
988 k0_export_to_cl_image_values_nightly),
989 v0_values_nightly),
990 h0_values_nightly),
991 i_values_lhs),
992 i_values_rhs),
993 framework::dataset::make("export_to_cl_image_rhs", true)),
994 framework::dataset::make("DataType", DataType::F16)),
995 a_values_nightly),
996 beta_values_nightly),
997 broadcast_bias_values),
998 lhs_transpose_values),
999 act_values))
1000{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001001 // Validate output only if validate() is successful
1002 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001003 {
1004 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1005 }
1006 else
1007 {
1008 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1009 framework::ARM_COMPUTE_PRINT_INFO();
1010 }
1011}
1012
1013FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL,
1014 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1015 m_w_values,
1016 m_h_values),
1017 n_values),
1018 k_values),
1019 b_values),
1020 m0_values_precommit),
1021 n0_values_precommit),
1022 k0_values_precommit),
1023 v0_values_precommit),
1024 h0_values_precommit),
1025 i_values_lhs),
1026 i_values_rhs),
1027 framework::dataset::make("export_to_cl_image_rhs", true)),
1028 framework::dataset::make("DataType", DataType::F16)),
1029 a_values_precommit),
1030 beta_values_precommit),
1031 lhs_transpose_values),
1032 act_values))
1033{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001034 // Validate output only if validate() is successful
1035 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001036 {
1037 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1038 }
1039 else
1040 {
1041 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1042 framework::ARM_COMPUTE_PRINT_INFO();
1043 }
1044}
1045
1046FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::NIGHTLY,
1047 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1048 m_w_values,
1049 m_h_values),
1050 n_values),
1051 k_values),
1052 b_values),
1053 m0_values_nightly),
1054 n0_export_to_cl_image_values_nightly),
1055 k0_export_to_cl_image_values_nightly),
1056 v0_values_nightly),
1057 h0_values_nightly),
1058 i_values_lhs),
1059 i_values_rhs),
1060 framework::dataset::make("export_to_cl_image_rhs", true)),
1061 framework::dataset::make("DataType", DataType::F16)),
1062 a_values_nightly),
1063 beta_values_nightly),
1064 lhs_transpose_values),
1065 act_values))
1066{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001067 // Validate output only if validate() is successful
1068 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001069 {
1070 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1071 }
1072 else
1073 {
1074 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1075 framework::ARM_COMPUTE_PRINT_INFO();
1076 }
1077}
1078TEST_SUITE_END() // ExportToCLImage
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001079TEST_SUITE_END() // FP16
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001080
1081TEST_SUITE(MixedPrecision)
1082
1083FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001084 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 +01001085 m_values,
1086 n_values),
1087 k_values),
1088 b_values),
1089 m0_values_precommit),
1090 n0_values_precommit),
1091 k0_values_precommit),
1092 v0_values_precommit),
1093 h0_values_precommit),
1094 i_values_lhs),
1095 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001096 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001097 framework::dataset::make("DataType", DataType::F16)),
1098 a_values_precommit),
1099 beta_values_precommit),
1100 broadcast_bias_values),
1101 lhs_transpose_values),
1102 act_values))
1103{
1104 // Validate output
1105 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1106}
1107
Michalis Spyrou1d897772019-12-09 18:47:29 +00001108FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001109 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 +01001110 m_values,
1111 n_values),
1112 k_values),
1113 b_values),
1114 m0_values_nightly),
1115 n0_values_nightly),
1116 k0_values_nightly),
1117 v0_values_nightly),
1118 h0_values_nightly),
1119 i_values_lhs),
1120 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001121 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001122 framework::dataset::make("DataType", DataType::F16)),
1123 a_values_nightly),
1124 beta_values_nightly),
1125 broadcast_bias_values),
1126 lhs_transpose_values),
1127 act_values))
1128{
1129 // Validate output
1130 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1131}
1132
1133FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001134 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 +01001135 m_w_values,
1136 m_h_values),
1137 n_values),
1138 k_values),
1139 b_values),
1140 m0_values_precommit),
1141 n0_values_precommit),
1142 k0_values_precommit),
1143 v0_values_precommit),
1144 h0_values_precommit),
1145 i_values_lhs),
1146 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001147 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001148 framework::dataset::make("DataType", DataType::F16)),
1149 a_values_precommit),
1150 beta_values_precommit),
1151 lhs_transpose_values),
1152 act_values))
1153{
1154 // Validate output
1155 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1156}
1157
Michalis Spyrou1d897772019-12-09 18:47:29 +00001158FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001159 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 +01001160 m_w_values,
1161 m_h_values),
1162 n_values),
1163 k_values),
1164 b_values),
1165 m0_values_nightly),
1166 n0_values_nightly),
1167 k0_values_nightly),
1168 v0_values_nightly),
1169 h0_values_nightly),
1170 i_values_lhs),
1171 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001172 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001173 framework::dataset::make("DataType", DataType::F16)),
1174 a_values_nightly),
1175 beta_values_nightly),
1176 lhs_transpose_values),
1177 act_values))
1178{
1179 // Validate output
1180 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1181}
1182TEST_SUITE_END() // MixedPrecision
Gian Marco Iodice9382ab32018-12-17 15:12:07 +00001183TEST_SUITE_END() // Float
Gian Marco Iodiced1f54762019-07-19 09:54:47 +01001184TEST_SUITE_END() // GEMMMatrixMultiplyReshaped
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +00001185TEST_SUITE_END() // CL
1186} // namespace validation
1187} // namespace test
Michele Di Giorgio2568c6b2019-09-17 12:08:46 +01001188} // namespace arm_compute