Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 1 | /* |
Georgios Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2021 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" |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 29 | #include "src/core/experimental/PostOp.h" |
Georgios Pinitas | 7891a73 | 2021-08-20 21:39:25 +0100 | [diff] [blame] | 30 | #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 Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 33 | #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 | |
| 43 | namespace arm_compute |
| 44 | { |
| 45 | namespace test |
| 46 | { |
| 47 | namespace validation |
| 48 | { |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 49 | using namespace arm_compute::misc::shape_calculator; |
Georgios Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 50 | using namespace arm_compute::opencl::kernels; |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 51 | |
Georgios Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 52 | // Create function for ClGemmReshapeLhsMatrixKernel |
| 53 | using CLGEMMReshapeLHSMatrix = CLSynthetizeOperator<ClGemmReshapeLhsMatrixKernel>; |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 54 | |
Georgios Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 55 | // Create function for ClGemmReshapeRhsMatrixKernel |
| 56 | using CLGEMMReshapeRHSMatrix = CLSynthetizeOperator<ClGemmReshapeRhsMatrixKernel>; |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 57 | |
Georgios Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 58 | // Create function for ClGemmMatrixMultiplyReshapedKernel |
| 59 | using CLGEMMMatrixMultiplyReshaped = CLSynthetizeOperator<ClGemmMatrixMultiplyReshapedKernel>; |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 60 | |
| 61 | // Fixture for CLGEMMMatrixMultiplyReshaped |
| 62 | template <typename T> |
| 63 | using CLGEMMMatrixMultiplyReshapedFixture = GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>; |
| 64 | |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 65 | // Fixture for CLGEMMMatrixMultiplyReshaped with post ops |
| 66 | template <typename T> |
| 67 | using CLGEMMMatrixMultiplyReshapedWithPostOpsFixture = |
| 68 | GEMMMatrixMultiplyReshapedWithPostOpsValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>; |
| 69 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 70 | // Fixture for CLGEMMMatrixMultiplyReshaped mixed precision |
| 71 | template <typename T> |
| 72 | using CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture = |
| 73 | GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>; |
| 74 | |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 75 | // Fixture for CLGEMMMatrixMultiplyReshaped mixed precision with post ops |
| 76 | template <typename T> |
| 77 | using CLGEMMMatrixMultiplyReshapedMixedPrecisionWithPostOpsFixture = |
| 78 | GEMMMatrixMultiplyReshapedWithPostOpsValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>; |
| 79 | |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 80 | // Fixture for CLGEMMMatrixMultiplyReshaped3D |
| 81 | template <typename T> |
| 82 | using CLGEMMMatrixMultiplyReshaped3DFixture = GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>; |
| 83 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 84 | // Fixture for CLGEMMMatrixMultiplyReshaped3D mixed precision |
| 85 | template <typename T> |
| 86 | using CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture = |
| 87 | GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>; |
| 88 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 89 | namespace |
| 90 | { |
| 91 | // *INDENT-OFF* |
| 92 | // clang-format off |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 93 | RelativeTolerance<float> rel_tolerance_f32(0.001f); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 94 | constexpr float abs_tolerance_f32(0.0001f); |
| 95 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 96 | RelativeTolerance<float> rel_tolerance_f16_mixed_precision(0.001f); |
| 97 | constexpr float abs_tolerance_f16_mixed_precision(0.01f); |
| 98 | |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 99 | RelativeTolerance<float> rel_tolerance_f16(0.001f); |
| 100 | constexpr float abs_tolerance_f16(0.01f); |
| 101 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 102 | /** M values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 103 | const auto m_values = framework::dataset::make("M", 17); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 104 | |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 105 | /** M_W values to test */ |
| 106 | const auto m_w_values = framework::dataset::make("M_W", 5); |
| 107 | |
| 108 | /** M_H values to test */ |
| 109 | const auto m_h_values = framework::dataset::make("M_H", 7); |
| 110 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 111 | /** N values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 112 | const auto n_values = framework::dataset::make("N", 21); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 113 | |
| 114 | /** K values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 115 | const auto k_values = framework::dataset::make("K", 13); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 116 | |
| 117 | /** Batch size values to test */ |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 118 | const auto b_values = framework::dataset::make("batch_size", 2, 3); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 119 | |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 120 | /** Activation values to test */ |
| 121 | const auto act_values = framework::dataset::make("Activation", |
| 122 | { |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 123 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f), |
| 124 | }); |
| 125 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 126 | /** Alpha values to test - Precommit */ |
| 127 | const auto a_values_precommit = framework::dataset::make("alpha", {-0.75f} ); |
| 128 | |
| 129 | /** Beta values to test - Precommit */ |
| 130 | const auto beta_values_precommit = framework::dataset::make("beta", {-0.35f} ); |
| 131 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 132 | /** M0 values to test - Precommit */ |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 133 | const auto m0_values_precommit = framework::dataset::make("M0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 134 | |
| 135 | /** N0 values to test - Precommit */ |
Gian Marco Iodice | d820db6 | 2019-08-05 14:23:23 +0100 | [diff] [blame] | 136 | const auto n0_values_precommit = framework::dataset::make("N0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 137 | |
| 138 | /** K0 values to test - Precommit */ |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 139 | const auto k0_values_precommit = framework::dataset::make("K0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 140 | |
| 141 | /** V0 values to test - Precommit */ |
| 142 | const auto v0_values_precommit = framework::dataset::make("V0", 1, 3); |
| 143 | |
| 144 | /** H0 values to test - Precommit */ |
| 145 | const auto h0_values_precommit = framework::dataset::make("H0", 1, 3); |
| 146 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 147 | /** Alpha values to test - Nightly */ |
| 148 | const auto a_values_nightly = framework::dataset::make("alpha", {1.0f} ); |
| 149 | |
| 150 | /** Beta values to test - Nightly */ |
| 151 | const auto beta_values_nightly = framework::dataset::make("beta", {1.0f} ); |
| 152 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 153 | /** M0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 154 | const auto m0_values_nightly = framework::dataset::make("M0", { 8 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 155 | |
| 156 | /** N0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 157 | const auto n0_values_nightly = framework::dataset::make("N0", { 8 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 158 | |
| 159 | /** K0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 160 | const auto k0_values_nightly = framework::dataset::make("K0", { 4 }); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 161 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 162 | /** N0 values to test with export to OpenCL image object - Nightly */ |
| 163 | const 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 */ |
| 166 | const auto k0_export_to_cl_image_values_nightly = framework::dataset::make("K0", { 4, 8, 16 }); |
| 167 | |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 168 | /** V0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 169 | const auto v0_values_nightly = framework::dataset::make("V0", 1, 3); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 170 | |
| 171 | /** H0 values to test - Nightly */ |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 172 | const auto h0_values_nightly = framework::dataset::make("H0", 1, 3); |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 173 | |
| 174 | /** Interleave values to test with LHS matrix */ |
| 175 | const auto i_values_lhs = framework::dataset::make("interleave_lhs", { true, false }); |
| 176 | |
| 177 | /** Interleave values to test with RHS matrix */ |
| 178 | const auto i_values_rhs = framework::dataset::make("interleave_rhs", { true, false }); |
| 179 | |
Gian Marco Iodice | e16c890 | 2019-06-14 16:11:10 +0100 | [diff] [blame] | 180 | /** Broadcast bias from vector to matrix */ |
Gian Marco Iodice | d820db6 | 2019-08-05 14:23:23 +0100 | [diff] [blame] | 181 | 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] | 182 | |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 183 | /** LHS transposed values */ |
| 184 | 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] | 185 | |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 186 | /** Post Ops */ |
| 187 | using PostOpArgBroadcast = CLGEMMMatrixMultiplyReshapedWithPostOpsFixture<float>::PostOpArgBroadcast; |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 188 | experimental::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 | } |
| 199 | experimental::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 | } |
| 209 | experimental::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 | } |
ramelg01 | 6049eda | 2021-10-29 10:52:53 +0100 | [diff] [blame^] | 219 | // To test that the output of the main op is the first parameter in prelu post op |
| 220 | experimental::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 |
| 232 | experimental::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 | } |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 243 | /** Different Post Op Lists */ |
| 244 | const auto post_op_lists = framework::dataset::make("post_op_lists", { |
| 245 | post_ops_1(), |
| 246 | post_ops_2(), |
| 247 | post_ops_3(), |
ramelg01 | 6049eda | 2021-10-29 10:52:53 +0100 | [diff] [blame^] | 248 | post_ops_4(), |
| 249 | post_ops_5() |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 250 | } ); |
| 251 | |
SiCongLi | eb8bd81 | 2021-10-29 15:05:49 +0100 | [diff] [blame] | 252 | bool 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 Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 288 | } // namespace |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 289 | |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 290 | TEST_SUITE(CL) |
| 291 | TEST_SUITE(GEMMMatrixMultiplyReshaped) |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 292 | |
| 293 | // *INDENT-OFF* |
| 294 | // clang-format off |
| 295 | DATA_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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 348 | 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), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 356 | |
| 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 368 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 369 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 373 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 374 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 383 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 384 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 388 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 389 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 401 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 402 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 406 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 407 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 417 | true /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 418 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 422 | GEMMRHSMatrixInfo(4,4,1,true,true,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 423 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 432 | false /**< has pad y */, |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 433 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 437 | GEMMRHSMatrixInfo(4,4,2,true,false,false), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 438 | 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 | { |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 444 | ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), |
morgolock | aba2f91 | 2020-05-05 16:28:19 +0100 | [diff] [blame] | 445 | &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 | } |
SiCongLi | eb8bd81 | 2021-10-29 15:05:49 +0100 | [diff] [blame] | 452 | TEST_SUITE(ValidateFusedPostOpsConfigs) |
| 453 | TEST_SUITE(Invalid) |
| 454 | TEST_CASE(UnsupportedPostOpSequence, framework::DatasetMode::ALL) |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 455 | { |
SiCongLi | eb8bd81 | 2021-10-29 15:05:49 +0100 | [diff] [blame] | 456 | 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); |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 477 | } |
SiCongLi | eb8bd81 | 2021-10-29 15:05:49 +0100 | [diff] [blame] | 478 | TEST_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 | } |
| 493 | TEST_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 | } |
ramelg01 | 6049eda | 2021-10-29 10:52:53 +0100 | [diff] [blame^] | 508 | TEST_SUITE_END() // Invalid |
SiCongLi | eb8bd81 | 2021-10-29 15:05:49 +0100 | [diff] [blame] | 509 | TEST_SUITE(Valid) |
| 510 | TEST_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 | } |
| 521 | TEST_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 | } |
| 535 | TEST_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 | } |
| 549 | TEST_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 | } |
| 563 | TEST_SUITE_END() // Valid |
| 564 | TEST_SUITE_END() // ValidateFusedPostOps |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 565 | TEST_SUITE(Float) |
| 566 | TEST_SUITE(FP32) |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 567 | |
| 568 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 569 | 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] | 570 | 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 Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 580 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 581 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 582 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 583 | a_values_precommit), |
| 584 | beta_values_precommit), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 585 | broadcast_bias_values), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 586 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 587 | act_values)) |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 588 | { |
| 589 | // Validate output |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 590 | 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] | 591 | } |
| 592 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 593 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<float>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 594 | 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] | 595 | 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 Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 605 | i_values_rhs), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 606 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 607 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 608 | a_values_nightly), |
| 609 | beta_values_nightly), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 610 | broadcast_bias_values), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 611 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 612 | act_values)) |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 613 | { |
| 614 | // Validate output |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 615 | 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] | 616 | } |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 617 | |
| 618 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 619 | 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] | 620 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 632 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 633 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 634 | a_values_precommit), |
| 635 | beta_values_precommit), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 636 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 637 | act_values)) |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 638 | { |
| 639 | // Validate output |
| 640 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 641 | } |
| 642 | |
Michalis Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 643 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<float>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 644 | 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] | 645 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 657 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 658 | framework::dataset::make("DataType", DataType::F32)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 659 | a_values_nightly), |
| 660 | beta_values_nightly), |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 661 | lhs_transpose_values), |
Gian Marco Iodice | ca1f460 | 2019-07-16 15:46:48 +0100 | [diff] [blame] | 662 | act_values)) |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 663 | { |
| 664 | // Validate output |
| 665 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 666 | } |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 667 | TEST_SUITE(FusedPostOps) |
| 668 | |
| 669 | FIXTURE_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 | |
| 696 | TEST_SUITE_END() // FusedPostOps |
| 697 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 698 | TEST_SUITE(ExportToCLImage) |
| 699 | DATA_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 Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 705 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 706 | }), |
| 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 Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 712 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 713 | })), |
| 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 750 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 751 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 764 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 765 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 778 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 779 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 793 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 794 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 807 | false /**< has pad y */, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 808 | 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 Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 823 | ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 824 | &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 | |
| 832 | FIXTURE_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 Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 834 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 845 | 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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 853 | // Validate output only if validate() is successful |
| 854 | if(validate_result) |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 855 | { |
| 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 | |
| 866 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 887 | // Validate output only if validate() is successful |
| 888 | if(validate_result) |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 889 | { |
| 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 | |
| 899 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 920 | // Validate output only if validate() is successful |
| 921 | if(validate_result) |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 922 | { |
| 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 | |
| 932 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 953 | // Validate output only if validate() is successful |
| 954 | if(validate_result) |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 955 | { |
| 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 | } |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 964 | TEST_SUITE(FusedPostOps) |
| 965 | |
| 966 | FIXTURE_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 | |
| 1001 | TEST_SUITE_END() // FusedPostOps |
| 1002 | |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1003 | TEST_SUITE_END() // ExportToCLImage |
| 1004 | TEST_SUITE_END() // FP32 |
| 1005 | |
| 1006 | TEST_SUITE(FP16) |
| 1007 | |
| 1008 | FIXTURE_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 Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1022 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1023 | a_values_precommit), |
| 1024 | beta_values_precommit), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1025 | 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 Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 1033 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1034 | 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] | 1035 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1046 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1047 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1048 | a_values_nightly), |
| 1049 | beta_values_nightly), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1050 | 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 | |
| 1058 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1059 | 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] | 1060 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1072 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1073 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1074 | a_values_precommit), |
| 1075 | beta_values_precommit), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1076 | 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 Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 1083 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1084 | 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] | 1085 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1097 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1098 | framework::dataset::make("DataType", DataType::F16)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1099 | a_values_nightly), |
| 1100 | beta_values_nightly), |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1101 | 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 Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1107 | |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 1108 | TEST_SUITE(FusedPostOps) |
| 1109 | |
| 1110 | FIXTURE_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 | |
| 1137 | TEST_SUITE_END() // FusedPostOps |
| 1138 | |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1139 | TEST_SUITE(ExportToCLImage) |
| 1140 | DATA_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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 1191 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1192 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 1205 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1206 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 1219 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1220 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 1234 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1235 | 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 Iodice | 9ae06d4 | 2020-10-22 16:37:12 +0100 | [diff] [blame] | 1248 | false /**< has pad y */, |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1249 | 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 Pinitas | 856f66e | 2021-04-22 21:13:21 +0100 | [diff] [blame] | 1264 | ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1265 | &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 | |
| 1273 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 1294 | // Validate output only if validate() is successful |
| 1295 | if(validate_result) |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1296 | { |
| 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 | |
| 1307 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 1328 | // Validate output only if validate() is successful |
| 1329 | if(validate_result) |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1330 | { |
| 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 | |
| 1340 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 1361 | // Validate output only if validate() is successful |
| 1362 | if(validate_result) |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1363 | { |
| 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 | |
| 1373 | FIXTURE_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 Zhang | cc3e53c | 2020-11-16 21:17:28 +0000 | [diff] [blame] | 1394 | // Validate output only if validate() is successful |
| 1395 | if(validate_result) |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1396 | { |
| 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 | } |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 1405 | TEST_SUITE(FusedPostOps) |
| 1406 | |
| 1407 | FIXTURE_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 | |
| 1442 | TEST_SUITE_END() // FusedPostOps |
| 1443 | |
Gian Marco Iodice | 6f93134 | 2020-09-15 14:17:41 +0100 | [diff] [blame] | 1444 | TEST_SUITE_END() // ExportToCLImage |
Gian Marco Iodice | 05639f6 | 2019-09-24 12:05:06 +0100 | [diff] [blame] | 1445 | TEST_SUITE_END() // FP16 |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1446 | |
| 1447 | TEST_SUITE(MixedPrecision) |
| 1448 | |
| 1449 | FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1450 | 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] | 1451 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1462 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1463 | 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 Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 1474 | FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMMatrixMultiplyReshapedMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1475 | 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] | 1476 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1487 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1488 | 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 | |
| 1499 | FIXTURE_DATA_TEST_CASE(RunSmall3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1500 | 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] | 1501 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1513 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1514 | 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 Spyrou | 1d89777 | 2019-12-09 18:47:29 +0000 | [diff] [blame] | 1524 | FIXTURE_DATA_TEST_CASE(RunLarge3D, CLGEMMMatrixMultiplyReshaped3DMixedPrecisionFixture<half>, framework::DatasetMode::DISABLED, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1525 | 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] | 1526 | 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 Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 1538 | framework::dataset::make("export_to_cl_image_rhs", false)), |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1539 | 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 | } |
SiCongLi | 1af5416 | 2021-10-06 15:25:57 +0100 | [diff] [blame] | 1548 | |
| 1549 | TEST_SUITE(FusedPostOps) |
| 1550 | |
| 1551 | FIXTURE_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 | |
| 1578 | TEST_SUITE_END() // FusedPostOps |
| 1579 | |
Gian Marco Iodice | 0c17aa2 | 2019-09-27 09:23:15 +0100 | [diff] [blame] | 1580 | TEST_SUITE_END() // MixedPrecision |
Gian Marco Iodice | 9382ab3 | 2018-12-17 15:12:07 +0000 | [diff] [blame] | 1581 | TEST_SUITE_END() // Float |
Gian Marco Iodice | d1f5476 | 2019-07-19 09:54:47 +0100 | [diff] [blame] | 1582 | TEST_SUITE_END() // GEMMMatrixMultiplyReshaped |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 1583 | TEST_SUITE_END() // CL |
| 1584 | } // namespace validation |
| 1585 | } // namespace test |
Michele Di Giorgio | 2568c6b | 2019-09-17 12:08:46 +0100 | [diff] [blame] | 1586 | } // namespace arm_compute |