diff options
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/std_transforms_fixed.hpp')
-rw-r--r-- | src/core/NEON/kernels/arm_gemm/std_transforms_fixed.hpp | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/std_transforms_fixed.hpp b/src/core/NEON/kernels/arm_gemm/std_transforms_fixed.hpp index c3c1e8d930..a9cbf4ec8d 100644 --- a/src/core/NEON/kernels/arm_gemm/std_transforms_fixed.hpp +++ b/src/core/NEON/kernels/arm_gemm/std_transforms_fixed.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2018-2020, 2024 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,8 +23,10 @@ */ #pragma once +#include "convolver.hpp" #include "mergeresults.hpp" #include "transform.hpp" +#include "interleave_indirect.hpp" namespace arm_gemm { @@ -39,32 +41,41 @@ namespace arm_gemm { * The optional 'block' parameter is for kernels using dot-product type * instructions like UDOT and SDOT. */ -template<typename TOperand, typename TResult, unsigned int height, unsigned int width, unsigned int block=1> +template<typename TOperand, typename TResult, unsigned int height, unsigned int width, unsigned int block=1, bool integrate_sums=false> class StdTransformsFixed { public: template<typename TIn> void PrepareA(TOperand *out, const TIn *in, const int stride, const int y0, - const int ymax, const int k0, const int kmax, bool transposed) { - if (transposed) { - Transform<height, block, true>(out, in, stride, y0, ymax, k0, kmax); - } else { - Transform<height, block, false>(out, in, stride, y0, ymax, k0, kmax); - } + const int ymax, const int k0, const int kmax, int32_t row_sum_multiplier) const { + Interleave<height, block, VLType::None>(out, in, stride, y0, ymax, k0, kmax, integrate_sums, row_sum_multiplier); + } + + template<typename TIn> + void PrepareA_indirect(TOperand *out, const TIn * const * const *ptr, size_t stringlen, size_t rounded_stringlen, const int y0, + const int ymax, const int k0, const int kmax, int32_t row_sum_multiplier) { + IndirectInterleave<height, block, VLType::None>(out, ptr, stringlen, rounded_stringlen, y0, ymax, k0, kmax, integrate_sums, row_sum_multiplier); + } + + template<typename TIn> + void PrepareA_convolution(TOperand *out, const TIn *ptr, size_t stride, const convolver<TIn> &conv, size_t rounded_stringlen, + const int y0, const int ymax, const int k0, const int kmax, int32_t row_sum_multiplier) { + ConvolutionInterleave<height, block, VLType::None>(out, ptr, stride, conv, rounded_stringlen, y0, ymax, k0, kmax, integrate_sums, row_sum_multiplier); + } + + bool PrepareB_supports_transpose() const { + return false; } template<typename TIn> void PrepareB(TOperand *out, const TIn *in, const int stride, const int x0, - const int xmax, const int k0, const int kmax, bool transposed) { - if (transposed) { - Transform<width, block, false>(out, in, stride, x0, xmax, k0, kmax); - } else { - Transform<width, block, true>(out, in, stride, x0, xmax, k0, kmax); - } + const int xmax, const int k0, const int kmax, bool transposed) const { + assert(!transposed); + Transform<width, block, true>(out, in, stride, x0, xmax, k0, kmax); } template<typename TOut> - void Merge(TOut *out, const TResult *in, int stride, int y0, int ymax, int x0, int xmax, const TOut *bias, const Activation act, bool append) { + void Merge(TOut *out, const TResult *in, int stride, int y0, int ymax, int x0, int xmax, const TOut *bias, const Activation act, bool append) const { MergeResults<width, height>(out, in, stride, y0, ymax, x0, xmax, bias, act, append); } }; |