1 /* 2 * Copyright (c) 2022 Arm Limited. 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 */ 24 25 namespace arm_conv { 26 namespace depthwise { 27 28 void sme2_u8q_planar_3x3_s1_4rows_dot_za_impl( 29 const uint8_t *inptr, 30 size_t ld_in_row, 31 size_t ld_in_col, 32 size_t ld_in_vl, 33 unsigned int pad_top, 34 unsigned int valid_input_rows, 35 unsigned int pad_left, 36 unsigned int valid_input_cols, 37 const uint8_t *weights, 38 uint8_t **outptrs, 39 const size_t *outlds, 40 const size_t *outvllds, 41 unsigned int output_cols, 42 unsigned int start_channel, 43 unsigned int valid_channels, 44 const arm_gemm::Requantize32 &qp 45 ); 46 47 class sme2_u8q_planar_3x3_s1_4rows_dot_za : public PlanarStrategy<uint8_t, uint8_t> 48 { 49 using Parent = PlanarStrategy<uint8_t, uint8_t>; 50 51 public: 52 using return_type = uint8_t; 53 constexpr static auto output_rows = 4u; 54 constexpr static auto kernel_rows = 3u, kernel_cols = 3u; 55 constexpr static auto stride_rows = 1u, stride_cols = 1u; 56 constexpr static auto vl_type = arm_gemm::VLType::SME; 57 sme2_u8q_planar_3x3_s1_4rows_dot_za(const CPUInfo *)58 sme2_u8q_planar_3x3_s1_4rows_dot_za(const CPUInfo *) 59 : Parent(kernel_rows, kernel_cols, stride_rows, stride_cols, output_rows, vl_type) 60 { 61 } 62 get_kernel(void) const63 typename Parent::KernelType get_kernel(void) const override 64 { 65 return sme2_u8q_planar_3x3_s1_4rows_dot_za_impl; 66 } 67 }; 68 69 } // namespace depthwise 70 } // namespace arm_conv 71