32 #if defined(__aarch64__)
33 #if defined(ARM_COMPUTE_ENABLE_SME)
37 #endif // defined(ARM_COMPUTE_ENABLE_SME)
38 #if defined(ARM_COMPUTE_ENABLE_SVE)
42 #endif // defined(ARM_COMPUTE_ENABLE_SVE)
46 #endif // defined(__aarch64__)
53 static const PoolingImplementation<int8_t, int8_t> pooling_s8_methods[] = {
55 PoolingMethod::DEPTHFIRST,
56 "cpp_s8_nhwc_1x1_stride_any_depthfirst",
57 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
58 return args.pool_window.rows == 1 &&
args.pool_window.cols == 1;
61 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
62 auto strat =
new cpp_nhwc_1x1_stride_any_depthfirst<int8_t>(
args.cpu_info);
63 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
66 #if defined(__aarch64__)
67 #if defined(ARM_COMPUTE_ENABLE_SME)
69 PoolingMethod::DEPTHFIRST,
70 "sme_s8_nhwc_max_2x2_s1_output2x2_depthfirst",
71 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
72 return args.cpu_info->has_sme() &&
73 is_supported<sme_s8_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, os);
76 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
77 auto strat =
new sme_s8_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
78 return new PoolingDepthfirst<int8_t>(strat,
args);
82 PoolingMethod::DEPTHFIRST,
83 "sme_s8_nhwc_avg_generic_depthfirst",
84 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
85 return args.cpu_info->has_sme2() &&
args.pool_type == PoolingType::AVERAGE;
88 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
89 auto strat =
new sme_s8_nhwc_avg_generic_depthfirst(
args.cpu_info);
90 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
94 PoolingMethod::DEPTHFIRST,
95 "sme_s8_nhwc_max_generic_depthfirst",
96 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
100 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
101 auto strat =
new sme_s8_nhwc_max_generic_depthfirst(
args.cpu_info);
102 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
105 #endif // defined(ARM_COMPUTE_ENABLE_SME)
106 #if defined(ARM_COMPUTE_ENABLE_SVE)
108 PoolingMethod::DEPTHFIRST,
109 "sve_s8_nhwc_max_2x2_s1_output2x2_depthfirst",
110 [] (
const PoolingArgs &
args,
const Nothing &os) ->
bool {
111 return args.cpu_info->has_sve() &&
112 is_supported<sve_s8_nhwc_max_2x2_s1_output2x2_depthfirst>(
args, os);
115 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
116 auto strat =
new sve_s8_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
117 return new PoolingDepthfirst<int8_t>(strat,
args);
121 PoolingMethod::DEPTHFIRST,
122 "sve_s8_nhwc_avg_generic_depthfirst",
123 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
124 return args.cpu_info->has_sve2() &&
args.pool_type == PoolingType::AVERAGE;
127 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
128 auto strat =
new sve_s8_nhwc_avg_generic_depthfirst(
args.cpu_info);
129 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
133 PoolingMethod::DEPTHFIRST,
134 "sve_s8_nhwc_max_generic_depthfirst",
135 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
139 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
140 auto strat =
new sve_s8_nhwc_max_generic_depthfirst(
args.cpu_info);
141 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
144 #endif // defined(ARM_COMPUTE_ENABLE_SVE)
146 PoolingMethod::DEPTHFIRST,
147 "a64_s8_nhwc_max_2x2_s1_output2x2_depthfirst",
148 is_supported<a64_s8_nhwc_max_2x2_s1_output2x2_depthfirst>,
150 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
151 auto strat =
new a64_s8_nhwc_max_2x2_s1_output2x2_depthfirst(
args.cpu_info);
152 return new PoolingDepthfirst<int8_t>(strat,
args);
156 PoolingMethod::DEPTHFIRST,
157 "a64_s8_nhwc_avg_generic_depthfirst",
158 [] (
const PoolingArgs &
args,
const Nothing &) ->
bool {
return args.pool_type == PoolingType::AVERAGE; },
160 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
161 auto strat =
new a64_s8_nhwc_avg_generic_depthfirst(
args.cpu_info);
162 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
166 PoolingMethod::DEPTHFIRST,
167 "a64_s8_nhwc_max_generic_depthfirst",
170 [] (
const PoolingArgs &
args,
const Nothing &) -> PoolingCommon<int8_t, int8_t> * {
171 auto strat =
new a64_s8_nhwc_max_generic_depthfirst(
args.cpu_info);
172 return new PoolingDepthfirstGeneric<int8_t>(strat,
args);
175 #endif // defined(__aarch64__)
176 { PoolingMethod::DEFAULT,
"",
nullptr,
nullptr,
nullptr },
182 return pooling_s8_methods;
185 template UniquePoolingCommon<int8_t, int8_t>
pooling(
const PoolingArgs &,
const Nothing &);