Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2020 Arm Limited. |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 3 | * |
| 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 Iodice | 7026b30 | 2019-06-26 17:18:11 +0100 | [diff] [blame] | 24 | #include "arm_compute/core/KernelDescriptors.h" |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 25 | #include "arm_compute/core/Types.h" |
| 26 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
| 27 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 28 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
Sang-Hoon Park | bef7fa2 | 2020-10-21 15:58:54 +0100 | [diff] [blame] | 29 | #include "src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.h" |
| 30 | #include "src/core/CL/kernels/CLGEMMReshapeLHSMatrixKernel.h" |
| 31 | #include "src/core/CL/kernels/CLGEMMReshapeRHSMatrixKernel.h" |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 32 | #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 | |
| 42 | namespace arm_compute |
| 43 | { |
| 44 | namespace test |
| 45 | { |
| 46 | namespace validation |
| 47 | { |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 48 | using namespace arm_compute::misc::shape_calculator; |
| 49 | |
| 50 | // Create function for CLGEMMReshapeLHSMatrixKernel |
Gian Marco Iodice | bacfec5 | 2019-01-11 11:30:55 +0000 | [diff] [blame] | 51 | using CLGEMMReshapeLHSMatrix = CLSynthetizeFunction<CLGEMMReshapeLHSMatrixKernel>; |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 52 | |
| 53 | // Create function for CLGEMMReshapeRHSMatrixKernel |
Gian Marco Iodice | bacfec5 | 2019-01-11 11:30:55 +0000 | [diff] [blame] | 54 | using CLGEMMReshapeRHSMatrix = CLSynthetizeFunction<CLGEMMReshapeRHSMatrixKernel>; |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 55 | |
| 56 | // Create function for CLGEMMMatrixMultiplyReshapedKernel |
| 57 | using CLGEMMMatrixMultiplyReshaped = CLSynthetizeFunction<CLGEMMMatrixMultiplyReshapedKernel>; |
| 58 | |
| 59 | // Fixture for CLGEMMMatrixMultiplyReshaped |
| 60 | template <typename T> |
| 61 | using CLGEMMMatrixMultiplyReshapedFixture = GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>; |
| 62 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 63 | // Fixture for CLGEMMMatrixMultiplyReshaped mixed precision |
| 64 | template <typename T> |
| 65 | using CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture = |
| 66 | GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>; |
| 67 | |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 68 | // Fixture for CLGEMMMatrixMultiplyReshaped3D |
| 69 | template <typename T> |
| 70 | using CLGEMMMatrixMultiplyReshaped3DFixture = GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>; |
| 71 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 72 | // Fixture for CLGEMMMatrixMultiplyReshaped3D mixed precision |
| 73 | template <typename T> |
| 74 | using CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture = |
| 75 | GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>; |
| 76 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 77 | namespace |
| 78 | { |
| 79 | // *INDENT-OFF* |
| 80 | // clang-format off |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 81 | RelativeTolerance<float> rel_tolerance_f32(0.001f); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 82 | constexpr float abs_tolerance_f32(0.0001f); |
| 83 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 84 | RelativeTolerance<float> rel_tolerance_f16_mixed_precision(0.001f); |
| 85 | constexpr float abs_tolerance_f16_mixed_precision(0.01f); |
| 86 | |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 87 | RelativeTolerance<float> rel_tolerance_f16(0.001f); |
| 88 | constexpr float abs_tolerance_f16(0.01f); |
| 89 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 90 | /** M values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 91 | const auto m_values = framework::dataset::make("M", 17); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 92 | |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 93 | /** M_W values to test */ |
| 94 | const auto m_w_values = framework::dataset::make("M_W", 5); |
| 95 | |
| 96 | /** M_H values to test */ |
| 97 | const auto m_h_values = framework::dataset::make("M_H", 7); |
| 98 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 99 | /** N values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 100 | const auto n_values = framework::dataset::make("N", 21); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 101 | |
| 102 | /** K values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 103 | const auto k_values = framework::dataset::make("K", 13); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 104 | |
| 105 | /** Batch size values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 106 | const auto b_values = framework::dataset::make("batch_size", 2, 3); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 107 | |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 108 | /** Activation values to test */ |
| 109 | const auto act_values = framework::dataset::make("Activation", |
| 110 | { |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 111 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f), |
| 112 | }); |
| 113 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 114 | /** Alpha values to test - Precommit */ |
| 115 | const auto a_values_precommit = framework::dataset::make("alpha", {-0.75f} ); |
| 116 | |
| 117 | /** Beta values to test - Precommit */ |
| 118 | const auto beta_values_precommit = framework::dataset::make("beta", {-0.35f} ); |
| 119 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 120 | /** M0 values to test - Precommit */ |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 121 | const auto m0_values_precommit = framework::dataset::make("M0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 122 | |
| 123 | /** N0 values to test - Precommit */ |
Gian Marco Iodice | d820db6 | 2019-08-05 14:23:23 +0100 | [diff] [blame] | 124 | const auto n0_values_precommit = framework::dataset::make("N0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 125 | |
| 126 | /** K0 values to test - Precommit */ |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 127 | const auto k0_values_precommit = framework::dataset::make("K0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 128 | |
| 129 | /** V0 values to test - Precommit */ |
| 130 | const auto v0_values_precommit = framework::dataset::make("V0", 1, 3); |
| 131 | |
| 132 | /** H0 values to test - Precommit */ |
| 133 | const auto h0_values_precommit = framework::dataset::make("H0", 1, 3); |
| 134 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 135 | /** Alpha values to test - Nightly */ |
| 136 | const auto a_values_nightly = framework::dataset::make("alpha", {1.0f} ); |
| 137 | |
| 138 | /** Beta values to test - Nightly */ |
| 139 | const auto beta_values_nightly = framework::dataset::make("beta", {1.0f} ); |
| 140 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 141 | /** M0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 142 | const auto m0_values_nightly = framework::dataset::make("M0", { 8 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 143 | |
| 144 | /** N0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 145 | const auto n0_values_nightly = framework::dataset::make("N0", { 8 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 146 | |
| 147 | /** K0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 148 | const auto k0_values_nightly = framework::dataset::make("K0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 149 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 150 | /** N0 values to test with export to OpenCL image object - Nightly */ |
| 151 | const auto n0_export_to_cl_image_values_nightly = framework::dataset::make("N0", { 4, 8, 16 }); |
| 152 | |
| 153 | /** K0 values to test with export to OpenCL image object - Nightly */ |
| 154 | const auto k0_export_to_cl_image_values_nightly = framework::dataset::make("K0", { 4, 8, 16 }); |
| 155 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 156 | /** V0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 157 | const auto v0_values_nightly = framework::dataset::make("V0", 1, 3); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 158 | |
| 159 | /** H0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 160 | const auto h0_values_nightly = framework::dataset::make("H0", 1, 3); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 161 | |
| 162 | /** Interleave values to test with LHS matrix */ |
| 163 | const auto i_values_lhs = framework::dataset::make("interleave_lhs", { true, false }); |
| 164 | |
| 165 | /** Interleave values to test with RHS matrix */ |
| 166 | const auto i_values_rhs = framework::dataset::make("interleave_rhs", { true, false }); |
| 167 | |
Gian Marco Iodice | e16c890 | 2019-06-14 16:11:10 +0100 | [diff] [blame] | 168 | /** Broadcast bias from vector to matrix */ |
Gian Marco Iodice | d820db6 | 2019-08-05 14:23:23 +0100 | [diff] [blame] | 169 | const auto broadcast_bias_values = framework::dataset::make("broadcast_bias", { false, true } ); |
Gian Marco Iodice | e16c890 | 2019-06-14 16:11:10 +0100 | [diff] [blame] | 170 | |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 171 | /** LHS transposed values */ |
| 172 | const auto lhs_transpose_values = framework::dataset::make("lhs_transpose", { false, true } ); |
Gian Marco Iodice | 088d63a | 2020-08-11 14:14:06 +0100 | [diff] [blame] | 173 | |
| 174 | /** Zero padding test */ |
| 175 | bool validate_zero_padding(unsigned int m_value, unsigned int n_value, unsigned int k_value, unsigned int b_value, |
| 176 | unsigned int m0_value, unsigned int n0_value, unsigned int k0_value, unsigned int h0_value, |
| 177 | bool i_value_rhs, bool t_value_rhs, bool export_to_cl_image, bool broadcast_bias, unsigned int depth_output_gemm3d, const ActivationLayerInfo &act_info, |
| 178 | DataType dt_input0, DataType dt_input1, DataType dt_input2, DataType dt_output, float alpha, float beta) |
| 179 | { |
| 180 | const unsigned int M = m_value; |
| 181 | const unsigned int N = n_value; |
| 182 | const unsigned int K = k_value; |
| 183 | |
| 184 | GEMMLHSMatrixInfo lhs_info; |
| 185 | lhs_info.m0 = m0_value; |
| 186 | lhs_info.k0 = k0_value; |
| 187 | |
| 188 | GEMMRHSMatrixInfo rhs_info; |
| 189 | rhs_info.n0 = n0_value; |
| 190 | rhs_info.k0 = k0_value; |
| 191 | rhs_info.h0 = h0_value; |
| 192 | rhs_info.interleave = i_value_rhs; |
| 193 | rhs_info.transpose = t_value_rhs; |
| 194 | rhs_info.export_to_cl_image = export_to_cl_image; |
| 195 | |
| 196 | GEMMKernelInfo kernel_info; |
| 197 | kernel_info.m = M; |
| 198 | kernel_info.n = N; |
| 199 | kernel_info.k = K; |
| 200 | kernel_info.depth_output_gemm3d = depth_output_gemm3d; |
| 201 | kernel_info.reinterpret_input_as_3d = false; |
| 202 | kernel_info.broadcast_bias = broadcast_bias; |
| 203 | kernel_info.activation_info = act_info; |
| 204 | |
| 205 | const TensorShape lhs_shape(K, M, b_value); |
| 206 | const TensorShape rhs_shape(N, K, b_value); |
| 207 | const TensorShape lhs_shape_reshaped = compute_lhs_reshaped_shape(TensorInfo(lhs_shape, 1, dt_input0), |
| 208 | lhs_info); |
| 209 | const TensorShape rhs_shape_reshaped = compute_rhs_reshaped_shape(TensorInfo(rhs_shape, 1, dt_input1), |
| 210 | rhs_info); |
| 211 | |
| 212 | const TensorShape dst_shape = compute_mm_shape(TensorInfo(lhs_shape_reshaped, 1, dt_input0), |
| 213 | TensorInfo(rhs_shape_reshaped, 1, dt_input1), |
| 214 | kernel_info); |
| 215 | |
| 216 | const TensorShape bias_shape(N, |
| 217 | M, // Correct calculation should be: broadcast_bias? 1 : M, it's wrong here on purpose just for validation test |
| 218 | broadcast_bias? 1 : b_value); |
| 219 | |
| 220 | // Create tensors |
| 221 | CLTensor lhs_reshaped = create_tensor<CLTensor>(lhs_shape_reshaped, dt_input0); |
| 222 | CLTensor rhs_reshaped = create_tensor<CLTensor>(rhs_shape_reshaped, dt_input1); |
| 223 | CLTensor bias = create_tensor<CLTensor>(bias_shape, dt_input2); |
| 224 | CLTensor dst = create_tensor<CLTensor>(dst_shape, dt_output); |
| 225 | |
| 226 | ARM_COMPUTE_EXPECT(lhs_reshaped.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 227 | ARM_COMPUTE_EXPECT(rhs_reshaped.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 228 | ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 229 | ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 230 | |
| 231 | // Validate zero-padding |
| 232 | CLGEMMMatrixMultiplyReshaped gemm; |
| 233 | |
| 234 | gemm.configure(&lhs_reshaped, &rhs_reshaped, &bias, &dst, alpha, beta, lhs_info, rhs_info, kernel_info); |
| 235 | |
| 236 | // Padding can be added along rhs and bias's X/Y dimension |
| 237 | return dst.info()->padding().empty() && lhs_reshaped.info()->padding().empty(); |
| 238 | } |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 239 | } // namespace |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 240 | |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 241 | TEST_SUITE(CL) |
| 242 | TEST_SUITE(GEMMMatrixMultiplyReshaped) |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 243 | |
Gian Marco Iodice | 088d63a | 2020-08-11 14:14:06 +0100 | [diff] [blame] | 244 | /** Validate zero padding tests |
| 245 | * |
| 246 | * A series of validation tests to check the zero padding requirement |
| 247 | * |
| 248 | * Checks performed in order: |
| 249 | * - No partial blocks in both x and y dimensions |
| 250 | * - Partial blocks in x dimension |
| 251 | * - Partial blocks in y dimension |
| 252 | * - Partial blocks in both x and y dimensions |
| 253 | * - Special case: partial_n0 == 9 (vstore1 should be invoked instead of vstore_partial_1) |
| 254 | */ |
| 255 | DATA_TEST_CASE(ValidateZeroPadding, framework::DatasetMode::ALL, zip(zip(zip( |
| 256 | framework::dataset::make("M", { 24, 64, 101, 1, 103 }), |
| 257 | framework::dataset::make("N", { 48, 29, 16, 121, 41 })), |
| 258 | framework::dataset::make("M0", { 4, 8, 4, 2, 4 })), |
| 259 | framework::dataset::make("N0", { 4, 4, 16, 2, 16 })), |
| 260 | m_value, n_value, m0_value, n0_value) |
| 261 | { |
| 262 | constexpr DataType dt = DataType::F32; |
| 263 | |
| 264 | bool status = validate_zero_padding(m_value, n_value, 23, 1, m0_value, n0_value, 4, 1, false, false, false, 0, 0, ActivationLayerInfo(), dt, dt, dt, dt, 1.0f, 1.0f); |
| 265 | ARM_COMPUTE_EXPECT(status, framework::LogLevel::ERRORS); |
| 266 | } |
| 267 | |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 268 | // *INDENT-OFF* |
| 269 | // clang-format off |
| 270 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
| 271 | framework::dataset::make("Input0Info", { TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // OK |
| 272 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK |
| 273 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8), // Data type not supported |
| 274 | TensorInfo(TensorShape(10U, 5U, 2U), 1, DataType::F32), // Incorrect dimension bias |
| 275 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F32), // Mismatching shapes |
| 276 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, do not broadcast bias |
| 277 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, wider accummulation |
| 278 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::F16), // OK, RHS 4,4,2 |
| 279 | |
| 280 | }), |
| 281 | framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32), |
| 282 | TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16), |
| 283 | TensorInfo(TensorShape(64U, 5U, 2U), 1, DataType::QASYMM8), |
| 284 | TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F32), |
| 285 | TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), |
| 286 | TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16), |
| 287 | TensorInfo(TensorShape(64U, 6U, 2U), 1, DataType::F16), |
| 288 | TensorInfo(TensorShape(128U, 3U, 2U), 1, DataType::F16), |
| 289 | |
| 290 | })), |
| 291 | framework::dataset::make("Input2Info", { TensorInfo(TensorShape(21U), 1, DataType::F32), |
| 292 | TensorInfo(TensorShape(21U), 1, DataType::F16), |
| 293 | TensorInfo(TensorShape(21U), 1, DataType::QASYMM8), |
| 294 | TensorInfo(TensorShape(21U), 1, DataType::F32), |
| 295 | TensorInfo(TensorShape(21U), 1, DataType::F32), |
| 296 | TensorInfo(TensorShape(21U,17U), 1, DataType::F16), |
| 297 | TensorInfo(TensorShape(21U,17U), 1, DataType::F16), |
| 298 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16), |
| 299 | |
| 300 | })), |
| 301 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32), |
| 302 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16), |
| 303 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::QASYMM8), |
| 304 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32), |
| 305 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F32), |
| 306 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16), |
| 307 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16), |
| 308 | TensorInfo(TensorShape(21U,17U,2U), 1, DataType::F16), |
| 309 | |
| 310 | })), |
| 311 | framework::dataset::make("LHSMInfo",{ |
| 312 | GEMMLHSMatrixInfo(4,4,1,false,true), |
| 313 | GEMMLHSMatrixInfo(4,4,1,false,true), |
| 314 | GEMMLHSMatrixInfo(4,4,1,false,true), |
| 315 | GEMMLHSMatrixInfo(4,2,4,false,false), |
| 316 | GEMMLHSMatrixInfo(4,2,4,false,false), |
| 317 | GEMMLHSMatrixInfo(4,4,1,false,true), |
| 318 | GEMMLHSMatrixInfo(4,4,1,false,true), |
| 319 | GEMMLHSMatrixInfo(4,4,1,false,true), |
| 320 | |
| 321 | })), |
| 322 | framework::dataset::make("RHSMInfo",{ |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 323 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
| 324 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
| 325 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
| 326 | GEMMRHSMatrixInfo(2,2,1,true,false,false), |
| 327 | GEMMRHSMatrixInfo(2,2,1,true,false,false), |
| 328 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
| 329 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
| 330 | GEMMRHSMatrixInfo(4,4,2,true,false,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 331 | |
| 332 | |
| 333 | })), |
| 334 | |
| 335 | |
| 336 | framework::dataset::make("GEMMInfo",{ |
| 337 | GEMMKernelInfo( 17 /**<M Number of LHS rows*/, |
| 338 | 21 /**<N Number of RHS columns*/, |
| 339 | 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 340 | false /**< reinterpret the input as 3D */, |
| 341 | true /**< Flag used to broadcast the bias addition */, |
| 342 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 343 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 344 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 345 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 346 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 347 | GEMMLHSMatrixInfo(4,4,1,false,true), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 348 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 349 | 0 /**< Offset to be added to each element of the matrix A */, |
| 350 | 0 /**< Offset to be added to each element of the matrix B */), |
| 351 | |
| 352 | GEMMKernelInfo( 17 /**<M Number of LHS rows*/, |
| 353 | 21 /**<N Number of RHS columns*/, |
| 354 | 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 355 | false /**< reinterpret the input as 3D */, |
| 356 | true /**< Flag used to broadcast the bias addition */, |
| 357 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 358 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 359 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 360 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 361 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 362 | GEMMLHSMatrixInfo(4,4,1,false,true), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 363 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 364 | 0 /**< Offset to be added to each element of the matrix A */, |
| 365 | 0 /**< Offset to be added to each element of the matrix B */), |
| 366 | GEMMKernelInfo(), |
| 367 | GEMMKernelInfo(), |
| 368 | GEMMKernelInfo(), |
| 369 | |
| 370 | GEMMKernelInfo( 17 /**<M Number of LHS rows*/, |
| 371 | 21 /**<N Number of RHS columns*/, |
| 372 | 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 373 | false /**< reinterpret the input as 3D */, |
| 374 | false /**< Flag used to broadcast the bias addition */, |
| 375 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 376 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 377 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 378 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 379 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 380 | GEMMLHSMatrixInfo(4,4,1,false,true), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 381 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 382 | 0 /**< Offset to be added to each element of the matrix A */, |
| 383 | 0 /**< Offset to be added to each element of the matrix B */), |
| 384 | |
| 385 | |
| 386 | GEMMKernelInfo( 17 /**<M Number of LHS rows*/, |
| 387 | 21 /**<N Number of RHS columns*/, |
| 388 | 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 389 | false /**< reinterpret the input as 3D */, |
| 390 | false /**< Flag used to broadcast the bias addition */, |
| 391 | true /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 392 | true /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 393 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 394 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 395 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 396 | GEMMLHSMatrixInfo(4,4,1,false,true), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 397 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 398 | 0 /**< Offset to be added to each element of the matrix A */, |
| 399 | 0 /**< Offset to be added to each element of the matrix B */), |
| 400 | |
| 401 | GEMMKernelInfo( 17 /**<M Number of LHS rows*/, |
| 402 | 21 /**<N Number of RHS columns*/, |
| 403 | 13 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 404 | false /**< reinterpret the input as 3D */, |
| 405 | false /**< Flag used to broadcast the bias addition */, |
| 406 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 407 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 408 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 409 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 410 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 411 | GEMMLHSMatrixInfo(4,4,1,false,true), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 412 | GEMMRHSMatrixInfo(4,4,2,true,false,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 413 | 0 /**< Offset to be added to each element of the matrix A */, |
| 414 | 0 /**< Offset to be added to each element of the matrix B */), |
| 415 | })), |
| 416 | framework::dataset::make("Expected", { true, true, false, false, false, true, true,true})), |
| 417 | input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected) |
| 418 | { |
| 419 | ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), |
| 420 | &input1_info.clone()->set_is_resizable(true), |
| 421 | &input2_info.clone()->set_is_resizable(true), |
| 422 | &output_info.clone()->set_is_resizable(true),1.f,1.f, |
| 423 | lhs_info, |
| 424 | rhs_info, |
| 425 | gemm_info)) == expected, framework::LogLevel::ERRORS); |
| 426 | } |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 427 | TEST_SUITE(Float) |
| 428 | TEST_SUITE(FP32) |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 429 | |
| 430 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 431 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 432 | m_values, |
| 433 | n_values), |
| 434 | k_values), |
| 435 | b_values), |
| 436 | m0_values_precommit), |
| 437 | n0_values_precommit), |
| 438 | k0_values_precommit), |
| 439 | v0_values_precommit), |
| 440 | h0_values_precommit), |
| 441 | i_values_lhs), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 442 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 443 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 444 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 445 | a_values_precommit), |
| 446 | beta_values_precommit), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 447 | broadcast_bias_values), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 448 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 449 | act_values)) |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 450 | { |
| 451 | // Validate output |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 452 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 453 | } |
| 454 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 455 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 456 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 457 | m_values, |
| 458 | n_values), |
| 459 | k_values), |
| 460 | b_values), |
| 461 | m0_values_nightly), |
| 462 | n0_values_nightly), |
| 463 | k0_values_nightly), |
| 464 | v0_values_nightly), |
| 465 | h0_values_nightly), |
| 466 | i_values_lhs), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 467 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 468 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 469 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 470 | a_values_nightly), |
| 471 | beta_values_nightly), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 472 | broadcast_bias_values), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 473 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 474 | act_values)) |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 475 | { |
| 476 | // Validate output |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 477 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 478 | } |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 479 | |
| 480 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 481 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 482 | m_w_values, |
| 483 | m_h_values), |
| 484 | n_values), |
| 485 | k_values), |
| 486 | b_values), |
| 487 | m0_values_precommit), |
| 488 | n0_values_precommit), |
| 489 | k0_values_precommit), |
| 490 | v0_values_precommit), |
| 491 | h0_values_precommit), |
| 492 | i_values_lhs), |
| 493 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 494 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 495 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 496 | a_values_precommit), |
| 497 | beta_values_precommit), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 498 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 499 | act_values)) |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 500 | { |
| 501 | // Validate output |
| 502 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 503 | } |
| 504 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 505 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 506 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 507 | m_w_values, |
| 508 | m_h_values), |
| 509 | n_values), |
| 510 | k_values), |
| 511 | b_values), |
| 512 | m0_values_nightly), |
| 513 | n0_values_nightly), |
| 514 | k0_values_nightly), |
| 515 | v0_values_nightly), |
| 516 | h0_values_nightly), |
| 517 | i_values_lhs), |
| 518 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 519 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 520 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 521 | a_values_nightly), |
| 522 | beta_values_nightly), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 523 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 524 | act_values)) |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 525 | { |
| 526 | // Validate output |
| 527 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 528 | } |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 529 | TEST_SUITE(ExportToCLImage) |
| 530 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
| 531 | framework::dataset::make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported |
| 532 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported |
| 533 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // OK or incorrect if cl_khr_image2d_from_buffer not supported |
| 534 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect k0 |
| 535 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), // Incorrect n0 |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 536 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 537 | }), |
| 538 | framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), |
| 539 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), |
| 540 | TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F32), |
| 541 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F32), |
| 542 | TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F32), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 543 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 544 | })), |
| 545 | framework::dataset::make("Input2Info", { TensorInfo(TensorShape(64U), 1, DataType::F32), |
| 546 | TensorInfo(TensorShape(64U), 1, DataType::F32), |
| 547 | TensorInfo(TensorShape(64U), 1, DataType::F32), |
| 548 | TensorInfo(TensorShape(64U), 1, DataType::F32), |
| 549 | TensorInfo(TensorShape(64U), 1, DataType::F32), |
| 550 | |
| 551 | })), |
| 552 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32), |
| 553 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32), |
| 554 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32), |
| 555 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32), |
| 556 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32), |
| 557 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F32), |
| 558 | |
| 559 | })), |
| 560 | framework::dataset::make("LHSMInfo",{ |
| 561 | GEMMLHSMatrixInfo(4, 4, 1, false, true), |
| 562 | GEMMLHSMatrixInfo(4, 8, 1, false, true), |
| 563 | GEMMLHSMatrixInfo(4, 4, 1, false, true), |
| 564 | GEMMLHSMatrixInfo(4, 2, 1, false, false), |
| 565 | GEMMLHSMatrixInfo(4, 4, 1, false, false), |
| 566 | |
| 567 | })), |
| 568 | framework::dataset::make("RHSMInfo",{ |
| 569 | GEMMRHSMatrixInfo(4, 4, 1, true, true, true), |
| 570 | GEMMRHSMatrixInfo(4, 8, 1, true, true, true), |
| 571 | GEMMRHSMatrixInfo(8, 4, 1, true, true, true), |
| 572 | GEMMRHSMatrixInfo(4, 2, 1, true, false, true), |
| 573 | GEMMRHSMatrixInfo(2, 4, 1, true, false, true), |
| 574 | })), |
| 575 | framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 576 | 64 /**<N Number of RHS columns*/, |
| 577 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 578 | false /**< reinterpret the input as 3D */, |
| 579 | true /**< Flag used to broadcast the bias addition */, |
| 580 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 581 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 582 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 583 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 584 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 585 | GEMMLHSMatrixInfo(), |
| 586 | GEMMRHSMatrixInfo(), |
| 587 | 0 /**< Offset to be added to each element of the matrix A */, |
| 588 | 0 /**< Offset to be added to each element of the matrix B */), |
| 589 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 590 | 64 /**<N Number of RHS columns*/, |
| 591 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 592 | false /**< reinterpret the input as 3D */, |
| 593 | true /**< Flag used to broadcast the bias addition */, |
| 594 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 595 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 596 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 597 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 598 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 599 | GEMMLHSMatrixInfo(), |
| 600 | GEMMRHSMatrixInfo(), |
| 601 | 0 /**< Offset to be added to each element of the matrix A */, |
| 602 | 0 /**< Offset to be added to each element of the matrix B */), |
| 603 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 604 | 64 /**<N Number of RHS columns*/, |
| 605 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 606 | false /**< reinterpret the input as 3D */, |
| 607 | true /**< Flag used to broadcast the bias addition */, |
| 608 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 609 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 610 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 611 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 612 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 613 | GEMMLHSMatrixInfo(), |
| 614 | GEMMRHSMatrixInfo(), |
| 615 | 0 /**< Offset to be added to each element of the matrix A */, |
| 616 | 0 /**< Offset to be added to each element of the matrix B */), |
| 617 | |
| 618 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 619 | 64 /**<N Number of RHS columns*/, |
| 620 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 621 | false /**< reinterpret the input as 3D */, |
| 622 | true /**< Flag used to broadcast the bias addition */, |
| 623 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 624 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 625 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 626 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 627 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 628 | GEMMLHSMatrixInfo(), |
| 629 | GEMMRHSMatrixInfo(), |
| 630 | 0 /**< Offset to be added to each element of the matrix A */, |
| 631 | 0 /**< Offset to be added to each element of the matrix B */), |
| 632 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 633 | 64 /**<N Number of RHS columns*/, |
| 634 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 635 | false /**< reinterpret the input as 3D */, |
| 636 | true /**< Flag used to broadcast the bias addition */, |
| 637 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 638 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 639 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 640 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 641 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 642 | GEMMLHSMatrixInfo(), |
| 643 | GEMMRHSMatrixInfo(), |
| 644 | 0 /**< Offset to be added to each element of the matrix A */, |
| 645 | 0 /**< Offset to be added to each element of the matrix B */) |
| 646 | })), |
| 647 | framework::dataset::make("Expected", { true, |
| 648 | true, |
| 649 | true, |
| 650 | false, |
| 651 | false})), |
| 652 | input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected) |
| 653 | { |
| 654 | ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), |
| 655 | &input1_info.clone()->set_is_resizable(true), |
| 656 | &input2_info.clone()->set_is_resizable(true), |
| 657 | &output_info.clone()->set_is_resizable(true),1.f,1.f, |
| 658 | lhs_info, |
| 659 | rhs_info, |
| 660 | gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS); |
| 661 | } |
| 662 | |
| 663 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL, |
| 664 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 665 | m_values, |
| 666 | n_values), |
| 667 | k_values), |
| 668 | b_values), |
| 669 | m0_values_precommit), |
| 670 | n0_values_precommit), |
| 671 | k0_values_precommit), |
| 672 | v0_values_precommit), |
| 673 | h0_values_precommit), |
| 674 | i_values_lhs), |
| 675 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 676 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 677 | framework::dataset::make("DataType", DataType::F32)), |
| 678 | a_values_precommit), |
| 679 | beta_values_precommit), |
| 680 | broadcast_bias_values), |
| 681 | lhs_transpose_values), |
| 682 | act_values)) |
| 683 | { |
| 684 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 685 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 686 | { |
| 687 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 688 | } |
| 689 | else |
| 690 | { |
| 691 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 692 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 693 | } |
| 694 | |
| 695 | } |
| 696 | |
| 697 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::NIGHTLY, |
| 698 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 699 | m_values, |
| 700 | n_values), |
| 701 | k_values), |
| 702 | b_values), |
| 703 | m0_values_nightly), |
| 704 | n0_export_to_cl_image_values_nightly), |
| 705 | k0_export_to_cl_image_values_nightly), |
| 706 | v0_values_nightly), |
| 707 | h0_values_nightly), |
| 708 | i_values_lhs), |
| 709 | i_values_rhs), |
| 710 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 711 | framework::dataset::make("DataType", DataType::F32)), |
| 712 | a_values_nightly), |
| 713 | beta_values_nightly), |
| 714 | broadcast_bias_values), |
| 715 | lhs_transpose_values), |
| 716 | act_values)) |
| 717 | { |
| 718 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 719 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 720 | { |
| 721 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 722 | } |
| 723 | else |
| 724 | { |
| 725 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 726 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 727 | } |
| 728 | } |
| 729 | |
| 730 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL, |
| 731 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 732 | m_w_values, |
| 733 | m_h_values), |
| 734 | n_values), |
| 735 | k_values), |
| 736 | b_values), |
| 737 | m0_values_precommit), |
| 738 | n0_values_precommit), |
| 739 | k0_values_precommit), |
| 740 | v0_values_precommit), |
| 741 | h0_values_precommit), |
| 742 | i_values_lhs), |
| 743 | i_values_rhs), |
| 744 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 745 | framework::dataset::make("DataType", DataType::F32)), |
| 746 | a_values_precommit), |
| 747 | beta_values_precommit), |
| 748 | lhs_transpose_values), |
| 749 | act_values)) |
| 750 | { |
| 751 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 752 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 753 | { |
| 754 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 755 | } |
| 756 | else |
| 757 | { |
| 758 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 759 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::NIGHTLY, |
| 764 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 765 | m_w_values, |
| 766 | m_h_values), |
| 767 | n_values), |
| 768 | k_values), |
| 769 | b_values), |
| 770 | m0_values_nightly), |
| 771 | n0_export_to_cl_image_values_nightly), |
| 772 | k0_export_to_cl_image_values_nightly), |
| 773 | v0_values_nightly), |
| 774 | h0_values_nightly), |
| 775 | i_values_lhs), |
| 776 | i_values_rhs), |
| 777 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 778 | framework::dataset::make("DataType", DataType::F32)), |
| 779 | a_values_nightly), |
| 780 | beta_values_nightly), |
| 781 | lhs_transpose_values), |
| 782 | act_values)) |
| 783 | { |
| 784 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 785 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 786 | { |
| 787 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 788 | } |
| 789 | else |
| 790 | { |
| 791 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 792 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 793 | } |
| 794 | } |
| 795 | TEST_SUITE_END() // ExportToCLImage |
| 796 | TEST_SUITE_END() // FP32 |
| 797 | |
| 798 | TEST_SUITE(FP16) |
| 799 | |
| 800 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL, |
| 801 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 802 | m_values, |
| 803 | n_values), |
| 804 | k_values), |
| 805 | b_values), |
| 806 | m0_values_precommit), |
| 807 | n0_values_precommit), |
| 808 | k0_values_precommit), |
| 809 | v0_values_precommit), |
| 810 | h0_values_precommit), |
| 811 | i_values_lhs), |
| 812 | i_values_rhs), |
| 813 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 814 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 815 | a_values_precommit), |
| 816 | beta_values_precommit), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 817 | broadcast_bias_values), |
| 818 | lhs_transpose_values), |
| 819 | act_values)) |
| 820 | { |
| 821 | // Validate output |
| 822 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 823 | } |
| 824 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 825 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 826 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 827 | m_values, |
| 828 | n_values), |
| 829 | k_values), |
| 830 | b_values), |
| 831 | m0_values_nightly), |
| 832 | n0_values_nightly), |
| 833 | k0_values_nightly), |
| 834 | v0_values_nightly), |
| 835 | h0_values_nightly), |
| 836 | i_values_lhs), |
| 837 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 838 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 839 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 840 | a_values_nightly), |
| 841 | beta_values_nightly), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 842 | broadcast_bias_values), |
| 843 | lhs_transpose_values), |
| 844 | act_values)) |
| 845 | { |
| 846 | // Validate output |
| 847 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 848 | } |
| 849 | |
| 850 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 851 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 852 | m_w_values, |
| 853 | m_h_values), |
| 854 | n_values), |
| 855 | k_values), |
| 856 | b_values), |
| 857 | m0_values_precommit), |
| 858 | n0_values_precommit), |
| 859 | k0_values_precommit), |
| 860 | v0_values_precommit), |
| 861 | h0_values_precommit), |
| 862 | i_values_lhs), |
| 863 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 864 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 865 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 866 | a_values_precommit), |
| 867 | beta_values_precommit), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 868 | lhs_transpose_values), |
| 869 | act_values)) |
| 870 | { |
| 871 | // Validate output |
| 872 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 873 | } |
| 874 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 875 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 876 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 877 | m_w_values, |
| 878 | m_h_values), |
| 879 | n_values), |
| 880 | k_values), |
| 881 | b_values), |
| 882 | m0_values_nightly), |
| 883 | n0_values_nightly), |
| 884 | k0_values_nightly), |
| 885 | v0_values_nightly), |
| 886 | h0_values_nightly), |
| 887 | i_values_lhs), |
| 888 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 889 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 890 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 891 | a_values_nightly), |
| 892 | beta_values_nightly), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 893 | lhs_transpose_values), |
| 894 | act_values)) |
| 895 | { |
| 896 | // Validate output |
| 897 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 898 | } |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 899 | |
| 900 | TEST_SUITE(ExportToCLImage) |
| 901 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
| 902 | framework::dataset::make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported |
| 903 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported |
| 904 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // OK or incorrect if cl_khr_image2d_from_buffer not supported |
| 905 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect k0 |
| 906 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), // Incorrect n0 |
| 907 | |
| 908 | }), |
| 909 | framework::dataset::make("Input1Info",{ TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), |
| 910 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), |
| 911 | TensorInfo(TensorShape(512U, 8U, 2U), 1, DataType::F16), |
| 912 | TensorInfo(TensorShape(256U, 16U, 2U), 1, DataType::F16), |
| 913 | TensorInfo(TensorShape(128U, 32U, 2U), 1, DataType::F16), |
| 914 | |
| 915 | })), |
| 916 | framework::dataset::make("Input2Info", { TensorInfo(TensorShape(64U), 1, DataType::F16), |
| 917 | TensorInfo(TensorShape(64U), 1, DataType::F16), |
| 918 | TensorInfo(TensorShape(64U), 1, DataType::F16), |
| 919 | TensorInfo(TensorShape(64U), 1, DataType::F16), |
| 920 | TensorInfo(TensorShape(64U), 1, DataType::F16), |
| 921 | |
| 922 | })), |
| 923 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16), |
| 924 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16), |
| 925 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16), |
| 926 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16), |
| 927 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16), |
| 928 | TensorInfo(TensorShape(64U, 64U, 2U), 1, DataType::F16), |
| 929 | |
| 930 | })), |
| 931 | framework::dataset::make("LHSMInfo",{ |
| 932 | GEMMLHSMatrixInfo(4, 4, 1, false, true), |
| 933 | GEMMLHSMatrixInfo(4, 8, 1, false, true), |
| 934 | GEMMLHSMatrixInfo(4, 4, 1, false, true), |
| 935 | GEMMLHSMatrixInfo(4, 2, 1, false, false), |
| 936 | GEMMLHSMatrixInfo(4, 4, 1, false, false), |
| 937 | |
| 938 | })), |
| 939 | framework::dataset::make("RHSMInfo",{ |
| 940 | GEMMRHSMatrixInfo(4, 4, 1, true, true, true), |
| 941 | GEMMRHSMatrixInfo(4, 8, 1, true, true, true), |
| 942 | GEMMRHSMatrixInfo(8, 4, 1, true, true, true), |
| 943 | GEMMRHSMatrixInfo(4, 2, 1, true, false, true), |
| 944 | GEMMRHSMatrixInfo(2, 4, 1, true, false, true), |
| 945 | })), |
| 946 | framework::dataset::make("GEMMInfo",{GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 947 | 64 /**<N Number of RHS columns*/, |
| 948 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 949 | false /**< reinterpret the input as 3D */, |
| 950 | true /**< Flag used to broadcast the bias addition */, |
| 951 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 952 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 953 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 954 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 955 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 956 | GEMMLHSMatrixInfo(), |
| 957 | GEMMRHSMatrixInfo(), |
| 958 | 0 /**< Offset to be added to each element of the matrix A */, |
| 959 | 0 /**< Offset to be added to each element of the matrix B */), |
| 960 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 961 | 64 /**<N Number of RHS columns*/, |
| 962 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 963 | false /**< reinterpret the input as 3D */, |
| 964 | true /**< Flag used to broadcast the bias addition */, |
| 965 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 966 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 967 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 968 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 969 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 970 | GEMMLHSMatrixInfo(), |
| 971 | GEMMRHSMatrixInfo(), |
| 972 | 0 /**< Offset to be added to each element of the matrix A */, |
| 973 | 0 /**< Offset to be added to each element of the matrix B */), |
| 974 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 975 | 64 /**<N Number of RHS columns*/, |
| 976 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 977 | false /**< reinterpret the input as 3D */, |
| 978 | true /**< Flag used to broadcast the bias addition */, |
| 979 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 980 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 981 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 982 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 983 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 984 | GEMMLHSMatrixInfo(), |
| 985 | GEMMRHSMatrixInfo(), |
| 986 | 0 /**< Offset to be added to each element of the matrix A */, |
| 987 | 0 /**< Offset to be added to each element of the matrix B */), |
| 988 | |
| 989 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 990 | 64 /**<N Number of RHS columns*/, |
| 991 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 992 | false /**< reinterpret the input as 3D */, |
| 993 | true /**< Flag used to broadcast the bias addition */, |
| 994 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 995 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 996 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 997 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 998 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 999 | GEMMLHSMatrixInfo(), |
| 1000 | GEMMRHSMatrixInfo(), |
| 1001 | 0 /**< Offset to be added to each element of the matrix A */, |
| 1002 | 0 /**< Offset to be added to each element of the matrix B */), |
| 1003 | GEMMKernelInfo( 64 /**<M Number of LHS rows*/, |
| 1004 | 64 /**<N Number of RHS columns*/, |
| 1005 | 64 /**<K Number of LHS columns or RHS rows */, 0 /**< Depth of the output tensor in case is reinterpreted as 3D */, |
| 1006 | false /**< reinterpret the input as 3D */, |
| 1007 | true /**< Flag used to broadcast the bias addition */, |
| 1008 | false /**< wider accumm */, |
Gian Marco Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 1009 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1010 | ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, |
| 1011 | 1 /**< Multiplication factor for the width of the 1xW transposed block */, |
| 1012 | 1 /**< Multiplication factor for the height of the 4x4 interleaved block */, |
| 1013 | GEMMLHSMatrixInfo(), |
| 1014 | GEMMRHSMatrixInfo(), |
| 1015 | 0 /**< Offset to be added to each element of the matrix A */, |
| 1016 | 0 /**< Offset to be added to each element of the matrix B */) |
| 1017 | })), |
| 1018 | framework::dataset::make("Expected", { true, |
| 1019 | true, |
| 1020 | true, |
| 1021 | false, |
| 1022 | false})), |
| 1023 | input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected) |
| 1024 | { |
| 1025 | ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), |
| 1026 | &input1_info.clone()->set_is_resizable(true), |
| 1027 | &input2_info.clone()->set_is_resizable(true), |
| 1028 | &output_info.clone()->set_is_resizable(true),1.f,1.f, |
| 1029 | lhs_info, |
| 1030 | rhs_info, |
| 1031 | gemm_info)) == (expected && image2d_from_buffer_supported(CLKernelLibrary::get().get_device())), framework::LogLevel::ERRORS); |
| 1032 | } |
| 1033 | |
| 1034 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::ALL, |
| 1035 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 1036 | m_values, |
| 1037 | n_values), |
| 1038 | k_values), |
| 1039 | b_values), |
| 1040 | m0_values_precommit), |
| 1041 | n0_values_precommit), |
| 1042 | k0_values_precommit), |
| 1043 | v0_values_precommit), |
| 1044 | h0_values_precommit), |
| 1045 | i_values_lhs), |
| 1046 | i_values_rhs), |
| 1047 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 1048 | framework::dataset::make("DataType", DataType::F16)), |
| 1049 | a_values_precommit), |
| 1050 | beta_values_precommit), |
| 1051 | broadcast_bias_values), |
| 1052 | lhs_transpose_values), |
| 1053 | act_values)) |
| 1054 | { |
| 1055 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 1056 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 1057 | { |
| 1058 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 1059 | } |
| 1060 | else |
| 1061 | { |
| 1062 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 1063 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 1064 | } |
| 1065 | |
| 1066 | } |
| 1067 | |
| 1068 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::NIGHTLY, |
| 1069 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 1070 | m_values, |
| 1071 | n_values), |
| 1072 | k_values), |
| 1073 | b_values), |
| 1074 | m0_values_nightly), |
| 1075 | n0_export_to_cl_image_values_nightly), |
| 1076 | k0_export_to_cl_image_values_nightly), |
| 1077 | v0_values_nightly), |
| 1078 | h0_values_nightly), |
| 1079 | i_values_lhs), |
| 1080 | i_values_rhs), |
| 1081 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 1082 | framework::dataset::make("DataType", DataType::F16)), |
| 1083 | a_values_nightly), |
| 1084 | beta_values_nightly), |
| 1085 | broadcast_bias_values), |
| 1086 | lhs_transpose_values), |
| 1087 | act_values)) |
| 1088 | { |
| 1089 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 1090 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 1091 | { |
| 1092 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 1093 | } |
| 1094 | else |
| 1095 | { |
| 1096 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 1097 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 1098 | } |
| 1099 | } |
| 1100 | |
| 1101 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL, |
| 1102 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 1103 | m_w_values, |
| 1104 | m_h_values), |
| 1105 | n_values), |
| 1106 | k_values), |
| 1107 | b_values), |
| 1108 | m0_values_precommit), |
| 1109 | n0_values_precommit), |
| 1110 | k0_values_precommit), |
| 1111 | v0_values_precommit), |
| 1112 | h0_values_precommit), |
| 1113 | i_values_lhs), |
| 1114 | i_values_rhs), |
| 1115 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 1116 | framework::dataset::make("DataType", DataType::F16)), |
| 1117 | a_values_precommit), |
| 1118 | beta_values_precommit), |
| 1119 | lhs_transpose_values), |
| 1120 | act_values)) |
| 1121 | { |
| 1122 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 1123 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 1124 | { |
| 1125 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 1126 | } |
| 1127 | else |
| 1128 | { |
| 1129 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 1130 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::NIGHTLY, |
| 1135 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 1136 | m_w_values, |
| 1137 | m_h_values), |
| 1138 | n_values), |
| 1139 | k_values), |
| 1140 | b_values), |
| 1141 | m0_values_nightly), |
| 1142 | n0_export_to_cl_image_values_nightly), |
| 1143 | k0_export_to_cl_image_values_nightly), |
| 1144 | v0_values_nightly), |
| 1145 | h0_values_nightly), |
| 1146 | i_values_lhs), |
| 1147 | i_values_rhs), |
| 1148 | framework::dataset::make("export_to_cl_image_rhs", true)), |
| 1149 | framework::dataset::make("DataType", DataType::F16)), |
| 1150 | a_values_nightly), |
| 1151 | beta_values_nightly), |
| 1152 | lhs_transpose_values), |
| 1153 | act_values)) |
| 1154 | { |
| 1155 | // Validate output only if the target platform supports the OpenCL cl_khr_image2d_from_buffer extension |
| 1156 | if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device())) |
| 1157 | { |
| 1158 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 1159 | } |
| 1160 | else |
| 1161 | { |
| 1162 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 1163 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 1164 | } |
| 1165 | } |
| 1166 | TEST_SUITE_END() // ExportToCLImage |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1167 | TEST_SUITE_END() // FP16 |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1168 | |
| 1169 | TEST_SUITE(MixedPrecision) |
| 1170 | |
| 1171 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1172 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1173 | m_values, |
| 1174 | n_values), |
| 1175 | k_values), |
| 1176 | b_values), |
| 1177 | m0_values_precommit), |
| 1178 | n0_values_precommit), |
| 1179 | k0_values_precommit), |
| 1180 | v0_values_precommit), |
| 1181 | h0_values_precommit), |
| 1182 | i_values_lhs), |
| 1183 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1184 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1185 | framework::dataset::make("DataType", DataType::F16)), |
| 1186 | a_values_precommit), |
| 1187 | beta_values_precommit), |
| 1188 | broadcast_bias_values), |
| 1189 | lhs_transpose_values), |
| 1190 | act_values)) |
| 1191 | { |
| 1192 | // Validate output |
| 1193 | validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision); |
| 1194 | } |
| 1195 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 1196 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1197 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1198 | m_values, |
| 1199 | n_values), |
| 1200 | k_values), |
| 1201 | b_values), |
| 1202 | m0_values_nightly), |
| 1203 | n0_values_nightly), |
| 1204 | k0_values_nightly), |
| 1205 | v0_values_nightly), |
| 1206 | h0_values_nightly), |
| 1207 | i_values_lhs), |
| 1208 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1209 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1210 | framework::dataset::make("DataType", DataType::F16)), |
| 1211 | a_values_nightly), |
| 1212 | beta_values_nightly), |
| 1213 | broadcast_bias_values), |
| 1214 | lhs_transpose_values), |
| 1215 | act_values)) |
| 1216 | { |
| 1217 | // Validate output |
| 1218 | validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision); |
| 1219 | } |
| 1220 | |
| 1221 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1222 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1223 | m_w_values, |
| 1224 | m_h_values), |
| 1225 | n_values), |
| 1226 | k_values), |
| 1227 | b_values), |
| 1228 | m0_values_precommit), |
| 1229 | n0_values_precommit), |
| 1230 | k0_values_precommit), |
| 1231 | v0_values_precommit), |
| 1232 | h0_values_precommit), |
| 1233 | i_values_lhs), |
| 1234 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1235 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1236 | framework::dataset::make("DataType", DataType::F16)), |
| 1237 | a_values_precommit), |
| 1238 | beta_values_precommit), |
| 1239 | lhs_transpose_values), |
| 1240 | act_values)) |
| 1241 | { |
| 1242 | // Validate output |
| 1243 | validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision); |
| 1244 | } |
| 1245 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 1246 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1247 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1248 | m_w_values, |
| 1249 | m_h_values), |
| 1250 | n_values), |
| 1251 | k_values), |
| 1252 | b_values), |
| 1253 | m0_values_nightly), |
| 1254 | n0_values_nightly), |
| 1255 | k0_values_nightly), |
| 1256 | v0_values_nightly), |
| 1257 | h0_values_nightly), |
| 1258 | i_values_lhs), |
| 1259 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1260 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1261 | framework::dataset::make("DataType", DataType::F16)), |
| 1262 | a_values_nightly), |
| 1263 | beta_values_nightly), |
| 1264 | lhs_transpose_values), |
| 1265 | act_values)) |
| 1266 | { |
| 1267 | // Validate output |
| 1268 | validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision); |
| 1269 | } |
| 1270 | TEST_SUITE_END() // MixedPrecision |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 1271 | TEST_SUITE_END() // Float |
Gian Marco Iodice | d1f5476 | 2019-07-19 09:54:47 +0100 | [diff] [blame] | 1272 | TEST_SUITE_END() // GEMMMatrixMultiplyReshaped |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 1273 | TEST_SUITE_END() // CL |
| 1274 | } // namespace validation |
| 1275 | } // namespace test |
Michele Di Giorgio | 2568c6b | 2019-09-17 12:08:46 +0100 | [diff] [blame] | 1276 | } // namespace arm_compute |