blob: bab892b7aadbd245e0dd927420effde83cc267f7 [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
Marat Dukhan5b69f8b2020-07-24 15:26:48 -070020typedef void (*xnn_qu8_requantization_function)(
XNNPACK Teamb455b122019-09-27 18:10:33 -070021 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
Marat Dukhan5b69f8b2020-07-24 15:26:48 -070029#define DECLARE_QU8_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, \
XNNPACK Teamb455b122019-09-27 18:10:33 -070037 uint8_t* output);
38
Marat Dukhan5b69f8b2020-07-24 15:26:48 -070039DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__scalar_unsigned32)
40DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__scalar_unsigned64)
41DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__scalar_signed64)
42DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__sse2)
43DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__ssse3)
44DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__sse4)
45DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__neon)
46DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_precise__psimd)
XNNPACK Teamb455b122019-09-27 18:10:33 -070047
Marat Dukhan5b69f8b2020-07-24 15:26:48 -070048DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_fp32__scalar_lrintf)
49DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_fp32__scalar_magic)
50DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_fp32__sse2)
51DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_fp32__neon)
52DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_fp32__psimd)
53DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_fp32__wasmsimd)
XNNPACK Teamb455b122019-09-27 18:10:33 -070054
Marat Dukhan5b69f8b2020-07-24 15:26:48 -070055DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_q31__scalar)
56DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_q31__sse2)
57DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_q31__ssse3)
58DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_q31__sse4)
59DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_q31__neon)
60DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_q31__psimd)
XNNPACK Teamb455b122019-09-27 18:10:33 -070061
Marat Dukhan5b69f8b2020-07-24 15:26:48 -070062DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_gemmlowp__scalar)
63DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_gemmlowp__sse2)
64DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_gemmlowp__ssse3)
65DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_gemmlowp__sse4)
66DECLARE_QU8_REQUANTIZATION_FUNCTION(xnn_qu8_requantize_gemmlowp__neon)
XNNPACK Teamb455b122019-09-27 18:10:33 -070067
68#ifdef __cplusplus
Marat Dukhan80fc9322019-09-29 21:06:36 -070069} // extern "C"
XNNPACK Teamb455b122019-09-27 18:10:33 -070070#endif