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_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(fn_name) \ 23 XNN_INTERNAL void fn_name( \ 24 size_t output_pixels, \ 25 size_t kernel_elements, \ 26 size_t channels, \ 27 const float** input, \ 28 size_t input_offset, \ 29 const float* zero, \ 30 float* buffer, \ 31 float* output, \ 32 size_t input_increment, \ 33 size_t output_increment, \ 34 const union xnn_f32_scaleminmax_params* params); 35 36 DECLARE_F32_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9p8x__neon_c4) 37 DECLARE_F32_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9p8x__sse_c4) 38 DECLARE_F32_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9p8x__wasmsimd_arm_c4) 39 DECLARE_F32_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9p8x__wasmsimd_x86_c4) 40 DECLARE_F32_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9p8x__wasm_c1) 41 DECLARE_F32_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9p8x__scalar_c1) 42 43 44 #define DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(fn_name) \ 45 XNN_INTERNAL void fn_name( \ 46 size_t output_pixels, \ 47 size_t kernel_elements, \ 48 size_t channels, \ 49 const float** input, \ 50 size_t input_offset, \ 51 const float* zero, \ 52 float* output, \ 53 size_t input_increment, \ 54 size_t output_increment, \ 55 const union xnn_f32_scaleminmax_params* params); 56 57 DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9x__neon_c4) 58 DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9x__sse_c4) 59 DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9x__wasmsimd_arm_c4) 60 DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9x__wasmsimd_x86_c4) 61 DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9x__wasm_c1) 62 DECLARE_F32_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_f32_avgpool_minmax_ukernel_9x__scalar_c1) 63 64 65 #define DECLARE_QU8_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(fn_name) \ 66 XNN_INTERNAL void fn_name( \ 67 size_t output_pixels, \ 68 size_t kernel_elements, \ 69 size_t channels, \ 70 const uint8_t** input, \ 71 size_t input_offset, \ 72 const uint8_t* zero, \ 73 int32_t* buffer, \ 74 uint8_t* output, \ 75 size_t input_increment, \ 76 size_t output_increment, \ 77 const union xnn_qu8_avgpool_params* params); 78 79 DECLARE_QU8_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_qu8_avgpool_minmax_ukernel_9p8x__neon_c8) 80 DECLARE_QU8_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_qu8_avgpool_minmax_ukernel_9p8x__sse2_c8) 81 DECLARE_QU8_AVGPOOL_MINMAX_MULTIPASS_UKERNEL_FUNCTION(xnn_qu8_avgpool_minmax_ukernel_9p8x__scalar_c1) 82 83 84 #define DECLARE_QU8_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(fn_name) \ 85 XNN_INTERNAL void fn_name( \ 86 size_t output_pixels, \ 87 size_t kernel_elements, \ 88 size_t channels, \ 89 const uint8_t** input, \ 90 size_t input_offset, \ 91 const uint8_t* zero, \ 92 uint8_t* output, \ 93 size_t input_increment, \ 94 size_t output_increment, \ 95 const union xnn_qu8_avgpool_params* params); 96 97 DECLARE_QU8_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_qu8_avgpool_minmax_ukernel_9x__neon_c8) 98 DECLARE_QU8_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_qu8_avgpool_minmax_ukernel_9x__sse2_c8) 99 DECLARE_QU8_AVGPOOL_MINMAX_UNIPASS_UKERNEL_FUNCTION(xnn_qu8_avgpool_minmax_ukernel_9x__scalar_c1) 100 101 102 #ifdef __cplusplus 103 } // extern "C" 104 #endif 105