blob: cfeaed6f9589f5319d26cb201d1aeab09477147f [file] [log] [blame]
XNNPACK Teamb455b122019-09-27 18:10:33 -07001// 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 <stdint.h>
12#include <stddef.h>
13
14#include <xnnpack/params.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef void (*requantization_function)(
21 size_t n,
22 const int32_t* input,
23 float scale,
24 uint8_t zero_point,
25 uint8_t qmin,
26 uint8_t qmax,
27 uint8_t* output);
28
29#define DECLARE_REQUANTIZATION_FUNCTION(fn_name) \
30 void fn_name( \
31 size_t n, \
32 const int32_t* input, \
33 float scale, \
34 uint8_t zero_point, \
35 uint8_t qmin, \
36 uint8_t qmax, \
37 uint8_t* output);
38
39DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__scalar_unsigned32)
40DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__scalar_unsigned64)
41DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__scalar_signed64)
42DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__sse2)
43DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__ssse3)
44DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__sse4)
45DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__neon)
46DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_precise__psimd)
47
48DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_fp32__scalar_lrintf)
49DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_fp32__scalar_magic)
50DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_fp32__sse2)
51DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_fp32__neon)
52DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_fp32__psimd)
53
54DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_q31__scalar)
55DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_q31__sse2)
56DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_q31__ssse3)
57DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_q31__sse4)
58DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_q31__neon)
59DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_q31__psimd)
60
61DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_gemmlowp__scalar)
62DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_gemmlowp__sse2)
63DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_gemmlowp__ssse3)
64DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_gemmlowp__sse4)
65DECLARE_REQUANTIZATION_FUNCTION(xnn_requantize_gemmlowp__neon)
66
67#ifdef __cplusplus
Marat Dukhan80fc9322019-09-29 21:06:36 -070068} // extern "C"
XNNPACK Teamb455b122019-09-27 18:10:33 -070069#endif