diff options
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_fp32_mla_6x16.hpp')
-rw-r--r-- | src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_fp32_mla_6x16.hpp | 78 |
1 files changed, 46 insertions, 32 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_fp32_mla_6x16.hpp b/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_fp32_mla_6x16.hpp index 37d0b8f62d..7f85d2dd42 100644 --- a/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_fp32_mla_6x16.hpp +++ b/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_fp32_mla_6x16.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021, 2023-2024 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -10,41 +10,42 @@ * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #pragma once #ifdef __aarch64__ +#include "../std_transforms_fixed_trB.hpp" #include "../performance_parameters.hpp" -#include "../std_transforms_fixed.hpp" #define ARGLIST \ - unsigned int, const unsigned int *, \ - IndirectInputArg<float>, \ - size_t, size_t, \ - const float *, \ - IndirectOutputArg<float>, \ - const float *, Activation, bool + unsigned int, const unsigned int *, \ + IndirectInputArg<float>, \ + size_t, size_t, \ + const float *, \ + IndirectOutputArg<float>, \ + const float *, Activation, bool namespace arm_gemm { - // Actual kernel implementations void a64_hybrid_fp32_mla_6x16( ARGLIST ); +void a64_hybrid_fp32_mla_6x16_a55( ARGLIST ); class cls_a64_hybrid_fp32_mla_6x16 { public: - typedef float operand_type; + typedef float lhs_operand_type; + typedef float rhs_operand_type; typedef float result_type; typedef void (*kern_type)( ARGLIST ); @@ -70,29 +71,42 @@ public: return true; } - static PerformanceParameters get_performance_parameters(const CPUInfo *ci) { - switch (ci->get_cpu_model()) { - case CPUModel::A55r1: - return { 2.287 }; - - case CPUModel::A53: - return { 1.43 }; - - case CPUModel::A73: - return { 2.56 }; - - default: - return { 6.667 }; + StdTransformsFixedTRB<rhs_operand_type, result_type, 6, 16, 1> transforms = {}; + template<typename T> + static inline PerformanceParameters get_performance_parameters(const CPUInfo *ci) + { + if (std::is_same<T, float>::value) { + switch (ci->get_cpu_model()) { + case CPUModel::A55r1: + return { 2.986 }; + case CPUModel::A53: + return { 1.43 }; + case CPUModel::A73: + return { 2.56 }; + default: + return { 6.667 }; + case CPUModel::A510: + return { 3.88 }; + case CPUModel::V1: + return { 13.43 }; + } } - } - StdTransformsFixed<operand_type, result_type, 6, 16, 1> transforms = {}; + return { 1.0 }; + } // Default to the generic kernel kern_type kernel=a64_hybrid_fp32_mla_6x16; - - cls_a64_hybrid_fp32_mla_6x16(const CPUInfo *) + cls_a64_hybrid_fp32_mla_6x16(const CPUInfo *ci) { + switch(ci->get_cpu_model()) { + default: + break; + case CPUModel::A55r1: + case CPUModel::A53: + kernel=a64_hybrid_fp32_mla_6x16_a55; + break; + } } }; |