26 #ifdef __ARM_FP16_ARGS
35 #if defined(__aarch64__)
36 #if defined(ARM_COMPUTE_ENABLE_SME)
41 #endif // defined(ARM_COMPUTE_ENABLE_SME)
42 #if defined(ARM_COMPUTE_ENABLE_SVE)
47 #endif // defined(ARM_COMPUTE_ENABLE_SVE)
52 #endif // defined(__aarch64__)
57 static const PoolingImplementation<__fp16, __fp16> pooling_fp16_methods[] = {
59 PoolingMethod::DEPTHFIRST,
60 "cpp_fp16_nhwc_1x1_stride_any_depthfirst",
61 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
62 return args.pool_window.rows == 1 &&
args.pool_window.cols == 1;
65 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
66 auto strat =
new cpp_nhwc_1x1_stride_any_depthfirst<__fp16>(
args.cpu_info);
67 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
70 #if defined(__aarch64__)
71 #if defined(ARM_COMPUTE_ENABLE_SME)
73 PoolingMethod::DEPTHFIRST,
74 "sme_fp16_nhwc_max_2x2_s1_output2x2_depthfirst",
75 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
76 return args.cpu_info->has_sme() &&
77 is_supported<sme_fp16_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, os);
80 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
81 auto strat =
new sme_fp16_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
82 return new PoolingDepthfirst<__fp16>(strat,
args);
86 PoolingMethod::DEPTHFIRST,
87 "sme_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst",
88 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
89 return args.cpu_info->has_sme() &&
90 is_supported<sme_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args, os);
93 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
94 auto strat =
new sme_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst(
args.cpu_info);
95 return new PoolingDepthfirst<__fp16>(strat,
args);
99 PoolingMethod::DEPTHFIRST,
100 "sme_fp16_nhwc_avg_generic_depthfirst",
101 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
102 return args.cpu_info->has_sme() &&
args.pool_type == PoolingType::AVERAGE;
105 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
106 auto strat =
new sme_fp16_nhwc_avg_generic_depthfirst(
args.cpu_info);
107 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
111 PoolingMethod::DEPTHFIRST,
112 "sme_fp16_nhwc_max_generic_depthfirst",
113 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
117 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
118 auto strat =
new sme_fp16_nhwc_max_generic_depthfirst(
args.cpu_info);
119 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
122 #endif // defined(ARM_COMPUTE_ENABLE_SME)
123 #if defined(ARM_COMPUTE_ENABLE_SVE)
125 PoolingMethod::DEPTHFIRST,
126 "sve_fp16_nhwc_max_2x2_s1_output2x2_depthfirst",
127 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
128 return args.cpu_info->has_sve() &&
129 is_supported<sve_fp16_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, os);
132 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
133 auto strat =
new sve_fp16_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
134 return new PoolingDepthfirst<__fp16>(strat,
args);
138 PoolingMethod::DEPTHFIRST,
139 "sve_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst",
140 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
141 return args.cpu_info->has_sve() &&
142 is_supported<sve_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst>(
args, os);
145 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
146 auto strat =
new sve_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst(
args.cpu_info);
147 return new PoolingDepthfirst<__fp16>(strat,
args);
151 PoolingMethod::DEPTHFIRST,
152 "sve_fp16_nhwc_avg_generic_depthfirst",
153 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
154 return args.cpu_info->has_sve() &&
args.pool_type == PoolingType::AVERAGE;
157 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
158 auto strat =
new sve_fp16_nhwc_avg_generic_depthfirst(
args.cpu_info);
159 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
163 PoolingMethod::DEPTHFIRST,
164 "sve_fp16_nhwc_max_generic_depthfirst",
165 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
169 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
170 auto strat =
new sve_fp16_nhwc_max_generic_depthfirst(
args.cpu_info);
171 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
174 #endif // defined(ARM_COMPUTE_ENABLE_SVE)
175 #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
177 PoolingMethod::DEPTHFIRST,
178 "a64_fp16_nhwc_max_2x2_s1_output2x2_depthfirst",
179 is_supported<a64_fp16_nhwc_max_2x2_s1_output2x2_depthfirst>,
181 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
182 auto strat =
new a64_fp16_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
183 return new PoolingDepthfirst<__fp16>(strat,
args);
187 PoolingMethod::DEPTHFIRST,
188 "a64_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst",
189 is_supported<a64_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst>,
191 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
192 auto strat =
new a64_fp16_nhwc_avg_3x3_s1_output2x2_depthfirst(
args.cpu_info);
193 return new PoolingDepthfirst<__fp16>(strat,
args);
197 PoolingMethod::DEPTHFIRST,
198 "a64_fp16_nhwc_avg_generic_depthfirst",
199 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type == PoolingType::AVERAGE; },
201 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
202 auto strat =
new a64_fp16_nhwc_avg_generic_depthfirst(
args.cpu_info);
203 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
207 PoolingMethod::DEPTHFIRST,
208 "a64_fp16_nhwc_max_generic_depthfirst",
211 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<__fp16, __fp16> * {
212 auto strat =
new a64_fp16_nhwc_max_generic_depthfirst(
args.cpu_info);
213 return new PoolingDepthfirstGeneric<__fp16>(strat,
args);
216 #endif // defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
217 #endif // defined(__aarch64__)
218 { PoolingMethod::DEFAULT,
"",
nullptr,
nullptr,
nullptr },
224 return pooling_fp16_methods;
227 template UniquePoolingCommon<__fp16, __fp16>
pooling(
const PoolingArgs &,
const Nothing &);
232 #endif // __ARM_FP16_ARGS