diff options
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/kernels/a64_interleaved_bf16fp32_dot_8x12.hpp')
-rw-r--r-- | src/core/NEON/kernels/arm_gemm/kernels/a64_interleaved_bf16fp32_dot_8x12.hpp | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/kernels/a64_interleaved_bf16fp32_dot_8x12.hpp b/src/core/NEON/kernels/arm_gemm/kernels/a64_interleaved_bf16fp32_dot_8x12.hpp index 2fea5ad2e7..25c5bf1b44 100644 --- a/src/core/NEON/kernels/arm_gemm/kernels/a64_interleaved_bf16fp32_dot_8x12.hpp +++ b/src/core/NEON/kernels/arm_gemm/kernels/a64_interleaved_bf16fp32_dot_8x12.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -22,51 +22,74 @@ * SOFTWARE. */ #pragma once - #ifdef __aarch64__ -#include "../bfloat.hpp" #include "../std_transforms_fixed.hpp" +#include "../bfloat.hpp" +#include "../performance_parameters.hpp" -namespace arm_gemm { +#define ARGLIST \ + const bfloat16 *, const bfloat16 *, \ + float *, int, int, int +namespace arm_gemm +{ // Actual kernel implementations -void a64_interleaved_bf16fp32_dot_8x12(const bfloat16 *, const bfloat16 *, float *, int, int, int); +void a64_interleaved_bf16fp32_dot_8x12( ARGLIST ); -class cls_a64_interleaved_bf16fp32_dot_8x12 { +class cls_a64_interleaved_bf16fp32_dot_8x12 +{ public: typedef bfloat16 operand_type; typedef float result_type; - typedef void (*kern_type)(const bfloat16 *, const bfloat16 *, float *, int, int, int); + typedef void (*kern_type)( ARGLIST ); /* Kernel blocking parameters */ - static unsigned int out_width() + static constexpr unsigned int out_height() { - return 12; + return 8; } - static unsigned int out_height() + static unsigned int out_width() { - return 8; + return 12; } - static unsigned int k_unroll() + static constexpr unsigned int k_unroll() { return 2; } - // Use the standard fixed size transforms. + StdTransformsFixed<operand_type, result_type, 8, 12, 2> transforms = {}; + StdTransformsFixed<operand_type, result_type, 8, 12, 2, true> transforms_quantized = {}; + template<typename T> + static inline PerformanceParameters get_performance_parameters(const CPUInfo *ci) + { - kern_type kernel=a64_interleaved_bf16fp32_dot_8x12; + if (std::is_same<T, bfloat16>::value) { + switch (ci->get_cpu_model()) { + default: + return { 15.93, 4.16, 7.19 }; + case CPUModel::V1: + return { 20.88, 5.10, 6.57 }; + case CPUModel::A510: + return { 7.77, 3.69, 3.02 }; + } + } + return { 1.0 }; + } + + // Default to the generic kernel + kern_type kernel=a64_interleaved_bf16fp32_dot_8x12; cls_a64_interleaved_bf16fp32_dot_8x12(const CPUInfo *) { - } }; } // namespace arm_gemm +#undef ARGLIST #endif // __aarch64__ |