1*c217d954SCole Faust /* 2*c217d954SCole Faust * Copyright (c) 2019-2022 Arm Limited. 3*c217d954SCole Faust * 4*c217d954SCole Faust * SPDX-License-Identifier: MIT 5*c217d954SCole Faust * 6*c217d954SCole Faust * Permission is hereby granted, free of charge, to any person obtaining a copy 7*c217d954SCole Faust * of this software and associated documentation files (the "Software"), to 8*c217d954SCole Faust * deal in the Software without restriction, including without limitation the 9*c217d954SCole Faust * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10*c217d954SCole Faust * sell copies of the Software, and to permit persons to whom the Software is 11*c217d954SCole Faust * furnished to do so, subject to the following conditions: 12*c217d954SCole Faust * 13*c217d954SCole Faust * The above copyright notice and this permission notice shall be included in all 14*c217d954SCole Faust * copies or substantial portions of the Software. 15*c217d954SCole Faust * 16*c217d954SCole Faust * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17*c217d954SCole Faust * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18*c217d954SCole Faust * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19*c217d954SCole Faust * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20*c217d954SCole Faust * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21*c217d954SCole Faust * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22*c217d954SCole Faust * SOFTWARE. 23*c217d954SCole Faust */ 24*c217d954SCole Faust #ifndef ARM_COMPUTE_TEST_GEMMLOWPOUTPUT_DATASET 25*c217d954SCole Faust #define ARM_COMPUTE_TEST_GEMMLOWPOUTPUT_DATASET 26*c217d954SCole Faust 27*c217d954SCole Faust #include "utils/TypePrinter.h" 28*c217d954SCole Faust 29*c217d954SCole Faust #include "arm_compute/core/TensorShape.h" 30*c217d954SCole Faust #include "arm_compute/core/Utils.h" 31*c217d954SCole Faust 32*c217d954SCole Faust using namespace arm_compute; 33*c217d954SCole Faust 34*c217d954SCole Faust namespace arm_compute 35*c217d954SCole Faust { 36*c217d954SCole Faust namespace test 37*c217d954SCole Faust { 38*c217d954SCole Faust namespace datasets 39*c217d954SCole Faust { 40*c217d954SCole Faust class GEMMLowpFusedOffsetOutputDataset 41*c217d954SCole Faust { 42*c217d954SCole Faust public: 43*c217d954SCole Faust using type = std::tuple<TensorShape, TensorShape, TensorShape, int32_t, int32_t, GEMMLowpOutputStageInfo>; 44*c217d954SCole Faust 45*c217d954SCole Faust struct iterator 46*c217d954SCole Faust { iteratoriterator47*c217d954SCole Faust iterator(std::vector<TensorShape>::const_iterator a_it, 48*c217d954SCole Faust std::vector<TensorShape>::const_iterator b_it, 49*c217d954SCole Faust std::vector<TensorShape>::const_iterator c_it, 50*c217d954SCole Faust std::vector<int32_t>::const_iterator a_offset_it, 51*c217d954SCole Faust std::vector<int32_t>::const_iterator b_offset_it, 52*c217d954SCole Faust std::vector<GEMMLowpOutputStageInfo>::const_iterator output_stage_it) 53*c217d954SCole Faust : _a_it{ std::move(a_it) }, 54*c217d954SCole Faust _b_it{ std::move(b_it) }, 55*c217d954SCole Faust _c_it{ std::move(c_it) }, 56*c217d954SCole Faust _a_offset_it{ std::move(a_offset_it) }, 57*c217d954SCole Faust _b_offset_it{ std::move(b_offset_it) }, 58*c217d954SCole Faust _output_stage_it{ std::move(output_stage_it) } 59*c217d954SCole Faust { 60*c217d954SCole Faust } 61*c217d954SCole Faust descriptioniterator62*c217d954SCole Faust std::string description() const 63*c217d954SCole Faust { 64*c217d954SCole Faust std::stringstream description; 65*c217d954SCole Faust description << "A=" << *_a_it << ":"; 66*c217d954SCole Faust description << "B=" << *_b_it << ":"; 67*c217d954SCole Faust description << "C=" << *_c_it << ":"; 68*c217d954SCole Faust description << "a_offset=" << *_a_offset_it << ":"; 69*c217d954SCole Faust description << "b_offset=" << *_b_offset_it << ":"; 70*c217d954SCole Faust description << "output_type=" << string_from_gemmlowp_output_stage((*_output_stage_it).type) << ":"; 71*c217d954SCole Faust description << "output_offset=" << (*_output_stage_it).gemmlowp_offset << ":"; 72*c217d954SCole Faust description << "output_multiplier={"; 73*c217d954SCole Faust for(auto it = (*_output_stage_it).gemmlowp_multipliers.begin(); it != (*_output_stage_it).gemmlowp_multipliers.end(); ++it) 74*c217d954SCole Faust { 75*c217d954SCole Faust description << (*it) << ", "; 76*c217d954SCole Faust } 77*c217d954SCole Faust description << "}:"; 78*c217d954SCole Faust description << "output_shift={"; 79*c217d954SCole Faust 80*c217d954SCole Faust for(auto it = (*_output_stage_it).gemmlowp_shifts.begin(); it != (*_output_stage_it).gemmlowp_shifts.end(); ++it) 81*c217d954SCole Faust { 82*c217d954SCole Faust description << (*it) << ", "; 83*c217d954SCole Faust } 84*c217d954SCole Faust description << "}:"; 85*c217d954SCole Faust description << "output_min=" << (*_output_stage_it).gemmlowp_min_bound << ":"; 86*c217d954SCole Faust description << "output_max=" << (*_output_stage_it).gemmlowp_max_bound << ":"; 87*c217d954SCole Faust description << "is_quantized_per_channel=" << (*_output_stage_it).is_quantized_per_channel << ":"; 88*c217d954SCole Faust 89*c217d954SCole Faust return description.str(); 90*c217d954SCole Faust } 91*c217d954SCole Faust 92*c217d954SCole Faust GEMMLowpFusedOffsetOutputDataset::type operator*() const 93*c217d954SCole Faust { 94*c217d954SCole Faust return std::make_tuple(*_a_it, *_b_it, *_c_it, *_a_offset_it, *_b_offset_it, *_output_stage_it); 95*c217d954SCole Faust } 96*c217d954SCole Faust 97*c217d954SCole Faust iterator &operator++() 98*c217d954SCole Faust { 99*c217d954SCole Faust ++_a_it; 100*c217d954SCole Faust ++_b_it; 101*c217d954SCole Faust ++_c_it; 102*c217d954SCole Faust ++_a_offset_it; 103*c217d954SCole Faust ++_b_offset_it; 104*c217d954SCole Faust ++_output_stage_it; 105*c217d954SCole Faust 106*c217d954SCole Faust return *this; 107*c217d954SCole Faust } 108*c217d954SCole Faust 109*c217d954SCole Faust private: 110*c217d954SCole Faust std::vector<TensorShape>::const_iterator _a_it; 111*c217d954SCole Faust std::vector<TensorShape>::const_iterator _b_it; 112*c217d954SCole Faust std::vector<TensorShape>::const_iterator _c_it; 113*c217d954SCole Faust std::vector<int32_t>::const_iterator _a_offset_it; 114*c217d954SCole Faust std::vector<int32_t>::const_iterator _b_offset_it; 115*c217d954SCole Faust std::vector<GEMMLowpOutputStageInfo>::const_iterator _output_stage_it; 116*c217d954SCole Faust }; 117*c217d954SCole Faust begin()118*c217d954SCole Faust iterator begin() const 119*c217d954SCole Faust { 120*c217d954SCole Faust return iterator(_a_shapes.begin(), _b_shapes.begin(), _c_shapes.begin(), _a_offset.begin(), _b_offset.begin(), _output_stage.begin()); 121*c217d954SCole Faust } 122*c217d954SCole Faust size()123*c217d954SCole Faust int size() const 124*c217d954SCole Faust { 125*c217d954SCole Faust return std::min(_a_shapes.size(), std::min(_b_shapes.size(), std::min(_c_shapes.size(), std::min(_a_offset.size(), std::min(_b_offset.size(), _output_stage.size()))))); 126*c217d954SCole Faust } 127*c217d954SCole Faust add_config(TensorShape a,TensorShape b,TensorShape c,int32_t a_offset,int32_t b_offset,GEMMLowpOutputStageInfo output_stage)128*c217d954SCole Faust void add_config(TensorShape a, TensorShape b, TensorShape c, int32_t a_offset, int32_t b_offset, GEMMLowpOutputStageInfo output_stage) 129*c217d954SCole Faust { 130*c217d954SCole Faust _a_shapes.emplace_back(std::move(a)); 131*c217d954SCole Faust _b_shapes.emplace_back(std::move(b)); 132*c217d954SCole Faust _c_shapes.emplace_back(std::move(c)); 133*c217d954SCole Faust _a_offset.emplace_back(std::move(a_offset)); 134*c217d954SCole Faust _b_offset.emplace_back(std::move(b_offset)); 135*c217d954SCole Faust _output_stage.emplace_back(std::move(output_stage)); 136*c217d954SCole Faust } 137*c217d954SCole Faust OutputStageInfo(GEMMLowpOutputStageType type,int32_t offset,int32_t multiplier,int32_t shift,int32_t min,int32_t max)138*c217d954SCole Faust GEMMLowpOutputStageInfo OutputStageInfo(GEMMLowpOutputStageType type, int32_t offset, int32_t multiplier, int32_t shift, int32_t min, int32_t max) 139*c217d954SCole Faust { 140*c217d954SCole Faust GEMMLowpOutputStageInfo output_stage = GEMMLowpOutputStageInfo(); 141*c217d954SCole Faust output_stage.type = type; 142*c217d954SCole Faust output_stage.gemmlowp_offset = offset; 143*c217d954SCole Faust output_stage.gemmlowp_multiplier = multiplier; 144*c217d954SCole Faust output_stage.gemmlowp_shift = shift; 145*c217d954SCole Faust output_stage.gemmlowp_min_bound = min; 146*c217d954SCole Faust output_stage.gemmlowp_max_bound = max; 147*c217d954SCole Faust output_stage.gemmlowp_multipliers.push_back(multiplier); 148*c217d954SCole Faust output_stage.gemmlowp_shifts.push_back(shift); 149*c217d954SCole Faust return output_stage; 150*c217d954SCole Faust } 151*c217d954SCole Faust 152*c217d954SCole Faust protected: 153*c217d954SCole Faust GEMMLowpFusedOffsetOutputDataset() = default; 154*c217d954SCole Faust GEMMLowpFusedOffsetOutputDataset(GEMMLowpFusedOffsetOutputDataset &&) = default; 155*c217d954SCole Faust 156*c217d954SCole Faust private: 157*c217d954SCole Faust std::vector<TensorShape> _a_shapes{}; 158*c217d954SCole Faust std::vector<TensorShape> _b_shapes{}; 159*c217d954SCole Faust std::vector<TensorShape> _c_shapes{}; 160*c217d954SCole Faust std::vector<int32_t> _a_offset{}; 161*c217d954SCole Faust std::vector<int32_t> _b_offset{}; 162*c217d954SCole Faust std::vector<GEMMLowpOutputStageInfo> _output_stage{}; 163*c217d954SCole Faust }; 164*c217d954SCole Faust 165*c217d954SCole Faust class SmallGEMMLowpFusedOffsetOutputUint8Dataset final : public GEMMLowpFusedOffsetOutputDataset 166*c217d954SCole Faust { 167*c217d954SCole Faust public: SmallGEMMLowpFusedOffsetOutputUint8Dataset()168*c217d954SCole Faust SmallGEMMLowpFusedOffsetOutputUint8Dataset() 169*c217d954SCole Faust { 170*c217d954SCole Faust add_config(TensorShape(21U, 13U), TensorShape(1U, 21U), TensorShape(1U, 13U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 13, 10, 210)); 171*c217d954SCole Faust add_config(TensorShape(52U, 13U), TensorShape(33U, 52U), TensorShape(33U, 13U), 0, 4, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 100, 2, 13, 10, 210)); 172*c217d954SCole Faust add_config(TensorShape(31U, 27U), TensorShape(23U, 31U), TensorShape(23U, 27U), 18, 23, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 200, 2, 13, 10, 210)); 173*c217d954SCole Faust add_config(TensorShape(32U, 72U), TensorShape(16U, 32U), TensorShape(16U, 72U), -9, 1, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 13, 10, 210)); 174*c217d954SCole Faust 175*c217d954SCole Faust add_config(TensorShape(21U, 1U), TensorShape(43U, 21U), TensorShape(43U, 1U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601600, 10, 10, 210)); 176*c217d954SCole Faust add_config(TensorShape(31U, 3U), TensorShape(72U, 31U), TensorShape(72U, 3U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 0, 254601600, 10, 10, 210)); 177*c217d954SCole Faust add_config(TensorShape(31U, 27U), TensorShape(23U, 31U), TensorShape(23U, 27U), 5, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 2, 254601602, 10, 10, 210)); 178*c217d954SCole Faust add_config(TensorShape(32U, 72U), TensorShape(17U, 32U), TensorShape(17U, 72U), -9, 1, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -1, 254601602, 10, 10, 210)); 179*c217d954SCole Faust } 180*c217d954SCole Faust }; 181*c217d954SCole Faust 182*c217d954SCole Faust class SmallGEMMLowpFusedBatchedMatMulDatasetUnsigned final : public GEMMLowpFusedOffsetOutputDataset 183*c217d954SCole Faust { 184*c217d954SCole Faust public: SmallGEMMLowpFusedBatchedMatMulDatasetUnsigned()185*c217d954SCole Faust SmallGEMMLowpFusedBatchedMatMulDatasetUnsigned() 186*c217d954SCole Faust { 187*c217d954SCole Faust add_config(TensorShape(4U, 3U), TensorShape(2U, 4U), TensorShape(2U, 3U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 5, 1 << 25, 5, 0, 254)); 188*c217d954SCole Faust add_config(TensorShape(4U, 3U), TensorShape(2U, 4U), TensorShape(2U, 3U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 100, 1 << 25, 3, 0, 254)); 189*c217d954SCole Faust add_config(TensorShape(12U, 15U), TensorShape(7U, 12U), TensorShape(7U, 15U), -3, 15, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 0, 1 << 19, 0, 20, 210)); 190*c217d954SCole Faust add_config(TensorShape(59U, 17U), TensorShape(36U, 59U), TensorShape(36U, 17U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -30, 2, 1 << 25, 14, 210)); 191*c217d954SCole Faust add_config(TensorShape(2U, 4U, 3U), TensorShape(5U, 2U, 3U), TensorShape(5U, 4U, 3U), -5, 12, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -20, 1 << 25, 4, 0, 127)); 192*c217d954SCole Faust add_config(TensorShape(15U, 7U, 3U), TensorShape(29U, 15U, 3U), TensorShape(29U, 7U, 3U), 5, 2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -10, 1 << 25, 6, 10, 210)); 193*c217d954SCole Faust add_config(TensorShape(56U, 17U, 32U), TensorShape(5U, 56U, 32U), TensorShape(5U, 17U, 32U), -3, 2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -15, 1 << 25, 3, 10, 210)); 194*c217d954SCole Faust add_config(TensorShape(13U, 256U, 32U), TensorShape(19U, 13U, 32U), TensorShape(19U, 256U, 32U), 5, 2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -15, 1 << 25, 6, 50, 225)); 195*c217d954SCole Faust } 196*c217d954SCole Faust }; 197*c217d954SCole Faust 198*c217d954SCole Faust class SmallGEMMLowpFusedBatchedMatMulDatasetSigned final : public GEMMLowpFusedOffsetOutputDataset 199*c217d954SCole Faust { 200*c217d954SCole Faust public: SmallGEMMLowpFusedBatchedMatMulDatasetSigned()201*c217d954SCole Faust SmallGEMMLowpFusedBatchedMatMulDatasetSigned() 202*c217d954SCole Faust { 203*c217d954SCole Faust add_config(TensorShape(4U, 3U), TensorShape(2U, 4U), TensorShape(2U, 3U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 5, 1 << 25, 5, -128, 127)); 204*c217d954SCole Faust add_config(TensorShape(4U, 3U), TensorShape(2U, 4U), TensorShape(2U, 3U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 100, 1 << 25, 3, -128, 127)); 205*c217d954SCole Faust add_config(TensorShape(12U, 15U), TensorShape(7U, 12U), TensorShape(7U, 15U), -3, 15, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 0, 1 << 19, 0, -108, 127)); 206*c217d954SCole Faust add_config(TensorShape(59U, 17U), TensorShape(36U, 59U), TensorShape(36U, 17U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -30, 2, 1 << 25, -98, 107)); 207*c217d954SCole Faust add_config(TensorShape(2U, 4U, 3U), TensorShape(5U, 2U, 3U), TensorShape(5U, 4U, 3U), -5, 12, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -20, 1 << 25, 4, -127, 64)); 208*c217d954SCole Faust add_config(TensorShape(15U, 7U, 3U), TensorShape(29U, 15U, 3U), TensorShape(29U, 7U, 3U), 5, 2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -10, 1 << 25, 6, -64, 127)); 209*c217d954SCole Faust add_config(TensorShape(56U, 17U, 32U), TensorShape(5U, 56U, 32U), TensorShape(5U, 17U, 32U), 3, 2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -15, 1 << 25, 6, -127, 110)); 210*c217d954SCole Faust add_config(TensorShape(13U, 256U, 32U), TensorShape(19U, 13U, 32U), TensorShape(19U, 256U, 32U), 5, 2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -15, 1 << 25, 6, -77, 115)); 211*c217d954SCole Faust } 212*c217d954SCole Faust }; 213*c217d954SCole Faust 214*c217d954SCole Faust class SmallGEMMLowpFusedOffsetOutputOutput3DUint8Dataset final : public GEMMLowpFusedOffsetOutputDataset 215*c217d954SCole Faust { 216*c217d954SCole Faust public: SmallGEMMLowpFusedOffsetOutputOutput3DUint8Dataset()217*c217d954SCole Faust SmallGEMMLowpFusedOffsetOutputOutput3DUint8Dataset() 218*c217d954SCole Faust { 219*c217d954SCole Faust add_config(TensorShape(21U, 1421U, 33U), TensorShape(34U, 21U), TensorShape(34U, 7U, 203U, 33U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 13, 10, 210)); 220*c217d954SCole Faust add_config(TensorShape(31U, 102U, 55U), TensorShape(23U, 31U), TensorShape(23U, 1U, 102U, 55U), 0, 4, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 100, 2, 13, 10, 210)); 221*c217d954SCole Faust add_config(TensorShape(38U, 1200U, 77U), TensorShape(21U, 38U), TensorShape(21U, 4U, 300U, 77U), 18, 23, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 200, 2, 13, 10, 210)); 222*c217d954SCole Faust add_config(TensorShape(32U, 103U, 99U), TensorShape(17U, 32U), TensorShape(17U, 1U, 103U, 99U), -9, 1, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 13, 10, 210)); 223*c217d954SCole Faust add_config(TensorShape(16U, 1600U, 111U), TensorShape(8U, 16U), TensorShape(8U, 8U, 200U, 111U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601600, 10, 10, 224*c217d954SCole Faust 210)); 225*c217d954SCole Faust add_config(TensorShape(16U, 1600U, 113U), TensorShape(8U, 16U), TensorShape(8U, 8U, 200U, 113U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 0, 254601600, 10, 10, 226*c217d954SCole Faust 210)); 227*c217d954SCole Faust } 228*c217d954SCole Faust }; 229*c217d954SCole Faust 230*c217d954SCole Faust class SmallGEMMLowpFusedOffsetOutputInputOutput3DUint8Dataset final : public GEMMLowpFusedOffsetOutputDataset 231*c217d954SCole Faust { 232*c217d954SCole Faust public: SmallGEMMLowpFusedOffsetOutputInputOutput3DUint8Dataset()233*c217d954SCole Faust SmallGEMMLowpFusedOffsetOutputInputOutput3DUint8Dataset() 234*c217d954SCole Faust { 235*c217d954SCole Faust add_config(TensorShape(21U, 7U, 203U, 33U), TensorShape(34U, 21U), TensorShape(34U, 7U, 203U, 33U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 13, 10, 210)); 236*c217d954SCole Faust add_config(TensorShape(31U, 1U, 102U, 55U), TensorShape(23U, 31U), TensorShape(23U, 1U, 102U, 55U), 0, 4, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 100, 2, 13, 10, 210)); 237*c217d954SCole Faust add_config(TensorShape(38U, 4U, 300U, 77U), TensorShape(21U, 38U), TensorShape(21U, 4U, 300U, 77U), 18, 23, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 200, 2, 13, 10, 210)); 238*c217d954SCole Faust add_config(TensorShape(32U, 1U, 103U, 99U), TensorShape(17U, 32U), TensorShape(17U, 1U, 103U, 99U), -9, 1, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 13, 10, 210)); 239*c217d954SCole Faust add_config(TensorShape(16U, 8U, 200U, 111U), TensorShape(8U, 16U), TensorShape(8U, 8U, 200U, 111U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601600, 10, 10, 240*c217d954SCole Faust 210)); 241*c217d954SCole Faust add_config(TensorShape(16U, 8U, 200U, 113U), TensorShape(8U, 16U), TensorShape(8U, 8U, 200U, 113U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 0, 254601600, 10, 10, 242*c217d954SCole Faust 210)); 243*c217d954SCole Faust } 244*c217d954SCole Faust }; 245*c217d954SCole Faust 246*c217d954SCole Faust class SmallGEMMLowpFusedOffsetOutputInt8Dataset final : public GEMMLowpFusedOffsetOutputDataset 247*c217d954SCole Faust { 248*c217d954SCole Faust public: SmallGEMMLowpFusedOffsetOutputInt8Dataset()249*c217d954SCole Faust SmallGEMMLowpFusedOffsetOutputInt8Dataset() 250*c217d954SCole Faust { 251*c217d954SCole Faust add_config(TensorShape(21U, 1U), TensorShape(1U, 21U), TensorShape(1U, 1U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, -50, 2, 13, -10, 110)); 252*c217d954SCole Faust add_config(TensorShape(31U, 3U), TensorShape(72U, 31U), TensorShape(72U, 3U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 0, 2, 13, -10, 110)); 253*c217d954SCole Faust add_config(TensorShape(52U, 26U), TensorShape(33U, 52U), TensorShape(33U, 26U), -2, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 0, 2, 13, -10, 110)); 254*c217d954SCole Faust add_config(TensorShape(38U, 43U), TensorShape(21U, 38U), TensorShape(21U, 43U), -3, -2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, -40, 2, 13, -10, 110)); 255*c217d954SCole Faust 256*c217d954SCole Faust add_config(TensorShape(21U, 13U), TensorShape(33U, 21U), TensorShape(33U, 13U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -1, 254601600, 10, -10, 110)); 257*c217d954SCole Faust add_config(TensorShape(52U, 26U), TensorShape(33U, 52U), TensorShape(33U, 26U), -2, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 1, 254601600, 10, -10, 110)); 258*c217d954SCole Faust add_config(TensorShape(38U, 43U), TensorShape(21U, 38U), TensorShape(21U, 43U), -3, -2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601602, 10, -10, 110)); 259*c217d954SCole Faust add_config(TensorShape(32U, 72U), TensorShape(17U, 32U), TensorShape(17U, 72U), -9, 1, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -1, 254601602, 10, -10, 110)); 260*c217d954SCole Faust } 261*c217d954SCole Faust }; 262*c217d954SCole Faust 263*c217d954SCole Faust class SmallGEMMLowpFusedOffsetOutputPerChannelDataset final : public GEMMLowpFusedOffsetOutputDataset 264*c217d954SCole Faust { 265*c217d954SCole Faust public: SmallGEMMLowpFusedOffsetOutputPerChannelDataset()266*c217d954SCole Faust SmallGEMMLowpFusedOffsetOutputPerChannelDataset() 267*c217d954SCole Faust { 268*c217d954SCole Faust add_config(TensorShape(21U, 1U, 6U), TensorShape(43U, 21U, 6U), TensorShape(43U, 1U, 6U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, -200, 2, 13, 10, 210)); 269*c217d954SCole Faust add_config(TensorShape(21U, 13U, 3U), TensorShape(33U, 21U, 3U), TensorShape(33U, 13U, 3U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, -100, 2, 13, 10, 210)); 270*c217d954SCole Faust add_config(TensorShape(31U, 3U, 2U), TensorShape(72U, 31U, 2U), TensorShape(72U, 3U, 2U), -2, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 0, 2, 13, 10, 210)); 271*c217d954SCole Faust add_config(TensorShape(52U, 13U, 7U), TensorShape(33U, 52U, 7U), TensorShape(33U, 13U, 7U), 0, 4, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 100, 2, 13, 10, 210)); 272*c217d954SCole Faust add_config(TensorShape(52U, 26U, 8U), TensorShape(33U, 52U, 8U), TensorShape(33U, 26U, 8U), -2, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 0, 2, 13, 10, 210)); 273*c217d954SCole Faust } 274*c217d954SCole Faust }; 275*c217d954SCole Faust 276*c217d954SCole Faust class LargeGEMMLowpFusedOffsetOutputUint8Dataset final : public GEMMLowpFusedOffsetOutputDataset 277*c217d954SCole Faust { 278*c217d954SCole Faust public: LargeGEMMLowpFusedOffsetOutputUint8Dataset()279*c217d954SCole Faust LargeGEMMLowpFusedOffsetOutputUint8Dataset() 280*c217d954SCole Faust { 281*c217d954SCole Faust add_config(TensorShape(923U, 429U), TensorShape(871U, 923U), TensorShape(871U, 429U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 18, 10, 210)); 282*c217d954SCole Faust add_config(TensorShape(873U, 513U), TensorShape(784U, 873U), TensorShape(784U, 513U), 0, 4, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 100, 2, 18, 10, 210)); 283*c217d954SCole Faust add_config(TensorShape(1021U, 973U), TensorShape(783U, 1021U), TensorShape(783U, 973U), 5, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 200, 2, 18, 10, 210)); 284*c217d954SCole Faust add_config(TensorShape(941U, 1011U), TensorShape(623U, 941U), TensorShape(623U, 1011U), -9, 1, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -100, 2, 18, 10, 210)); 285*c217d954SCole Faust 286*c217d954SCole Faust add_config(TensorShape(923U, 429U), TensorShape(871U, 923U), TensorShape(871U, 429U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -1, 254601600, 15, 10, 210)); 287*c217d954SCole Faust add_config(TensorShape(873U, 513U), TensorShape(784U, 873U), TensorShape(784U, 513U), 0, 4, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 1, 254601600, 15, 10, 210)); 288*c217d954SCole Faust add_config(TensorShape(1021U, 973U), TensorShape(783U, 1021U), TensorShape(783U, 973U), 5, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601602, 15, 10, 210)); 289*c217d954SCole Faust add_config(TensorShape(681U, 1023U), TensorShape(213U, 681U), TensorShape(213U, 1023U), -3, -2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -1, 254601602, 15, 10, 210)); 290*c217d954SCole Faust } 291*c217d954SCole Faust }; 292*c217d954SCole Faust 293*c217d954SCole Faust class LargeGEMMLowpFusedOffsetOutputInt8Dataset final : public GEMMLowpFusedOffsetOutputDataset 294*c217d954SCole Faust { 295*c217d954SCole Faust public: LargeGEMMLowpFusedOffsetOutputInt8Dataset()296*c217d954SCole Faust LargeGEMMLowpFusedOffsetOutputInt8Dataset() 297*c217d954SCole Faust { 298*c217d954SCole Faust add_config(TensorShape(923U, 1U, 15U), TensorShape(871U, 923U, 15U), TensorShape(871U, 1U, 15U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, -50, 2, 18, -10, 110)); 299*c217d954SCole Faust add_config(TensorShape(873U, 7U), TensorShape(784U, 873U), TensorShape(784U, 7U), -1, 3, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 0, 2, 18, -10, 110)); 300*c217d954SCole Faust add_config(TensorShape(697U, 872U), TensorShape(563U, 697U), TensorShape(563U, 872U), -2, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, 0, 2, 18, -10, 110)); 301*c217d954SCole Faust add_config(TensorShape(681U, 1023U), TensorShape(213U, 681U), TensorShape(213U, 1023U), -3, -2, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN, -50, 2, 18, -10, 110)); 302*c217d954SCole Faust 303*c217d954SCole Faust add_config(TensorShape(923U, 1U), TensorShape(871U, 923U), TensorShape(871U, 1U), 0, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601600, 15, -10, 110)); 304*c217d954SCole Faust add_config(TensorShape(873U, 7U), TensorShape(784U, 873U), TensorShape(784U, 7U), -1, 3, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 0, 254601600, 15, -10, 110)); 305*c217d954SCole Faust add_config(TensorShape(697U, 872U), TensorShape(563U, 697U), TensorShape(563U, 872U), -2, 0, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, 2, 254601602, 15, -10, 110)); 306*c217d954SCole Faust add_config(TensorShape(1021U, 973U), TensorShape(783U, 1021U), TensorShape(783U, 973U), 5, 13, OutputStageInfo(GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, -2, 254601602, 15, -10, 110)); 307*c217d954SCole Faust } 308*c217d954SCole Faust }; 309*c217d954SCole Faust } // namespace datasets 310*c217d954SCole Faust } // namespace test 311*c217d954SCole Faust } // namespace arm_compute 312*c217d954SCole Faust #endif /* ARM_COMPUTE_TEST_GEMMLOWPOUTPUT_DATASET */ 313