XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame^] | 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__psimd) |
| 35 | DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__scalar) |
| 36 | DECLARE_F32_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_mp7p7q__sse) |
| 37 | |
| 38 | |
| 39 | #define DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(fn_name) \ |
| 40 | XNN_INTERNAL void fn_name( \ |
| 41 | size_t m, \ |
| 42 | size_t n, \ |
| 43 | const float* x, \ |
| 44 | size_t x_stride, \ |
| 45 | const float* zero, \ |
| 46 | float* y, \ |
| 47 | const union xnn_f32_avgpool_params* params); |
| 48 | |
| 49 | DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__neon) |
| 50 | DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__psimd) |
| 51 | DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__scalar) |
| 52 | DECLARE_F32_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_f32_gavgpool_ukernel_up7__sse) |
| 53 | |
| 54 | #define DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(fn_name) \ |
| 55 | XNN_INTERNAL void fn_name( \ |
| 56 | size_t m, \ |
| 57 | size_t n, \ |
| 58 | const uint8_t* x, \ |
| 59 | size_t x_stride, \ |
| 60 | const uint8_t* zero, \ |
| 61 | int32_t* buffer, \ |
| 62 | uint8_t* y, \ |
| 63 | const union xnn_q8_avgpool_params* params); |
| 64 | |
| 65 | DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_mp7p7q__neon) |
| 66 | DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_mp7p7q__scalar) |
| 67 | DECLARE_Q8_GAVGPOOL_MULTIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_mp7p7q__sse2) |
| 68 | |
| 69 | |
| 70 | #define DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(fn_name) \ |
| 71 | XNN_INTERNAL void fn_name( \ |
| 72 | size_t m, \ |
| 73 | size_t n, \ |
| 74 | const uint8_t* x, \ |
| 75 | size_t x_stride, \ |
| 76 | const uint8_t* zero, \ |
| 77 | uint8_t* y, \ |
| 78 | const union xnn_q8_avgpool_params* params); |
| 79 | |
| 80 | DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_up7__neon) |
| 81 | DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_up7__scalar) |
| 82 | DECLARE_Q8_GAVGPOOL_UNIPASS_UKERNEL_FUNCTION(xnn_q8_gavgpool_ukernel_up7__sse2) |
| 83 | |
| 84 | |
| 85 | #define DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(fn_name) \ |
| 86 | XNN_INTERNAL void fn_name( \ |
| 87 | size_t elements, \ |
| 88 | size_t channels, \ |
| 89 | const float* input, \ |
| 90 | float* output, \ |
| 91 | const union xnn_f32_gavgpool_params* params); |
| 92 | |
| 93 | DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(xnn_f32_gavgpool_spchw_ukernel__neon_x4) |
| 94 | DECLARE_F32_GAVGPOOL_SPCHW_UKERNEL_FUNCTION(xnn_f32_gavgpool_spchw_ukernel__sse_x4) |
| 95 | |
| 96 | |
| 97 | #ifdef __cplusplus |
| 98 | } /* extern "C" */ |
| 99 | #endif |