diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-06-01 11:47:14 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-11-28 16:57:42 +0000 |
commit | 03b2971ac69a86f10a1566938d1a25afee15746c (patch) | |
tree | aec7cfc047e1da278b4b71a706cda7b1b0faa158 /src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp | |
parent | 7dc0234331f2150a6b4ac5c2b49de419870f7cf5 (diff) | |
download | ComputeLibrary-03b2971ac69a86f10a1566938d1a25afee15746c.tar.gz |
Integrate SME2 kernels
* Add SME/SME2 detection.
* Integrate SME2 implementation for:
- Normal convolution
- Winograd
- Depthwise convolution
- Pooling
Resolves: COMPMID-5700
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I2f1ca1d05f8cfeee9309ed1c0a36096a4a6aad5c
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8692
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp')
-rw-r--r-- | src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp b/src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp index b0c908a360..ee5a79b4ff 100644 --- a/src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp +++ b/src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp @@ -30,6 +30,11 @@ #include "kernels/cpp_nhwc_1x1_stride_any_depthfirst.hpp" #if defined(__aarch64__) +#if defined(ARM_COMPUTE_ENABLE_SME) +#include "kernels/sme_u8_nhwc_avg_generic_depthfirst.hpp" +#include "kernels/sme_u8_nhwc_max_2x2_s1_output2x2_depthfirst.hpp" +#include "kernels/sme_u8_nhwc_max_generic_depthfirst.hpp" +#endif // defined(ARM_COMPUTE_ENABLE_SME) #if defined(ARM_COMPUTE_ENABLE_SVE) #include "kernels/sve_u8_nhwc_avg_generic_depthfirst.hpp" #include "kernels/sve_u8_nhwc_max_2x2_s1_output2x2_depthfirst.hpp" @@ -59,6 +64,52 @@ static const PoolingImplementation<uint8_t, uint8_t> pooling_u8_methods[] = { }, }, #if defined(__aarch64__) +#if defined(ARM_COMPUTE_ENABLE_SME) + { + PoolingMethod::DEPTHFIRST, + "sme_u8_nhwc_max_2x2_s1_output2x2_depthfirst", + [] (const PoolingArgs &args, const Nothing &os) -> bool { + return args.cpu_info->has_sme() && + is_supported<sme_u8_nhwc_max_2x2_s1_output2x2_depthfirst>(args, os); + }, + nullptr, + [] (const PoolingArgs &args, const Nothing &) -> PoolingCommon<uint8_t, uint8_t> * { + auto strat = new sme_u8_nhwc_max_2x2_s1_output2x2_depthfirst(args.cpu_info); + return new PoolingDepthfirst<uint8_t>(strat, args); + }, + }, + { + PoolingMethod::DEPTHFIRST, + "sme_u8_nhwc_avg_generic_depthfirst", + [] (const PoolingArgs &args, const Nothing &) -> bool { + // This kernel can only be used when there is either no padding, or we don't care + // about the value of the padding. Otherwise, we would need to pass in the zero-point + // for the quantization regime. + return (args.exclude_padding || + (args.padding.top == 0 && args.padding.bottom == 0 && + args.padding.left == 0 && args.padding.right == 0) + ) && args.pool_type == PoolingType::AVERAGE && + args.cpu_info->has_sme2(); + }, + nullptr, + [] (const PoolingArgs &args, const Nothing &) -> PoolingCommon<uint8_t, uint8_t> * { + auto strat = new sme_u8_nhwc_avg_generic_depthfirst(args.cpu_info); + return new PoolingDepthfirstGeneric<uint8_t>(strat, args); + }, + }, + { + PoolingMethod::DEPTHFIRST, + "sme_u8_nhwc_max_generic_depthfirst", + [] (const PoolingArgs &args, const Nothing &) -> bool { + return args.cpu_info->has_sme() && args.pool_type == PoolingType::MAX; + }, + nullptr, + [] (const PoolingArgs &args, const Nothing &) -> PoolingCommon<uint8_t, uint8_t> * { + auto strat = new sme_u8_nhwc_max_generic_depthfirst(args.cpu_info); + return new PoolingDepthfirstGeneric<uint8_t>(strat, args); + }, + }, +#endif // defined(ARM_COMPUTE_ENABLE_SME) #if defined(ARM_COMPUTE_ENABLE_SVE) { PoolingMethod::DEPTHFIRST, |