32 #if defined(__aarch64__) 33 #if defined(ARM_COMPUTE_ENABLE_SVE) 38 #endif // defined(ARM_COMPUTE_ENABLE_SVE) 43 #endif // defined(__aarch64__) 50 template <
class Strategy>
51 bool is_supported(
const PoolingArgs &
args,
const Nothing &)
53 return ((args.pool_type == Strategy::pooling_type()) &&
54 (args.pool_window.rows == Strategy::pool_rows()) &&
55 (args.pool_window.cols == Strategy::pool_cols()) &&
56 (args.pool_stride.rows == Strategy::stride_rows()) &&
57 (args.pool_stride.cols == Strategy::stride_cols()));
61 static const PoolingImplementation<float, float> pooling_fp32_methods[] = {
63 PoolingMethod::DEPTHFIRST,
64 "cpp_fp32_nhwc_1x1_stride_any_depthfirst",
65 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
66 return args.pool_window.rows == 1 && args.pool_window.cols == 1;
69 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
70 return new PoolingDepthfirstGeneric<cpp_nhwc_1x1_stride_any_depthfirst<float>>(
args);
73 #if defined(__aarch64__) 74 #if defined(ARM_COMPUTE_ENABLE_SVE) 76 PoolingMethod::DEPTHFIRST,
77 "sve_fp32_nhwc_max_2x2_s1_output2x2_depthfirst",
78 [] (
const PoolingArgs &
args,
const Nothing &unused) ->
bool {
79 return args.cpu_info->has_sve() && is_supported<sve_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, unused);
82 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
83 return new PoolingDepthfirst<sve_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>(
args);
87 PoolingMethod::DEPTHFIRST,
88 "sve_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst",
89 [] (
const PoolingArgs &
args,
const Nothing &unused) ->
bool {
90 return args.cpu_info->has_sve() && is_supported<sve_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args, unused);
93 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
94 return new PoolingDepthfirst<sve_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args);
98 PoolingMethod::DEPTHFIRST,
99 "sve_fp32_nhwc_avg_generic_depthfirst",
100 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
101 return args.cpu_info->has_sve() && args.pool_type == PoolingType::AVERAGE;
104 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
105 return new PoolingDepthfirstGeneric<sve_fp32_nhwc_avg_generic_depthfirst>(
args);
109 PoolingMethod::DEPTHFIRST,
110 "sve_fp32_nhwc_max_generic_depthfirst",
111 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
115 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
116 return new PoolingDepthfirstGeneric<sve_fp32_nhwc_max_generic_depthfirst>(
args);
119 #endif // defined(ARM_COMPUTE_ENABLE_SVE) 121 PoolingMethod::DEPTHFIRST,
122 "a64_fp32_nhwc_max_2x2_s1_output2x2_depthfirst",
123 is_supported<a64_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>,
125 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
126 return new PoolingDepthfirst<a64_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>(
args);
130 PoolingMethod::DEPTHFIRST,
131 "a64_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst",
132 is_supported<a64_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>,
134 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
135 return new PoolingDepthfirst<a64_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args);
139 PoolingMethod::DEPTHFIRST,
140 "a64_fp32_nhwc_avg_generic_depthfirst",
141 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type == PoolingType::AVERAGE; },
143 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
144 return new PoolingDepthfirstGeneric<a64_fp32_nhwc_avg_generic_depthfirst>(
args);
148 PoolingMethod::DEPTHFIRST,
149 "a64_fp32_nhwc_max_generic_depthfirst",
150 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type ==
PoolingType::MAX; },
152 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
153 return new PoolingDepthfirstGeneric<a64_fp32_nhwc_max_generic_depthfirst>(
args);
156 #endif // defined(__aarch64__) 157 { PoolingMethod::DEFAULT,
"",
nullptr,
nullptr,
nullptr },
163 return pooling_fp32_methods;
166 template UniquePoolingCommon<float, float>
pooling(
const PoolingArgs &,
const Nothing &);
template UniquePoolingCommon< float, float > pooling(const PoolingArgs &, const Nothing &)
const PoolingImplementation< float, float > * pooling_implementation_list()