blob: bedd0f5bfbd17fa0a339ef95e4db27ea1eeeb1e7 [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"
SiCongLi1af54162021-10-06 15:25:57 +010029#include "src/core/experimental/PostOp.h"
Georgios Pinitas7891a732021-08-20 21:39:25 +010030#include "src/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedKernel.h"
31#include "src/gpu/cl/kernels/ClGemmReshapeLhsMatrixKernel.h"
32#include "src/gpu/cl/kernels/ClGemmReshapeRhsMatrixKernel.h"
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000033#include "tests/CL/CLAccessor.h"
34#include "tests/CL/Helper.h"
35#include "tests/PaddingCalculator.h"
36#include "tests/datasets/ShapeDatasets.h"
37#include "tests/framework/Asserts.h"
38#include "tests/framework/Macros.h"
39#include "tests/framework/datasets/Datasets.h"
40#include "tests/validation/Validation.h"
41#include "tests/validation/fixtures/GEMMFixture.h"
42
43namespace arm_compute
44{
45namespace test
46{
47namespace validation
48{
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000049using namespace arm_compute::misc::shape_calculator;
Georgios Pinitas856f66e2021-04-22 21:13:21 +010050using namespace arm_compute::opencl::kernels;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000051
Georgios Pinitas856f66e2021-04-22 21:13:21 +010052// Create function for ClGemmReshapeLhsMatrixKernel
53using CLGEMMReshapeLHSMatrix = CLSynthetizeOperator<ClGemmReshapeLhsMatrixKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000054
Georgios Pinitas856f66e2021-04-22 21:13:21 +010055// Create function for ClGemmReshapeRhsMatrixKernel
56using CLGEMMReshapeRHSMatrix = CLSynthetizeOperator<ClGemmReshapeRhsMatrixKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000057
Georgios Pinitas856f66e2021-04-22 21:13:21 +010058// Create function for ClGemmMatrixMultiplyReshapedKernel
59using CLGEMMMatrixMultiplyReshaped = CLSynthetizeOperator<ClGemmMatrixMultiplyReshapedKernel>;
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000060
61// Fixture for CLGEMMMatrixMultiplyReshaped
62template <typename T>
63using CLGEMMMatrixMultiplyReshapedFixture = GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
64
SiCongLi1af54162021-10-06 15:25:57 +010065// Fixture for CLGEMMMatrixMultiplyReshaped with post ops
66template <typename T>
67using CLGEMMMatrixMultiplyReshapedWithPostOpsFixture =
68 GEMMMatrixMultiplyReshapedWithPostOpsValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
69
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010070// Fixture for CLGEMMMatrixMultiplyReshaped mixed precision
71template <typename T>
72using CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture =
73 GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
74
SiCongLi1af54162021-10-06 15:25:57 +010075// Fixture for CLGEMMMatrixMultiplyReshaped mixed precision with post ops
76template <typename T>
77using CLGEMMMatrixMultiplyReshapedMixedPrecisionWithPostOpsFixture =
78 GEMMMatrixMultiplyReshapedWithPostOpsValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
79
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000080// Fixture for CLGEMMMatrixMultiplyReshaped3D
81template <typename T>
82using CLGEMMMatrixMultiplyReshaped3DFixture = GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
83
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010084// Fixture for CLGEMMMatrixMultiplyReshaped3D mixed precision
85template <typename T>
86using CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture =
87 GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
88
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000089namespace
90{
91// *INDENT-OFF*
92// clang-format off
Gian Marco Iodice9382ab32018-12-17 15:12:07 +000093RelativeTolerance<float> rel_tolerance_f32(0.001f);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +000094constexpr float abs_tolerance_f32(0.0001f);
95
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +010096RelativeTolerance<float> rel_tolerance_f16_mixed_precision(0.001f);
97constexpr float abs_tolerance_f16_mixed_precision(0.01f);
98
Gian Marco Iodice05639f62019-09-24 12:05:06 +010099RelativeTolerance<float> rel_tolerance_f16(0.001f);
100constexpr float abs_tolerance_f16(0.01f);
101
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000102/** M values to test */
morgolockaba2f912020-05-05 16:28:19 +0100103const auto m_values = framework::dataset::make("M", 17);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000104
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000105/** M_W values to test */
106const auto m_w_values = framework::dataset::make("M_W", 5);
107
108/** M_H values to test */
109const auto m_h_values = framework::dataset::make("M_H", 7);
110
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000111/** N values to test */
morgolockaba2f912020-05-05 16:28:19 +0100112const auto n_values = framework::dataset::make("N", 21);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000113
114/** K values to test */
morgolockaba2f912020-05-05 16:28:19 +0100115const auto k_values = framework::dataset::make("K", 13);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000116
117/** Batch size values to test */
morgolockaba2f912020-05-05 16:28:19 +0100118const auto b_values = framework::dataset::make("batch_size", 2, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000119
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100120/** Activation values to test */
121const auto act_values = framework::dataset::make("Activation",
122{
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100123 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f),
124});
125
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100126/** Alpha values to test - Precommit */
127const auto a_values_precommit = framework::dataset::make("alpha", {-0.75f} );
128
129/** Beta values to test - Precommit */
130const auto beta_values_precommit = framework::dataset::make("beta", {-0.35f} );
131
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000132/** M0 values to test - Precommit */
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100133const auto m0_values_precommit = framework::dataset::make("M0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000134
135/** N0 values to test - Precommit */
Gian Marco Iodiced820db62019-08-05 14:23:23 +0100136const auto n0_values_precommit = framework::dataset::make("N0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000137
138/** K0 values to test - Precommit */
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000139const auto k0_values_precommit = framework::dataset::make("K0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000140
141/** V0 values to test - Precommit */
142const auto v0_values_precommit = framework::dataset::make("V0", 1, 3);
143
144/** H0 values to test - Precommit */
145const auto h0_values_precommit = framework::dataset::make("H0", 1, 3);
146
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100147/** Alpha values to test - Nightly */
148const auto a_values_nightly = framework::dataset::make("alpha", {1.0f} );
149
150/** Beta values to test - Nightly */
151const auto beta_values_nightly = framework::dataset::make("beta", {1.0f} );
152
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000153/** M0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100154const auto m0_values_nightly = framework::dataset::make("M0", { 8 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000155
156/** N0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100157const auto n0_values_nightly = framework::dataset::make("N0", { 8 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000158
159/** K0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100160const auto k0_values_nightly = framework::dataset::make("K0", { 4 });
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000161
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100162/** N0 values to test with export to OpenCL image object - Nightly */
163const auto n0_export_to_cl_image_values_nightly = framework::dataset::make("N0", { 4, 8, 16 });
164
165/** K0 values to test with export to OpenCL image object - Nightly */
166const auto k0_export_to_cl_image_values_nightly = framework::dataset::make("K0", { 4, 8, 16 });
167
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000168/** V0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100169const auto v0_values_nightly = framework::dataset::make("V0", 1, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000170
171/** H0 values to test - Nightly */
Gian Marco Iodice6f931342020-09-15 14:17:41 +0100172const auto h0_values_nightly = framework::dataset::make("H0", 1, 3);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000173
174/** Interleave values to test with LHS matrix */
175const auto i_values_lhs = framework::dataset::make("interleave_lhs", { true, false });
176
177/** Interleave values to test with RHS matrix */
178const auto i_values_rhs = framework::dataset::make("interleave_rhs", { true, false });
179
Gian Marco Iodicee16c8902019-06-14 16:11:10 +0100180/** Broadcast bias from vector to matrix */
Gian Marco Iodiced820db62019-08-05 14:23:23 +0100181const auto broadcast_bias_values = framework::dataset::make("broadcast_bias", { false, true } );
Gian Marco Iodicee16c8902019-06-14 16:11:10 +0100182
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100183/** LHS transposed values */
184const auto lhs_transpose_values = framework::dataset::make("lhs_transpose", { false, true } );
Gian Marco Iodice088d63a2020-08-11 14:14:06 +0100185
SiCongLi1af54162021-10-06 15:25:57 +0100186/** Post Ops */
187using PostOpArgBroadcast = CLGEMMMatrixMultiplyReshapedWithPostOpsFixture<float>::PostOpArgBroadcast;
SiCongLi1af54162021-10-06 15:25:57 +0100188experimental::PostOpList<PostOpArgBroadcast> post_ops_1()
189{
190 experimental::PostOpList<PostOpArgBroadcast> post_ops{};
191 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::LINEAR, 0.5F, 0.0F});
192 post_ops.push_back_op<experimental::PostOpEltwiseAdd<PostOpArgBroadcast>>(
193 std::make_tuple(true, true, false), // If broadcast in dims 0, 1 and 2
194 0,
195 ConvertPolicy::SATURATE);
196 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::RELU, 2.1F, 1.3F});
197 return post_ops;
198}
199experimental::PostOpList<PostOpArgBroadcast> post_ops_2()
200{
201 experimental::PostOpList<PostOpArgBroadcast> post_ops{};
202 post_ops.push_back_op<experimental::PostOpEltwiseAdd<PostOpArgBroadcast>>(
203 std::make_tuple(false, true, true), // If broadcast in dims 0, 1 and 2
204 1,
205 ConvertPolicy::SATURATE);
206 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::RELU, 2.1F, 1.3F});
207 return post_ops;
208}
209experimental::PostOpList<PostOpArgBroadcast> post_ops_3()
210{
211 experimental::PostOpList<PostOpArgBroadcast> post_ops{};
212 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::RELU, 2.1F, 1.3F});
213 post_ops.push_back_op<experimental::PostOpEltwiseAdd<PostOpArgBroadcast>>(
214 std::make_tuple(false, false, true), // If broadcast in dims 0, 1 and 2
215 1,
216 ConvertPolicy::SATURATE);
217 return post_ops;
218}
ramelg016049eda2021-10-29 10:52:53 +0100219// To test that the output of the main op is the first parameter in prelu post op
220experimental::PostOpList<PostOpArgBroadcast> post_ops_4()
221{
222 experimental::PostOpList<PostOpArgBroadcast> post_ops{};
223 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::LINEAR, 0.5F, 0.0F});
224 post_ops.push_back_op<experimental::PostOpEltwisePRelu<PostOpArgBroadcast>>(
225 std::make_tuple(false, false, true), // If true, broadcast in corresponding dim: 0, 1 or 2
226 0,
227 ConvertPolicy::SATURATE);
228 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::RELU, 2.1F, 1.3F});
229 return post_ops;
230}
231// To test that the output of the main op is the second parameter in prelu post op i.e. it is the alpha_param
232experimental::PostOpList<PostOpArgBroadcast> post_ops_5()
233{
234 experimental::PostOpList<PostOpArgBroadcast> post_ops{};
235 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::LINEAR, 0.5F, 0.0F});
236 post_ops.push_back_op<experimental::PostOpEltwisePRelu<PostOpArgBroadcast>>(
237 std::make_tuple(false, false, false), // If true, broadcast in corresponding dim: 0, 1 or 2
238 1,
239 ConvertPolicy::SATURATE);
240 post_ops.push_back_op<experimental::PostOpAct<PostOpArgBroadcast>>(ActivationLayerInfo{ActivationLayerInfo::ActivationFunction::RELU, 2.1F, 1.3F});
241 return post_ops;
242}
SiCongLi1af54162021-10-06 15:25:57 +0100243/** Different Post Op Lists */
244const auto post_op_lists = framework::dataset::make("post_op_lists", {
245 post_ops_1(),
246 post_ops_2(),
247 post_ops_3(),
ramelg016049eda2021-10-29 10:52:53 +0100248 post_ops_4(),
249 post_ops_5()
SiCongLi1af54162021-10-06 15:25:57 +0100250 } );
251
SiCongLieb8bd812021-10-29 15:05:49 +0100252bool is_post_op_list_valid(unsigned int m, unsigned int n, unsigned int k, unsigned int batch, DataType data_type, const experimental::PostOpList<ITensorInfo*>& post_ops)
253{
254 const auto lhs_info = GEMMLHSMatrixInfo(4,4,1,false,true);
255 const auto rhs_info = GEMMRHSMatrixInfo(4,4,1,true,true,false);
256
257 // Create TensorInfo for post op arguments
258 TensorInfo input0_info(TensorShape(k, m, batch), 1, data_type);
259 TensorInfo input1_info(TensorShape(n, k, batch), 1, data_type);
260 TensorInfo input2_info(TensorShape(n), 1, data_type);
261 TensorInfo output_info(TensorShape(n, m, batch), 1, data_type);
262
263 const TensorInfo reshaped_input0_info = input0_info.clone()->set_tensor_shape(misc::shape_calculator::compute_lhs_reshaped_shape(input0_info, lhs_info));
264 const TensorInfo reshaped_input1_info = input1_info.clone()->set_tensor_shape(misc::shape_calculator::compute_rhs_reshaped_shape(input1_info, rhs_info));
265
266 GEMMKernelInfo gemm_info(m, n, k, 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 */,
270 false /**< has pad y */,
271 ActivationLayerInfo::ActivationFunction::IDENTITY,
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 lhs_info,
275 rhs_info,
276 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 post_ops);
279 return bool(ClGemmMatrixMultiplyReshapedKernel::validate(&reshaped_input0_info.clone()->set_is_resizable(true),
280 &reshaped_input1_info.clone()->set_is_resizable(true),
281 &input2_info.clone()->set_is_resizable(true),
282 &output_info.clone()->set_is_resizable(true),1.f,1.f,
283 lhs_info,
284 rhs_info,
285 gemm_info));
286}
287
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000288} // namespace
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000289
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000290TEST_SUITE(CL)
291TEST_SUITE(GEMMMatrixMultiplyReshaped)
morgolockaba2f912020-05-05 16:28:19 +0100292
293// *INDENT-OFF*
294// clang-format off
295DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
296 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // OK
297 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK
298 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8), // Data type not supported
299 TensorInfo(TensorShape(10U, 5U, 2U), 1, DataType::F32), // Incorrect dimension bias
300 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // Mismatching shapes
301 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, do not broadcast bias
302 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, wider accummulation
303 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, RHS 4,4,2
304
305 }),
306 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32),
307 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
308 TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8),
309 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32),
310 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
311 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
312 TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16),
313 TensorInfo(TensorShape(128U, 3U, 2U), 1, DataType::F16),
314
315 })),
316 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(21U), 1, DataType::F32),
317 TensorInfo(TensorShape(21U), 1, DataType::F16),
318 TensorInfo(TensorShape(21U), 1, DataType::QASYMM8),
319 TensorInfo(TensorShape(21U), 1, DataType::F32),
320 TensorInfo(TensorShape(21U), 1, DataType::F32),
321 TensorInfo(TensorShape(21U,17U), 1, DataType::F16),
322 TensorInfo(TensorShape(21U,17U), 1, DataType::F16),
323 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
324
325 })),
326 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
327 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
328 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::QASYMM8),
329 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
330 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32),
331 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
332 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
333 TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16),
334
335 })),
336 framework::dataset::make("LHSMInfo",{
337 GEMMLHSMatrixInfo(4,4,1,false,true),
338 GEMMLHSMatrixInfo(4,4,1,false,true),
339 GEMMLHSMatrixInfo(4,4,1,false,true),
340 GEMMLHSMatrixInfo(4,2,4,false,false),
341 GEMMLHSMatrixInfo(4,2,4,false,false),
342 GEMMLHSMatrixInfo(4,4,1,false,true),
343 GEMMLHSMatrixInfo(4,4,1,false,true),
344 GEMMLHSMatrixInfo(4,4,1,false,true),
345
346 })),
347 framework::dataset::make("RHSMInfo",{
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100348 GEMMRHSMatrixInfo(4,4,1,true,true,false),
349 GEMMRHSMatrixInfo(4,4,1,true,true,false),
350 GEMMRHSMatrixInfo(4,4,1,true,true,false),
351 GEMMRHSMatrixInfo(2,2,1,true,false,false),
352 GEMMRHSMatrixInfo(2,2,1,true,false,false),
353 GEMMRHSMatrixInfo(4,4,1,true,true,false),
354 GEMMRHSMatrixInfo(4,4,1,true,true,false),
355 GEMMRHSMatrixInfo(4,4,2,true,false,false),
morgolockaba2f912020-05-05 16:28:19 +0100356
357
358 })),
359
360
361 framework::dataset::make("GEMMInfo",{
362 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
363 21 /**<N Number of RHS columns*/,
364 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
365 false /**< reinterpret the input as 3D */,
366 true /**< Flag used to broadcast the bias addition */,
367 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100368 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100369 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
370 1 /**< Multiplication factor for the width of the 1xW transposed block */,
371 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
372 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100373 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100374 0 /**< Offset to be added to each element of the matrix A */,
375 0 /**< Offset to be added to each element of the matrix B */),
376
377 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
378 21 /**<N Number of RHS columns*/,
379 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
380 false /**< reinterpret the input as 3D */,
381 true /**< Flag used to broadcast the bias addition */,
382 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100383 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100384 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
385 1 /**< Multiplication factor for the width of the 1xW transposed block */,
386 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
387 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100388 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100389 0 /**< Offset to be added to each element of the matrix A */,
390 0 /**< Offset to be added to each element of the matrix B */),
391 GEMMKernelInfo(),
392 GEMMKernelInfo(),
393 GEMMKernelInfo(),
394
395 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
396 21 /**<N Number of RHS columns*/,
397 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
398 false /**< reinterpret the input as 3D */,
399 false /**< Flag used to broadcast the bias addition */,
400 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100401 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100402 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
403 1 /**< Multiplication factor for the width of the 1xW transposed block */,
404 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
405 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100406 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100407 0 /**< Offset to be added to each element of the matrix A */,
408 0 /**< Offset to be added to each element of the matrix B */),
409
410
411 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
412 21 /**<N Number of RHS columns*/,
413 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
414 false /**< reinterpret the input as 3D */,
415 false /**< Flag used to broadcast the bias addition */,
416 true /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100417 true /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100418 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
419 1 /**< Multiplication factor for the width of the 1xW transposed block */,
420 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
421 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100422 GEMMRHSMatrixInfo(4,4,1,true,true,false),
morgolockaba2f912020-05-05 16:28:19 +0100423 0 /**< Offset to be added to each element of the matrix A */,
424 0 /**< Offset to be added to each element of the matrix B */),
425
426 GEMMKernelInfo( 17 /**<M Number of LHS rows*/,
427 21 /**<N Number of RHS columns*/,
428 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
429 false /**< reinterpret the input as 3D */,
430 false /**< Flag used to broadcast the bias addition */,
431 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100432 false /**< has pad y */,
morgolockaba2f912020-05-05 16:28:19 +0100433 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
434 1 /**< Multiplication factor for the width of the 1xW transposed block */,
435 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
436 GEMMLHSMatrixInfo(4,4,1,false,true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100437 GEMMRHSMatrixInfo(4,4,2,true,false,false),
morgolockaba2f912020-05-05 16:28:19 +0100438 0 /**< Offset to be added to each element of the matrix A */,
439 0 /**< Offset to be added to each element of the matrix B */),
440 })),
441 framework::dataset::make("Expected", { true, true, false, false, false, true, true,true})),
442 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
443{
SiCongLi1af54162021-10-06 15:25:57 +0100444 ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
morgolockaba2f912020-05-05 16:28:19 +0100445 &input1_info.clone()->set_is_resizable(true),
446 &input2_info.clone()->set_is_resizable(true),
447 &output_info.clone()->set_is_resizable(true),1.f,1.f,
448 lhs_info,
449 rhs_info,
450 gemm_info)) == expected, framework::LogLevel::ERRORS);
451}
SiCongLieb8bd812021-10-29 15:05:49 +0100452TEST_SUITE(ValidateFusedPostOpsConfigs)
453TEST_SUITE(Invalid)
454TEST_CASE(UnsupportedPostOpSequence, framework::DatasetMode::ALL)
SiCongLi1af54162021-10-06 15:25:57 +0100455{
SiCongLieb8bd812021-10-29 15:05:49 +0100456 const auto data_type = DataType::F32;
457 const unsigned int m = 17;
458 const unsigned int n = 1;
459 const unsigned int k = 13;
460 const unsigned int batch = 2;
461 TensorShape post_op_arg0_shape(n, m, batch);
462 TensorInfo post_op_arg_info(post_op_arg0_shape, 1, data_type);
463 auto post_op_arg1_info = post_op_arg_info.clone();
464
465 // Unsupported sequence of post ops
466 experimental::PostOpList<ITensorInfo*> post_ops{};
467 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>(
468 &post_op_arg_info,
469 1,
470 ConvertPolicy::SATURATE);
471 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>(
472 post_op_arg1_info.get(),
473 0,
474 ConvertPolicy::SATURATE);
475
476 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == false, framework::LogLevel::ERRORS);
SiCongLi1af54162021-10-06 15:25:57 +0100477}
SiCongLieb8bd812021-10-29 15:05:49 +0100478TEST_CASE(OutputWidened, framework::DatasetMode::ALL)
479{
480 // Invalid broadcast: post op tensors "widen" the output tensor
481 const auto data_type = DataType::F32;
482 const unsigned int m = 17;
483 const unsigned int n = 1;
484 const unsigned int k = 13;
485 const unsigned int batch = 2;
486 TensorShape post_op_arg_shape(n + 4, m, batch); // output's X dimension (n) is "widened", which is not allowed
487 TensorInfo post_op_arg_info(post_op_arg_shape, 1, data_type);
488 experimental::PostOpList<ITensorInfo*> post_ops{};
489 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>( &post_op_arg_info, 0, ConvertPolicy::SATURATE);
490
491 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == false, framework::LogLevel::ERRORS);
492}
493TEST_CASE(BroadcastInXDimOnly, framework::DatasetMode::ALL)
494{
495 // Invalid broadcast: post op tensors broadcast in the first dimension (X) only
496 const auto data_type = DataType::F32;
497 const unsigned int m = 22;
498 const unsigned int n = 16;
499 const unsigned int k = 15;
500 const unsigned int batch = 3;
501 TensorShape post_op_arg_shape(1, m, batch);
502 TensorInfo post_op_arg_info(post_op_arg_shape, 1, data_type);
503 experimental::PostOpList<ITensorInfo*> post_ops{};
504 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>( &post_op_arg_info, 0, ConvertPolicy::SATURATE);
505
506 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == false, framework::LogLevel::ERRORS);
507}
ramelg016049eda2021-10-29 10:52:53 +0100508TEST_SUITE_END() // Invalid
SiCongLieb8bd812021-10-29 15:05:49 +0100509TEST_SUITE(Valid)
510TEST_CASE(EmptyPostOpList, framework::DatasetMode::ALL)
511{
512 const auto data_type = DataType::F32;
513 const unsigned int m = 22;
514 const unsigned int n = 16;
515 const unsigned int k = 15;
516 const unsigned int batch = 3;
517 experimental::PostOpList<ITensorInfo*> post_ops{};
518
519 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == true, framework::LogLevel::ERRORS);
520}
521TEST_CASE(BroadcastInYDimOnly, framework::DatasetMode::ALL)
522{
523 const auto data_type = DataType::F32;
524 const unsigned int m = 22;
525 const unsigned int n = 16;
526 const unsigned int k = 15;
527 const unsigned int batch = 3;
528 TensorShape post_op_arg_shape(n, 1, batch);
529 TensorInfo post_op_arg_info(post_op_arg_shape, 1, data_type);
530 experimental::PostOpList<ITensorInfo*> post_ops{};
531 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>( &post_op_arg_info, 0, ConvertPolicy::SATURATE);
532
533 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == true, framework::LogLevel::ERRORS);
534}
535TEST_CASE(BroadcastInBothXandYDims, framework::DatasetMode::ALL)
536{
537 const auto data_type = DataType::F32;
538 const unsigned int m = 22;
539 const unsigned int n = 16;
540 const unsigned int k = 15;
541 const unsigned int batch = 3;
542 TensorShape post_op_arg_shape(1, 1, batch);
543 TensorInfo post_op_arg_info(post_op_arg_shape, 1, data_type);
544 experimental::PostOpList<ITensorInfo*> post_ops{};
545 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>( &post_op_arg_info, 0, ConvertPolicy::SATURATE);
546
547 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == true, framework::LogLevel::ERRORS);
548}
549TEST_CASE(BroadcastInAllDims, framework::DatasetMode::ALL)
550{
551 const auto data_type = DataType::F32;
552 const unsigned int m = 22;
553 const unsigned int n = 16;
554 const unsigned int k = 15;
555 const unsigned int batch = 3;
556 TensorShape post_op_arg_shape(1, 1, 1);
557 TensorInfo post_op_arg_info(post_op_arg_shape, 1, data_type);
558 experimental::PostOpList<ITensorInfo*> post_ops{};
559 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>( &post_op_arg_info, 0, ConvertPolicy::SATURATE);
560
561 ARM_COMPUTE_EXPECT(is_post_op_list_valid(m, n, k, batch, data_type, post_ops) == true, framework::LogLevel::ERRORS);
562}
563TEST_SUITE_END() // Valid
564TEST_SUITE_END() // ValidateFusedPostOps
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000565TEST_SUITE(Float)
566TEST_SUITE(FP32)
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000567
568FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100569 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 +0000570 m_values,
571 n_values),
572 k_values),
573 b_values),
574 m0_values_precommit),
575 n0_values_precommit),
576 k0_values_precommit),
577 v0_values_precommit),
578 h0_values_precommit),
579 i_values_lhs),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000580 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100581 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000582 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100583 a_values_precommit),
584 beta_values_precommit),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100585 broadcast_bias_values),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100586 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100587 act_values))
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000588{
589 // Validate output
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000590 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000591}
592
Michalis Spyrou1d897772019-12-09 18:47:29 +0000593FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100594 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 +0000595 m_values,
596 n_values),
597 k_values),
598 b_values),
599 m0_values_nightly),
600 n0_values_nightly),
601 k0_values_nightly),
602 v0_values_nightly),
603 h0_values_nightly),
604 i_values_lhs),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000605 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100606 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000607 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100608 a_values_nightly),
609 beta_values_nightly),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100610 broadcast_bias_values),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100611 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100612 act_values))
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000613{
614 // Validate output
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000615 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +0000616}
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000617
618FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100619 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 +0000620 m_w_values,
621 m_h_values),
622 n_values),
623 k_values),
624 b_values),
625 m0_values_precommit),
626 n0_values_precommit),
627 k0_values_precommit),
628 v0_values_precommit),
629 h0_values_precommit),
630 i_values_lhs),
631 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100632 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000633 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100634 a_values_precommit),
635 beta_values_precommit),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100636 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100637 act_values))
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000638{
639 // Validate output
640 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
641}
642
Michalis Spyrou1d897772019-12-09 18:47:29 +0000643FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100644 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 +0000645 m_w_values,
646 m_h_values),
647 n_values),
648 k_values),
649 b_values),
650 m0_values_nightly),
651 n0_values_nightly),
652 k0_values_nightly),
653 v0_values_nightly),
654 h0_values_nightly),
655 i_values_lhs),
656 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100657 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000658 framework::dataset::make("DataType", DataType::F32)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +0100659 a_values_nightly),
660 beta_values_nightly),
Giorgio Arenaae99b6e2019-08-01 14:22:12 +0100661 lhs_transpose_values),
Gian Marco Iodiceca1f4602019-07-16 15:46:48 +0100662 act_values))
Gian Marco Iodice9382ab32018-12-17 15:12:07 +0000663{
664 // Validate output
665 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
666}
SiCongLi1af54162021-10-06 15:25:57 +0100667TEST_SUITE(FusedPostOps)
668
669FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedWithPostOpsFixture<float>, framework::DatasetMode::ALL,
670 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
671 m_values,
672 n_values),
673 k_values),
674 b_values),
675 m0_values_precommit),
676 n0_values_precommit),
677 k0_values_precommit),
678 v0_values_precommit),
679 h0_values_precommit),
680 framework::dataset::make("interleave_lhs", { false })),
681 framework::dataset::make("interleave_rhs", { false })),
682 framework::dataset::make("export_to_cl_image_rhs", false)),
683 framework::dataset::make("DataType", DataType::F32)),
684 a_values_precommit),
685 beta_values_precommit),
686 framework::dataset::make("broadcast_bias", { true } )),
687 lhs_transpose_values),
688 act_values),
689 post_op_lists)
690 )
691{
692 // Validate output
693 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
694}
695
696TEST_SUITE_END() // FusedPostOps
697
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100698TEST_SUITE(ExportToCLImage)
699DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
700 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported
701 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported
702 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported
703 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect k0
704 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect n0
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100705
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100706 }),
707 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
708 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
709 TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F32),
710 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32),
711 TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F32),
Gian Marco Iodice05639f62019-09-24 12:05:06 +0100712
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100713 })),
714 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(64U), 1, DataType::F32),
715 TensorInfo(TensorShape(64U), 1, DataType::F32),
716 TensorInfo(TensorShape(64U), 1, DataType::F32),
717 TensorInfo(TensorShape(64U), 1, DataType::F32),
718 TensorInfo(TensorShape(64U), 1, DataType::F32),
719
720 })),
721 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
722 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
723 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
724 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
725 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
726 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32),
727
728 })),
729 framework::dataset::make("LHSMInfo",{
730 GEMMLHSMatrixInfo(4, 4, 1, false, true),
731 GEMMLHSMatrixInfo(4, 8, 1, false, true),
732 GEMMLHSMatrixInfo(4, 4, 1, false, true),
733 GEMMLHSMatrixInfo(4, 2, 1, false, false),
734 GEMMLHSMatrixInfo(4, 4, 1, false, false),
735
736 })),
737 framework::dataset::make("RHSMInfo",{
738 GEMMRHSMatrixInfo(4, 4, 1, true, true, true),
739 GEMMRHSMatrixInfo(4, 8, 1, true, true, true),
740 GEMMRHSMatrixInfo(8, 4, 1, true, true, true),
741 GEMMRHSMatrixInfo(4, 2, 1, true, false, true),
742 GEMMRHSMatrixInfo(2, 4, 1, true, false, true),
743 })),
744 framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
745 64 /**<N Number of RHS columns*/,
746 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
747 false /**< reinterpret the input as 3D */,
748 true /**< Flag used to broadcast the bias addition */,
749 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100750 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100751 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
752 1 /**< Multiplication factor for the width of the 1xW transposed block */,
753 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
754 GEMMLHSMatrixInfo(),
755 GEMMRHSMatrixInfo(),
756 0 /**< Offset to be added to each element of the matrix A */,
757 0 /**< Offset to be added to each element of the matrix B */),
758 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
759 64 /**<N Number of RHS columns*/,
760 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
761 false /**< reinterpret the input as 3D */,
762 true /**< Flag used to broadcast the bias addition */,
763 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100764 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100765 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
766 1 /**< Multiplication factor for the width of the 1xW transposed block */,
767 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
768 GEMMLHSMatrixInfo(),
769 GEMMRHSMatrixInfo(),
770 0 /**< Offset to be added to each element of the matrix A */,
771 0 /**< Offset to be added to each element of the matrix B */),
772 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
773 64 /**<N Number of RHS columns*/,
774 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
775 false /**< reinterpret the input as 3D */,
776 true /**< Flag used to broadcast the bias addition */,
777 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100778 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100779 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
780 1 /**< Multiplication factor for the width of the 1xW transposed block */,
781 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
782 GEMMLHSMatrixInfo(),
783 GEMMRHSMatrixInfo(),
784 0 /**< Offset to be added to each element of the matrix A */,
785 0 /**< Offset to be added to each element of the matrix B */),
786
787 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
788 64 /**<N Number of RHS columns*/,
789 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
790 false /**< reinterpret the input as 3D */,
791 true /**< Flag used to broadcast the bias addition */,
792 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100793 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100794 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
795 1 /**< Multiplication factor for the width of the 1xW transposed block */,
796 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
797 GEMMLHSMatrixInfo(),
798 GEMMRHSMatrixInfo(),
799 0 /**< Offset to be added to each element of the matrix A */,
800 0 /**< Offset to be added to each element of the matrix B */),
801 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
802 64 /**<N Number of RHS columns*/,
803 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
804 false /**< reinterpret the input as 3D */,
805 true /**< Flag used to broadcast the bias addition */,
806 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +0100807 false /**< has pad y */,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100808 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
809 1 /**< Multiplication factor for the width of the 1xW transposed block */,
810 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
811 GEMMLHSMatrixInfo(),
812 GEMMRHSMatrixInfo(),
813 0 /**< Offset to be added to each element of the matrix A */,
814 0 /**< Offset to be added to each element of the matrix B */)
815 })),
816 framework::dataset::make("Expected", { true,
817 true,
818 true,
819 false,
820 false})),
821 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
822{
Georgios Pinitas856f66e2021-04-22 21:13:21 +0100823 ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100824 &input1_info.clone()->set_is_resizable(true),
825 &input2_info.clone()->set_is_resizable(true),
826 &output_info.clone()->set_is_resizable(true),1.f,1.f,
827 lhs_info,
828 rhs_info,
829 gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS);
830}
831
832FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL,
833 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 +0100834 m_values,
835 n_values),
836 k_values),
837 b_values),
838 m0_values_precommit),
839 n0_values_precommit),
840 k0_values_precommit),
841 v0_values_precommit),
842 h0_values_precommit),
843 i_values_lhs),
844 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100845 framework::dataset::make("export_to_cl_image_rhs", true)),
846 framework::dataset::make("DataType", DataType::F32)),
847 a_values_precommit),
848 beta_values_precommit),
849 broadcast_bias_values),
850 lhs_transpose_values),
851 act_values))
852{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000853 // Validate output only if validate() is successful
854 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100855 {
856 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
857 }
858 else
859 {
860 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
861 framework::ARM_COMPUTE_PRINT_INFO();
862 }
863
864}
865
866FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::NIGHTLY,
867 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
868 m_values,
869 n_values),
870 k_values),
871 b_values),
872 m0_values_nightly),
873 n0_export_to_cl_image_values_nightly),
874 k0_export_to_cl_image_values_nightly),
875 v0_values_nightly),
876 h0_values_nightly),
877 i_values_lhs),
878 i_values_rhs),
879 framework::dataset::make("export_to_cl_image_rhs", true)),
880 framework::dataset::make("DataType", DataType::F32)),
881 a_values_nightly),
882 beta_values_nightly),
883 broadcast_bias_values),
884 lhs_transpose_values),
885 act_values))
886{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000887 // Validate output only if validate() is successful
888 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100889 {
890 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
891 }
892 else
893 {
894 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
895 framework::ARM_COMPUTE_PRINT_INFO();
896 }
897}
898
899FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL,
900 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
901 m_w_values,
902 m_h_values),
903 n_values),
904 k_values),
905 b_values),
906 m0_values_precommit),
907 n0_values_precommit),
908 k0_values_precommit),
909 v0_values_precommit),
910 h0_values_precommit),
911 i_values_lhs),
912 i_values_rhs),
913 framework::dataset::make("export_to_cl_image_rhs", true)),
914 framework::dataset::make("DataType", DataType::F32)),
915 a_values_precommit),
916 beta_values_precommit),
917 lhs_transpose_values),
918 act_values))
919{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000920 // Validate output only if validate() is successful
921 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100922 {
923 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
924 }
925 else
926 {
927 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
928 framework::ARM_COMPUTE_PRINT_INFO();
929 }
930}
931
932FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::NIGHTLY,
933 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
934 m_w_values,
935 m_h_values),
936 n_values),
937 k_values),
938 b_values),
939 m0_values_nightly),
940 n0_export_to_cl_image_values_nightly),
941 k0_export_to_cl_image_values_nightly),
942 v0_values_nightly),
943 h0_values_nightly),
944 i_values_lhs),
945 i_values_rhs),
946 framework::dataset::make("export_to_cl_image_rhs", true)),
947 framework::dataset::make("DataType", DataType::F32)),
948 a_values_nightly),
949 beta_values_nightly),
950 lhs_transpose_values),
951 act_values))
952{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +0000953 // Validate output only if validate() is successful
954 if(validate_result)
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +0100955 {
956 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
957 }
958 else
959 {
960 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
961 framework::ARM_COMPUTE_PRINT_INFO();
962 }
963}
SiCongLi1af54162021-10-06 15:25:57 +0100964TEST_SUITE(FusedPostOps)
965
966FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedWithPostOpsFixture<float>, framework::DatasetMode::ALL,
967 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
968 m_values,
969 n_values),
970 k_values),
971 b_values),
972 m0_values_precommit),
973 n0_values_precommit),
974 k0_values_precommit),
975 v0_values_precommit),
976 h0_values_precommit),
977 framework::dataset::make("interleave_lhs", { false })),
978 framework::dataset::make("interleave_rhs", { false })),
979 framework::dataset::make("export_to_cl_image_rhs", true)),
980 framework::dataset::make("DataType", DataType::F32)),
981 a_values_precommit),
982 beta_values_precommit),
983 framework::dataset::make("broadcast_bias", { true } )),
984 lhs_transpose_values),
985 act_values),
986 post_op_lists)
987 )
988{
989 // Validate output only if validate() is successful
990 if(validate_result)
991 {
992 validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32);
993 }
994 else
995 {
996 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
997 framework::ARM_COMPUTE_PRINT_INFO();
998 }
999}
1000
1001TEST_SUITE_END() // FusedPostOps
1002
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001003TEST_SUITE_END() // ExportToCLImage
1004TEST_SUITE_END() // FP32
1005
1006TEST_SUITE(FP16)
1007
1008FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL,
1009 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1010 m_values,
1011 n_values),
1012 k_values),
1013 b_values),
1014 m0_values_precommit),
1015 n0_values_precommit),
1016 k0_values_precommit),
1017 v0_values_precommit),
1018 h0_values_precommit),
1019 i_values_lhs),
1020 i_values_rhs),
1021 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001022 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001023 a_values_precommit),
1024 beta_values_precommit),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001025 broadcast_bias_values),
1026 lhs_transpose_values),
1027 act_values))
1028{
1029 // Validate output
1030 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1031}
1032
Michalis Spyrou1d897772019-12-09 18:47:29 +00001033FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001034 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 +01001035 m_values,
1036 n_values),
1037 k_values),
1038 b_values),
1039 m0_values_nightly),
1040 n0_values_nightly),
1041 k0_values_nightly),
1042 v0_values_nightly),
1043 h0_values_nightly),
1044 i_values_lhs),
1045 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001046 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001047 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001048 a_values_nightly),
1049 beta_values_nightly),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001050 broadcast_bias_values),
1051 lhs_transpose_values),
1052 act_values))
1053{
1054 // Validate output
1055 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1056}
1057
1058FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001059 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 +01001060 m_w_values,
1061 m_h_values),
1062 n_values),
1063 k_values),
1064 b_values),
1065 m0_values_precommit),
1066 n0_values_precommit),
1067 k0_values_precommit),
1068 v0_values_precommit),
1069 h0_values_precommit),
1070 i_values_lhs),
1071 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001072 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001073 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001074 a_values_precommit),
1075 beta_values_precommit),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001076 lhs_transpose_values),
1077 act_values))
1078{
1079 // Validate output
1080 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1081}
1082
Michalis Spyrou1d897772019-12-09 18:47:29 +00001083FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::DISABLED,
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 Iodice05639f62019-09-24 12:05:06 +01001085 m_w_values,
1086 m_h_values),
1087 n_values),
1088 k_values),
1089 b_values),
1090 m0_values_nightly),
1091 n0_values_nightly),
1092 k0_values_nightly),
1093 v0_values_nightly),
1094 h0_values_nightly),
1095 i_values_lhs),
1096 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001097 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001098 framework::dataset::make("DataType", DataType::F16)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001099 a_values_nightly),
1100 beta_values_nightly),
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001101 lhs_transpose_values),
1102 act_values))
1103{
1104 // Validate output
1105 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1106}
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001107
SiCongLi1af54162021-10-06 15:25:57 +01001108TEST_SUITE(FusedPostOps)
1109
1110FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedWithPostOpsFixture<half>, framework::DatasetMode::ALL,
1111 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1112 m_values,
1113 n_values),
1114 k_values),
1115 b_values),
1116 m0_values_precommit),
1117 n0_values_precommit),
1118 k0_values_precommit),
1119 v0_values_precommit),
1120 h0_values_precommit),
1121 framework::dataset::make("interleave_lhs", { false })),
1122 framework::dataset::make("interleave_rhs", { false })),
1123 framework::dataset::make("export_to_cl_image_rhs", false)),
1124 framework::dataset::make("DataType", DataType::F16)),
1125 a_values_precommit),
1126 beta_values_precommit),
1127 framework::dataset::make("broadcast_bias", { true } )),
1128 lhs_transpose_values),
1129 act_values),
1130 post_op_lists)
1131 )
1132{
1133 // Validate output
1134 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1135}
1136
1137TEST_SUITE_END() // FusedPostOps
1138
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001139TEST_SUITE(ExportToCLImage)
1140DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
1141 framework::dataset::make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported
1142 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported
1143 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported
1144 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect k0
1145 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect n0
1146
1147 }),
1148 framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
1149 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
1150 TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F16),
1151 TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16),
1152 TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F16),
1153
1154 })),
1155 framework::dataset::make("Input2Info", { TensorInfo(TensorShape(64U), 1, DataType::F16),
1156 TensorInfo(TensorShape(64U), 1, DataType::F16),
1157 TensorInfo(TensorShape(64U), 1, DataType::F16),
1158 TensorInfo(TensorShape(64U), 1, DataType::F16),
1159 TensorInfo(TensorShape(64U), 1, DataType::F16),
1160
1161 })),
1162 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
1163 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
1164 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
1165 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
1166 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
1167 TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16),
1168
1169 })),
1170 framework::dataset::make("LHSMInfo",{
1171 GEMMLHSMatrixInfo(4, 4, 1, false, true),
1172 GEMMLHSMatrixInfo(4, 8, 1, false, true),
1173 GEMMLHSMatrixInfo(4, 4, 1, false, true),
1174 GEMMLHSMatrixInfo(4, 2, 1, false, false),
1175 GEMMLHSMatrixInfo(4, 4, 1, false, false),
1176
1177 })),
1178 framework::dataset::make("RHSMInfo",{
1179 GEMMRHSMatrixInfo(4, 4, 1, true, true, true),
1180 GEMMRHSMatrixInfo(4, 8, 1, true, true, true),
1181 GEMMRHSMatrixInfo(8, 4, 1, true, true, true),
1182 GEMMRHSMatrixInfo(4, 2, 1, true, false, true),
1183 GEMMRHSMatrixInfo(2, 4, 1, true, false, true),
1184 })),
1185 framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
1186 64 /**<N Number of RHS columns*/,
1187 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
1188 false /**< reinterpret the input as 3D */,
1189 true /**< Flag used to broadcast the bias addition */,
1190 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +01001191 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001192 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1193 1 /**< Multiplication factor for the width of the 1xW transposed block */,
1194 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
1195 GEMMLHSMatrixInfo(),
1196 GEMMRHSMatrixInfo(),
1197 0 /**< Offset to be added to each element of the matrix A */,
1198 0 /**< Offset to be added to each element of the matrix B */),
1199 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
1200 64 /**<N Number of RHS columns*/,
1201 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
1202 false /**< reinterpret the input as 3D */,
1203 true /**< Flag used to broadcast the bias addition */,
1204 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +01001205 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001206 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1207 1 /**< Multiplication factor for the width of the 1xW transposed block */,
1208 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
1209 GEMMLHSMatrixInfo(),
1210 GEMMRHSMatrixInfo(),
1211 0 /**< Offset to be added to each element of the matrix A */,
1212 0 /**< Offset to be added to each element of the matrix B */),
1213 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
1214 64 /**<N Number of RHS columns*/,
1215 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
1216 false /**< reinterpret the input as 3D */,
1217 true /**< Flag used to broadcast the bias addition */,
1218 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +01001219 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001220 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1221 1 /**< Multiplication factor for the width of the 1xW transposed block */,
1222 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
1223 GEMMLHSMatrixInfo(),
1224 GEMMRHSMatrixInfo(),
1225 0 /**< Offset to be added to each element of the matrix A */,
1226 0 /**< Offset to be added to each element of the matrix B */),
1227
1228 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
1229 64 /**<N Number of RHS columns*/,
1230 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
1231 false /**< reinterpret the input as 3D */,
1232 true /**< Flag used to broadcast the bias addition */,
1233 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +01001234 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001235 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1236 1 /**< Multiplication factor for the width of the 1xW transposed block */,
1237 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
1238 GEMMLHSMatrixInfo(),
1239 GEMMRHSMatrixInfo(),
1240 0 /**< Offset to be added to each element of the matrix A */,
1241 0 /**< Offset to be added to each element of the matrix B */),
1242 GEMMKernelInfo( 64 /**<M Number of LHS rows*/,
1243 64 /**<N Number of RHS columns*/,
1244 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */,
1245 false /**< reinterpret the input as 3D */,
1246 true /**< Flag used to broadcast the bias addition */,
1247 false /**< wider accumm */,
Gian Marco Iodice9ae06d42020-10-22 16:37:12 +01001248 false /**< has pad y */,
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001249 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1250 1 /**< Multiplication factor for the width of the 1xW transposed block */,
1251 1 /**< Multiplication factor for the height of the 4x4 interleaved block */,
1252 GEMMLHSMatrixInfo(),
1253 GEMMRHSMatrixInfo(),
1254 0 /**< Offset to be added to each element of the matrix A */,
1255 0 /**< Offset to be added to each element of the matrix B */)
1256 })),
1257 framework::dataset::make("Expected", { true,
1258 true,
1259 true,
1260 false,
1261 false})),
1262 input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected)
1263{
Georgios Pinitas856f66e2021-04-22 21:13:21 +01001264 ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true),
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001265 &input1_info.clone()->set_is_resizable(true),
1266 &input2_info.clone()->set_is_resizable(true),
1267 &output_info.clone()->set_is_resizable(true),1.f,1.f,
1268 lhs_info,
1269 rhs_info,
1270 gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS);
1271}
1272
1273FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL,
1274 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1275 m_values,
1276 n_values),
1277 k_values),
1278 b_values),
1279 m0_values_precommit),
1280 n0_values_precommit),
1281 k0_values_precommit),
1282 v0_values_precommit),
1283 h0_values_precommit),
1284 i_values_lhs),
1285 i_values_rhs),
1286 framework::dataset::make("export_to_cl_image_rhs", true)),
1287 framework::dataset::make("DataType", DataType::F16)),
1288 a_values_precommit),
1289 beta_values_precommit),
1290 broadcast_bias_values),
1291 lhs_transpose_values),
1292 act_values))
1293{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001294 // Validate output only if validate() is successful
1295 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001296 {
1297 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1298 }
1299 else
1300 {
1301 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1302 framework::ARM_COMPUTE_PRINT_INFO();
1303 }
1304
1305}
1306
1307FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::NIGHTLY,
1308 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1309 m_values,
1310 n_values),
1311 k_values),
1312 b_values),
1313 m0_values_nightly),
1314 n0_export_to_cl_image_values_nightly),
1315 k0_export_to_cl_image_values_nightly),
1316 v0_values_nightly),
1317 h0_values_nightly),
1318 i_values_lhs),
1319 i_values_rhs),
1320 framework::dataset::make("export_to_cl_image_rhs", true)),
1321 framework::dataset::make("DataType", DataType::F16)),
1322 a_values_nightly),
1323 beta_values_nightly),
1324 broadcast_bias_values),
1325 lhs_transpose_values),
1326 act_values))
1327{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001328 // Validate output only if validate() is successful
1329 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001330 {
1331 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1332 }
1333 else
1334 {
1335 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1336 framework::ARM_COMPUTE_PRINT_INFO();
1337 }
1338}
1339
1340FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL,
1341 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1342 m_w_values,
1343 m_h_values),
1344 n_values),
1345 k_values),
1346 b_values),
1347 m0_values_precommit),
1348 n0_values_precommit),
1349 k0_values_precommit),
1350 v0_values_precommit),
1351 h0_values_precommit),
1352 i_values_lhs),
1353 i_values_rhs),
1354 framework::dataset::make("export_to_cl_image_rhs", true)),
1355 framework::dataset::make("DataType", DataType::F16)),
1356 a_values_precommit),
1357 beta_values_precommit),
1358 lhs_transpose_values),
1359 act_values))
1360{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001361 // Validate output only if validate() is successful
1362 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001363 {
1364 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1365 }
1366 else
1367 {
1368 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1369 framework::ARM_COMPUTE_PRINT_INFO();
1370 }
1371}
1372
1373FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::NIGHTLY,
1374 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1375 m_w_values,
1376 m_h_values),
1377 n_values),
1378 k_values),
1379 b_values),
1380 m0_values_nightly),
1381 n0_export_to_cl_image_values_nightly),
1382 k0_export_to_cl_image_values_nightly),
1383 v0_values_nightly),
1384 h0_values_nightly),
1385 i_values_lhs),
1386 i_values_rhs),
1387 framework::dataset::make("export_to_cl_image_rhs", true)),
1388 framework::dataset::make("DataType", DataType::F16)),
1389 a_values_nightly),
1390 beta_values_nightly),
1391 lhs_transpose_values),
1392 act_values))
1393{
Sheri Zhangcc3e53c2020-11-16 21:17:28 +00001394 // Validate output only if validate() is successful
1395 if(validate_result)
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001396 {
1397 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1398 }
1399 else
1400 {
1401 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1402 framework::ARM_COMPUTE_PRINT_INFO();
1403 }
1404}
SiCongLi1af54162021-10-06 15:25:57 +01001405TEST_SUITE(FusedPostOps)
1406
1407FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedWithPostOpsFixture<half>, framework::DatasetMode::ALL,
1408 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1409 m_values,
1410 n_values),
1411 k_values),
1412 b_values),
1413 m0_values_precommit),
1414 n0_values_precommit),
1415 k0_values_precommit),
1416 v0_values_precommit),
1417 h0_values_precommit),
1418 framework::dataset::make("interleave_lhs", { false })),
1419 framework::dataset::make("interleave_rhs", { false })),
1420 framework::dataset::make("export_to_cl_image_rhs", true)),
1421 framework::dataset::make("DataType", DataType::F16)),
1422 a_values_precommit),
1423 beta_values_precommit),
1424 framework::dataset::make("broadcast_bias", { true } )),
1425 lhs_transpose_values),
1426 act_values),
1427 post_op_lists)
1428 )
1429{
1430 // Validate output only if validate() is successful
1431 if(validate_result)
1432 {
1433 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1434 }
1435 else
1436 {
1437 ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped");
1438 framework::ARM_COMPUTE_PRINT_INFO();
1439 }
1440}
1441
1442TEST_SUITE_END() // FusedPostOps
1443
Gian Marco Iodice6f931342020-09-15 14:17:41 +01001444TEST_SUITE_END() // ExportToCLImage
Gian Marco Iodice05639f62019-09-24 12:05:06 +01001445TEST_SUITE_END() // FP16
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001446
1447TEST_SUITE(MixedPrecision)
1448
1449FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001450 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 +01001451 m_values,
1452 n_values),
1453 k_values),
1454 b_values),
1455 m0_values_precommit),
1456 n0_values_precommit),
1457 k0_values_precommit),
1458 v0_values_precommit),
1459 h0_values_precommit),
1460 i_values_lhs),
1461 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001462 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001463 framework::dataset::make("DataType", DataType::F16)),
1464 a_values_precommit),
1465 beta_values_precommit),
1466 broadcast_bias_values),
1467 lhs_transpose_values),
1468 act_values))
1469{
1470 // Validate output
1471 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1472}
1473
Michalis Spyrou1d897772019-12-09 18:47:29 +00001474FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001475 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 +01001476 m_values,
1477 n_values),
1478 k_values),
1479 b_values),
1480 m0_values_nightly),
1481 n0_values_nightly),
1482 k0_values_nightly),
1483 v0_values_nightly),
1484 h0_values_nightly),
1485 i_values_lhs),
1486 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001487 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001488 framework::dataset::make("DataType", DataType::F16)),
1489 a_values_nightly),
1490 beta_values_nightly),
1491 broadcast_bias_values),
1492 lhs_transpose_values),
1493 act_values))
1494{
1495 // Validate output
1496 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1497}
1498
1499FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::ALL,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001500 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 +01001501 m_w_values,
1502 m_h_values),
1503 n_values),
1504 k_values),
1505 b_values),
1506 m0_values_precommit),
1507 n0_values_precommit),
1508 k0_values_precommit),
1509 v0_values_precommit),
1510 h0_values_precommit),
1511 i_values_lhs),
1512 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001513 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001514 framework::dataset::make("DataType", DataType::F16)),
1515 a_values_precommit),
1516 beta_values_precommit),
1517 lhs_transpose_values),
1518 act_values))
1519{
1520 // Validate output
1521 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1522}
1523
Michalis Spyrou1d897772019-12-09 18:47:29 +00001524FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED,
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001525 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 +01001526 m_w_values,
1527 m_h_values),
1528 n_values),
1529 k_values),
1530 b_values),
1531 m0_values_nightly),
1532 n0_values_nightly),
1533 k0_values_nightly),
1534 v0_values_nightly),
1535 h0_values_nightly),
1536 i_values_lhs),
1537 i_values_rhs),
Gian Marco Iodicee3a849a2020-06-10 17:59:30 +01001538 framework::dataset::make("export_to_cl_image_rhs", false)),
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001539 framework::dataset::make("DataType", DataType::F16)),
1540 a_values_nightly),
1541 beta_values_nightly),
1542 lhs_transpose_values),
1543 act_values))
1544{
1545 // Validate output
1546 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1547}
SiCongLi1af54162021-10-06 15:25:57 +01001548
1549TEST_SUITE(FusedPostOps)
1550
1551FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedMixedPrecisionWithPostOpsFixture<half>, framework::DatasetMode::ALL,
1552 combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(
1553 m_values,
1554 n_values),
1555 k_values),
1556 b_values),
1557 m0_values_precommit),
1558 n0_values_precommit),
1559 k0_values_precommit),
1560 v0_values_precommit),
1561 h0_values_precommit),
1562 framework::dataset::make("interleave_lhs", { false })),
1563 framework::dataset::make("interleave_rhs", { false })),
1564 framework::dataset::make("export_to_cl_image_rhs", { true, false })),
1565 framework::dataset::make("DataType", DataType::F16)),
1566 a_values_precommit),
1567 beta_values_precommit),
1568 framework::dataset::make("broadcast_bias", { true } )),
1569 lhs_transpose_values),
1570 act_values),
1571 post_op_lists)
1572 )
1573{
1574 // Validate output
1575 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1576}
1577
1578TEST_SUITE_END() // FusedPostOps
1579
Gian Marco Iodice0c17aa22019-09-27 09:23:15 +01001580TEST_SUITE_END() // MixedPrecision
Gian Marco Iodice9382ab32018-12-17 15:12:07 +00001581TEST_SUITE_END() // Float
Gian Marco Iodiced1f54762019-07-19 09:54:47 +01001582TEST_SUITE_END() // GEMMMatrixMultiplyReshaped
Gian Marco Iodicebf9731e2018-12-12 10:18:04 +00001583TEST_SUITE_END() // CL
1584} // namespace validation
1585} // namespace test
Michele Di Giorgio2568c6b2019-09-17 12:08:46 +01001586} // namespace arm_compute