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 | |
Frank Barchard | b196659 | 2020-05-12 13:47:06 -0700 | [diff] [blame] | 22 | #define DECLARE_F16_CLAMP_UKERNEL_FUNCTION(fn_name) \ |
| 23 | XNN_INTERNAL void fn_name( \ |
| 24 | size_t n, \ |
| 25 | const void* x, \ |
| 26 | void* y, \ |
| 27 | const struct xnn_f16_minmax_params* params); |
| 28 | |
| 29 | DECLARE_F16_CLAMP_UKERNEL_FUNCTION(xnn_f16_clamp_ukernel__neonfp16arith_x8) |
| 30 | DECLARE_F16_CLAMP_UKERNEL_FUNCTION(xnn_f16_clamp_ukernel__neonfp16arith_x16) |
| 31 | |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 32 | #define DECLARE_F32_CLAMP_UKERNEL_FUNCTION(fn_name) \ |
| 33 | XNN_INTERNAL void fn_name( \ |
| 34 | size_t n, \ |
| 35 | const float* x, \ |
| 36 | float* y, \ |
Marat Dukhan | eb09a6b | 2020-04-08 17:34:32 -0700 | [diff] [blame] | 37 | const union xnn_f32_minmax_params* params); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 38 | |
Marat Dukhan | 5c5fa96 | 2020-03-10 18:38:33 -0700 | [diff] [blame] | 39 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__neon_x4) |
| 40 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__neon_x8) |
| 41 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__sse_x4) |
| 42 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__sse_x8) |
| 43 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__avx_x8) |
| 44 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__avx_x16) |
| 45 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__avx512f_x16) |
| 46 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__avx512f_x32) |
Marat Dukhan | 3fa52c8 | 2020-07-08 12:54:33 -0700 | [diff] [blame] | 47 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasmsimd_arm_x4) |
| 48 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasmsimd_arm_x8) |
| 49 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasmsimd_x86_x4) |
| 50 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasmsimd_x86_x8) |
Marat Dukhan | 5c5fa96 | 2020-03-10 18:38:33 -0700 | [diff] [blame] | 51 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasm_x1) |
| 52 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasm_x2) |
| 53 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__wasm_x4) |
| 54 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__scalar_x1) |
| 55 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__scalar_x2) |
| 56 | DECLARE_F32_CLAMP_UKERNEL_FUNCTION(xnn_f32_clamp_ukernel__scalar_x4) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 57 | |
| 58 | |
| 59 | #define DECLARE_U8_CLAMP_UKERNEL_FUNCTION(fn_name) \ |
| 60 | XNN_INTERNAL void fn_name( \ |
| 61 | size_t n, \ |
| 62 | const uint8_t* x, \ |
| 63 | uint8_t* y, \ |
Marat Dukhan | eb09a6b | 2020-04-08 17:34:32 -0700 | [diff] [blame] | 64 | const union xnn_u8_minmax_params* params); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 65 | |
Marat Dukhan | 5c5fa96 | 2020-03-10 18:38:33 -0700 | [diff] [blame] | 66 | DECLARE_U8_CLAMP_UKERNEL_FUNCTION(xnn_u8_clamp_ukernel__neon_x64) |
| 67 | DECLARE_U8_CLAMP_UKERNEL_FUNCTION(xnn_u8_clamp_ukernel__sse2_x64) |
| 68 | DECLARE_U8_CLAMP_UKERNEL_FUNCTION(xnn_u8_clamp_ukernel__scalar_x4) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 69 | |
| 70 | |
| 71 | #ifdef __cplusplus |
Marat Dukhan | 80fc932 | 2019-09-29 21:06:36 -0700 | [diff] [blame] | 72 | } // extern "C" |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 73 | #endif |