32 #if defined(__aarch64__) 33 #if defined(ARM_COMPUTE_ENABLE_SVE) 34 #if defined(ARM_COMPUTE_ENABLE_SVE2) 36 #endif // defined(ARM_COMPUTE_ENABLE_SVE2) 39 #endif // defined(ARM_COMPUTE_ENABLE_SVE) 43 #endif // defined(__aarch64__) 52 template <
class Strategy>
53 bool is_supported(
const PoolingArgs &
args,
const Nothing &)
55 return ((args.pool_type == Strategy::pooling_type()) &&
56 (args.pool_window.rows == Strategy::pool_rows()) &&
57 (args.pool_window.cols == Strategy::pool_cols()) &&
58 (args.pool_stride.rows == Strategy::stride_rows()) &&
59 (args.pool_stride.cols == Strategy::stride_cols()));
63 static const PoolingImplementation<int8_t, int8_t> pooling_s8_methods[] = {
65 PoolingMethod::DEPTHFIRST,
66 "cpp_s8_nhwc_1x1_stride_any_depthfirst",
67 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
68 return args.pool_window.rows == 1 && args.pool_window.cols == 1;
71 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
72 return new PoolingDepthfirstGeneric<cpp_nhwc_1x1_stride_any_depthfirst<int8_t>>(
args);
75 #if defined(__aarch64__) 76 #if defined(ARM_COMPUTE_ENABLE_SVE) 77 #if defined(ARM_COMPUTE_ENABLE_SVE2) 79 PoolingMethod::DEPTHFIRST,
80 "sve_s8_nhwc_avg_generic_depthfirst",
81 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.cpu_info->has_sve2() && args.pool_type == PoolingType::AVERAGE; },
83 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
84 return new PoolingDepthfirstGeneric<sve_s8_nhwc_avg_generic_depthfirst>(
args);
87 #endif // defined(ARM_COMPUTE_ENABLE_SVE2) 89 PoolingMethod::DEPTHFIRST,
90 "sve_s8_nhwc_max_2x2_s1_output2x2_depthfirst",
91 [] (
const PoolingArgs &
args,
const Nothing &unused) ->
bool {
92 return args.cpu_info->has_sve() && is_supported<sve_s8_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, unused);
95 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
96 return new PoolingDepthfirst<sve_s8_nhwc_max_2x2_s1_output2x2_depthfirst>(
args);
100 PoolingMethod::DEPTHFIRST,
101 "sve_s8_nhwc_max_generic_depthfirst",
102 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.cpu_info->has_sve() && args.pool_type ==
PoolingType::MAX; },
104 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
105 return new PoolingDepthfirstGeneric<sve_s8_nhwc_max_generic_depthfirst>(
args);
108 #endif // defined(ARM_COMPUTE_ENABLE_SVE) 110 PoolingMethod::DEPTHFIRST,
111 "a64_s8_nhwc_max_2x2_s1_output2x2_depthfirst",
112 is_supported<a64_s8_nhwc_max_2x2_s1_output2x2_depthfirst>,
114 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
115 return new PoolingDepthfirst<a64_s8_nhwc_max_2x2_s1_output2x2_depthfirst>(
args);
119 PoolingMethod::DEPTHFIRST,
120 "a64_s8_nhwc_avg_generic_depthfirst",
121 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type == PoolingType::AVERAGE; },
123 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
124 return new PoolingDepthfirstGeneric<a64_s8_nhwc_avg_generic_depthfirst>(
args);
128 PoolingMethod::DEPTHFIRST,
129 "a64_s8_nhwc_max_generic_depthfirst",
130 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type ==
PoolingType::MAX; },
132 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
133 return new PoolingDepthfirstGeneric<a64_s8_nhwc_max_generic_depthfirst>(
args);
136 #endif // defined(__aarch64__) 137 { PoolingMethod::DEFAULT,
"",
nullptr,
nullptr,
nullptr },
143 return pooling_s8_methods;
146 template UniquePoolingCommon<int8_t, int8_t>
pooling(
const PoolingArgs &,
const Nothing &);
template UniquePoolingCommon< float, float > pooling(const PoolingArgs &, const Nothing &)
const PoolingImplementation< float, float > * pooling_implementation_list()