• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) Facebook, Inc. and its affiliates.
2 // All rights reserved.
3 //
4 // Copyright 2019 Google LLC
5 //
6 // This source code is licensed under the BSD-style license found in the
7 // LICENSE file in the root directory of this source tree.
8 
9 #pragma once
10 
11 #include <stddef.h>
12 #include <stdint.h>
13 
14 #include <xnnpack/params.h>
15 #include <xnnpack/common.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 
22 #define DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(fn_name) \
23   XNN_INTERNAL void fn_name(                                     \
24       size_t m,                                                  \
25       size_t n,                                                  \
26       const float* x,                                            \
27       size_t x_stride,                                           \
28       const float* zero,                                         \
29       float* buffer,                                             \
30       float* y,                                                  \
31       const union xnn_f32_avgpool_params* params);
32 
33 DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__neon)
34 DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__sse)
35 DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__psimd)
36 DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__wasm)
37 DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__scalar)
38 
39 
40 #define DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(fn_name) \
41   XNN_INTERNAL void fn_name(                                   \
42       size_t m,                                                \
43       size_t n,                                                \
44       const float* x,                                          \
45       size_t x_stride,                                         \
46       const float* zero,                                       \
47       float* y,                                                \
48       const union xnn_f32_avgpool_params* params);
49 
50 DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__neon)
51 DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__sse)
52 DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__psimd)
53 DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__wasm)
54 DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__scalar)
55 
56 #define DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(fn_name)          \
57   XNN_INTERNAL void fn_name(                                             \
58       size_t m,                                                          \
59       size_t n,                                                          \
60       const uint8_t* x,                                                  \
61       size_t x_stride,                                                   \
62       const uint8_t* zero,                                               \
63       int32_t* buffer,                                                   \
64       uint8_t* y,                                                        \
65       const union xnn_q8_avgpool_params* params);
66 
67 DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_mp7p7q__neon)
68 DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_mp7p7q__scalar)
69 DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_mp7p7q__sse2)
70 
71 
72 #define DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(fn_name)            \
73   XNN_INTERNAL void fn_name(                                             \
74       size_t m,                                                          \
75       size_t n,                                                          \
76       const uint8_t* x,                                                  \
77       size_t x_stride,                                                   \
78       const uint8_t* zero,                                               \
79       uint8_t* y,                                                        \
80       const union xnn_q8_avgpool_params* params);
81 
82 DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_up7__neon)
83 DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_up7__scalar)
84 DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_up7__sse2)
85 
86 
87 #define DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(fn_name) \
88   XNN_INTERNAL void fn_name(                                 \
89       size_t elements,                                       \
90       size_t channels,                                       \
91       const float* input,                                    \
92       float* output,                                         \
93       const union xnn_f32_gavgpool_params* params);
94 
95 DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(xnn_f32_gavgpool_spchw_ukernel__neon_x4)
96 DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(xnn_f32_gavgpool_spchw_ukernel__sse_x4)
97 DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(xnn_f32_gavgpool_spchw_ukernel__scalar_x1)
98 
99 
100 #ifdef __cplusplus
101 }  // extern "C"
102 #endif
103