32 #if defined(__aarch64__)
33 #if defined(ARM_COMPUTE_ENABLE_SME)
38 #endif // defined(ARM_COMPUTE_ENABLE_SME)
39 #if defined(ARM_COMPUTE_ENABLE_SVE)
44 #endif // defined(ARM_COMPUTE_ENABLE_SVE)
49 #endif // defined(__aarch64__)
54 static const PoolingImplementation<float, float> pooling_fp32_methods[] = {
56 PoolingMethod::DEPTHFIRST,
57 "cpp_fp32_nhwc_1x1_stride_any_depthfirst",
58 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
59 return args.pool_window.rows == 1 &&
args.pool_window.cols == 1;
62 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
63 auto strat =
new cpp_nhwc_1x1_stride_any_depthfirst<float>(
args.cpu_info);
64 return new PoolingDepthfirstGeneric<float, float, Nothing>(strat,
args);
67 #if defined(__aarch64__)
68 #if defined(ARM_COMPUTE_ENABLE_SME)
70 PoolingMethod::DEPTHFIRST,
71 "sme_fp32_nhwc_max_2x2_s1_output2x2_depthfirst",
72 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
73 return args.cpu_info->has_sme() &&
74 is_supported<sme_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, os);
77 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
78 auto strat =
new sme_fp32_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
79 return new PoolingDepthfirst<float>(strat,
args);
83 PoolingMethod::DEPTHFIRST,
84 "sme_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst",
85 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
86 return args.cpu_info->has_sme() &&
87 is_supported<sme_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args, os);
90 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
91 auto strat =
new sme_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst(
args.cpu_info);
92 return new PoolingDepthfirst<float>(strat,
args);
96 PoolingMethod::DEPTHFIRST,
97 "sme_fp32_nhwc_avg_generic_depthfirst",
98 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
99 return args.cpu_info->has_sme() &&
args.pool_type == PoolingType::AVERAGE;
102 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
103 auto strat =
new sme_fp32_nhwc_avg_generic_depthfirst(
args.cpu_info);
104 return new PoolingDepthfirstGeneric<float>(strat,
args);
108 PoolingMethod::DEPTHFIRST,
109 "sme_fp32_nhwc_max_generic_depthfirst",
110 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
114 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
115 auto strat =
new sme_fp32_nhwc_max_generic_depthfirst(
args.cpu_info);
116 return new PoolingDepthfirstGeneric<float>(strat,
args);
119 #endif // defined(ARM_COMPUTE_ENABLE_SME)
120 #if defined(ARM_COMPUTE_ENABLE_SVE)
122 PoolingMethod::DEPTHFIRST,
123 "sve_fp32_nhwc_max_2x2_s1_output2x2_depthfirst",
124 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
125 return args.cpu_info->has_sve() &&
126 is_supported<sve_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, os);
129 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
130 auto strat =
new sve_fp32_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
131 return new PoolingDepthfirst<float>(strat,
args);
135 PoolingMethod::DEPTHFIRST,
136 "sve_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst",
137 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
138 return args.cpu_info->has_sve() &&
139 is_supported<sve_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args, os);
142 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
143 auto strat =
new sve_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst(
args.cpu_info);
144 return new PoolingDepthfirst<float>(strat,
args);
148 PoolingMethod::DEPTHFIRST,
149 "sve_fp32_nhwc_avg_generic_depthfirst",
150 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
151 return args.cpu_info->has_sve() &&
args.pool_type == PoolingType::AVERAGE;
154 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
155 auto strat =
new sve_fp32_nhwc_avg_generic_depthfirst(
args.cpu_info);
156 return new PoolingDepthfirstGeneric<float>(strat,
args);
160 PoolingMethod::DEPTHFIRST,
161 "sve_fp32_nhwc_max_generic_depthfirst",
162 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
166 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
167 auto strat =
new sve_fp32_nhwc_max_generic_depthfirst(
args.cpu_info);
168 return new PoolingDepthfirstGeneric<float>(strat,
args);
171 #endif // defined(ARM_COMPUTE_ENABLE_SVE)
173 PoolingMethod::DEPTHFIRST,
174 "a64_fp32_nhwc_max_2x2_s1_output2x2_depthfirst",
175 is_supported<a64_fp32_nhwc_max_2x2_s1_output2x2_depthfirst>,
177 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
178 auto strat =
new a64_fp32_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
179 return new PoolingDepthfirst<float>(strat,
args);
183 PoolingMethod::DEPTHFIRST,
184 "a64_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst",
185 is_supported<a64_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst>,
187 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
188 auto strat =
new a64_fp32_nhwc_avg_3x3_s1_output2x2_depthfirst(
args.cpu_info);
189 return new PoolingDepthfirst<float>(strat,
args);
193 PoolingMethod::DEPTHFIRST,
194 "a64_fp32_nhwc_avg_generic_depthfirst",
195 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type == PoolingType::AVERAGE; },
197 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
198 auto strat =
new a64_fp32_nhwc_avg_generic_depthfirst(
args.cpu_info);
199 return new PoolingDepthfirstGeneric<float>(strat,
args);
203 PoolingMethod::DEPTHFIRST,
204 "a64_fp32_nhwc_max_generic_depthfirst",
207 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<float, float> * {
208 auto strat =
new a64_fp32_nhwc_max_generic_depthfirst(
args.cpu_info);
209 return new PoolingDepthfirstGeneric<float>(strat,
args);
212 #endif // defined(__aarch64__)
213 { PoolingMethod::DEFAULT,
"",
nullptr,
nullptr,
nullptr },
219 return pooling_fp32_methods;
222 template UniquePoolingCommon<float, float>
pooling(
const PoolingArgs &,
const Nothing &);