diff options
Diffstat (limited to 'src/core/NEON/kernels/arm_conv/depthwise/depthwise_u8s8u8q.cpp')
-rw-r--r-- | src/core/NEON/kernels/arm_conv/depthwise/depthwise_u8s8u8q.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/src/core/NEON/kernels/arm_conv/depthwise/depthwise_u8s8u8q.cpp b/src/core/NEON/kernels/arm_conv/depthwise/depthwise_u8s8u8q.cpp index af4426b69f..9b989012b8 100644 --- a/src/core/NEON/kernels/arm_conv/depthwise/depthwise_u8s8u8q.cpp +++ b/src/core/NEON/kernels/arm_conv/depthwise/depthwise_u8s8u8q.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. + * Copyright (c) 2021-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,19 +25,18 @@ #include "arm_gemm_local.hpp" #include "depthwise_implementation.hpp" -#include "depthwise_depthfirst_quantized.hpp" -#include "depthwise_depthfirst_generic_quantized.hpp" -#include "depthwise_depthfirst_multiplier_quantized.hpp" -#include "depthwise_depthfirst_generic_multiplier_quantized.hpp" +#include "depthwise_depthfirst.hpp" +#include "depthwise_depthfirst_generic.hpp" +#include "depthwise_depthfirst_multiplier.hpp" #include "depthwise_implementation_constraints.hpp" #if defined(__aarch64__) -#if defined(ARM_COMPUTE_ENABLE_SVE) && defined(ARM_COMPUTE_ENABLE_SVE2) +#if defined(ARM_COMPUTE_ENABLE_SVE) #include "kernels/sve_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst.hpp" #include "kernels/sve_u8s8u8q_nhwc_3x3_s2_output2x2_mla_depthfirst.hpp" #include "kernels/sve_u8s8u8q_nhwc_5x5_s1_output2x2_mla_depthfirst.hpp" -#endif // defined(ARM_COMPUTE_ENABLE_SVE) && defined(ARM_COMPUTE_ENABLE_SVE2) +#endif // defined(ARM_COMPUTE_ENABLE_SVE) #include "kernels/a64_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst.hpp" #include "kernels/a64_u8s8u8q_nhwc_3x3_s2_output2x2_mla_depthfirst.hpp" #include "kernels/a64_u8s8u8q_nhwc_5x5_s1_output2x2_mla_depthfirst.hpp" @@ -54,7 +53,7 @@ namespace depthwise { static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> depthwise_u8q_methods[] = { #if defined(__aarch64__) -#if defined(ARM_COMPUTE_ENABLE_SVE) && defined(ARM_COMPUTE_ENABLE_SVE2) +#if defined(ARM_COMPUTE_ENABLE_SVE) { DepthwiseMethod::DEPTHFIRST, "sve_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst", @@ -64,7 +63,8 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep cpu_has_sve2), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstQuantized<sve_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst>(args, qp); + auto strat = new sve_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst(args.cpu_info); + return new DepthwiseDepthfirst<uint8_t, int8_t>(strat, args, qp); }, }, { @@ -76,7 +76,8 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep cpu_has_sve2), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstQuantized<sve_u8s8u8q_nhwc_3x3_s2_output2x2_mla_depthfirst>(args, qp); + auto strat = new sve_u8s8u8q_nhwc_3x3_s2_output2x2_mla_depthfirst(args.cpu_info); + return new DepthwiseDepthfirst<uint8_t, int8_t>(strat, args, qp); }, }, { @@ -88,10 +89,11 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep cpu_has_sve2), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstQuantized<sve_u8s8u8q_nhwc_5x5_s1_output2x2_mla_depthfirst>(args, qp); + auto strat = new sve_u8s8u8q_nhwc_5x5_s1_output2x2_mla_depthfirst(args.cpu_info); + return new DepthwiseDepthfirst<uint8_t, int8_t>(strat, args, qp); }, }, -#endif // defined(ARM_COMPUTE_ENABLE_SVE) && defined(ARM_COMPUTE_ENABLE_SVE2) +#endif // defined(ARM_COMPUTE_ENABLE_SVE) { DepthwiseMethod::DEPTHFIRST, "a64_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst", @@ -100,7 +102,8 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep qp_has_no_left_shift), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstQuantized<a64_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst>(args, qp); + auto strat = new a64_u8s8u8q_nhwc_3x3_s1_output2x2_mla_depthfirst(args.cpu_info); + return new DepthwiseDepthfirst<uint8_t, int8_t>(strat, args, qp); }, }, { @@ -111,7 +114,8 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep qp_has_no_left_shift), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstQuantized<a64_u8s8u8q_nhwc_3x3_s2_output2x2_mla_depthfirst>(args, qp); + auto strat = new a64_u8s8u8q_nhwc_3x3_s2_output2x2_mla_depthfirst(args.cpu_info); + return new DepthwiseDepthfirst<uint8_t, int8_t>(strat, args, qp); }, }, { @@ -122,7 +126,8 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep qp_has_no_left_shift), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstQuantized<a64_u8s8u8q_nhwc_5x5_s1_output2x2_mla_depthfirst>(args, qp); + auto strat = new a64_u8s8u8q_nhwc_5x5_s1_output2x2_mla_depthfirst(args.cpu_info); + return new DepthwiseDepthfirst<uint8_t, int8_t>(strat, args, qp); }, }, { @@ -131,16 +136,20 @@ static const DepthwiseImplementation<uint8_t, int8_t, uint8_t, Requantize32> dep constraint<Requantize32>(has_no_channel_multiplier), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstGenericQuantized<a64_u8s8u8q_nhwc_generic_output9_mla_depthfirst, 3, 3>(args, qp); + auto kernel = new a64_u8s8u8q_nhwc_generic_output9_mla_depthfirst(args.cpu_info); + auto strat = new GenericDepthfirstStrategy<uint8_t, int8_t>(kernel, 3, 3, args); + return new DepthwiseDepthfirstGeneric<uint8_t, int8_t>(strat, args, qp); }, }, { DepthwiseMethod::DEPTHFIRST, "a64_u8s8u8q_packed_to_nhwc_generic_with_multiplier_output2x8_mla_depthfirst", - nullptr, + constraint<Requantize32>(has_channel_multiplier), nullptr, [] (const DepthwiseArgs &args, const Requantize32 &qp) -> DepthwiseCommon<uint8_t, int8_t, uint8_t> * { - return new DepthwiseDepthfirstGenericWithMultiplierQuantized<a64_u8s8u8q_packed_to_nhwc_generic_with_multiplier_output2x8_mla_depthfirst>(args, qp); + auto kern = new a64_u8s8u8q_packed_to_nhwc_generic_with_multiplier_output2x8_mla_depthfirst(args.cpu_info); + auto strat = new GenericDepthfirstMultiplierStrategy<uint8_t, int8_t>(kern, args); + return new DepthwiseDepthfirstMultiplier<uint8_t, int8_t, uint8_t, int32_t, true>(strat, args, qp); }, }, #endif // defined(__aarch64__) |