Elffuss BraidHub

kikocis/ncnn public

e91df65e9177 · 3.0 KiBRawPermalink
1// Tencent is pleased to support the open source community by making ncnn available.
2//
3// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
4//
5// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6// in compliance with the License. You may obtain a copy of the License at
7//
8// https://opensource.org/licenses/BSD-3-Clause
9//
10// Unless required by applicable law or agreed to in writing, software distributed
11// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12// CONDITIONS OF ANY KIND, either express or implied. See the License for the
13// specific language governing permissions and limitations under the License.
14
15#ifndef NCNN_SIMPLEMATH_H
16#define NCNN_SIMPLEMATH_H
17
18#include "platform.h"
19
20#if NCNN_SIMPLEMATH
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25/*
26* ====================================================
27* discrete functions
28* ====================================================
29*/
30NCNN_EXPORT float fabs(float);
31NCNN_EXPORT float fabsf(float);
32NCNN_EXPORT float fmod(float, float);
33NCNN_EXPORT float floor(float);
34NCNN_EXPORT float floorf(float);
35NCNN_EXPORT float round(float);
36NCNN_EXPORT float roundf(float);
37NCNN_EXPORT float ceil(float);
38NCNN_EXPORT float ceilf(float);
39NCNN_EXPORT float fmaxf(float, float);
40NCNN_EXPORT float truncf(float);
41NCNN_EXPORT float frac(float);
42/*
43* ====================================================
44* trigonometric functions
45* ====================================================
46*/
47NCNN_EXPORT float sinf(float);
48NCNN_EXPORT float cosf(float);
49NCNN_EXPORT float tanf(float);
50NCNN_EXPORT float asinf(float);
51NCNN_EXPORT float acosf(float);
52NCNN_EXPORT float atanf(float);
53NCNN_EXPORT float atan2f(float, float);
54NCNN_EXPORT float tanhf(float);
55
56/*
57* ====================================================
58* power functions
59* ====================================================
60*/
61NCNN_EXPORT float sqrtf(float);
62NCNN_EXPORT float sqrt(float);
63NCNN_EXPORT float powf(float, float);
64
65/*
66* ====================================================
67* exponential and logarithm functions
68* ====================================================
69*/
70NCNN_EXPORT float expf(float);
71NCNN_EXPORT float frexp(float, int*);
72NCNN_EXPORT float logf(float);
73NCNN_EXPORT float log(float);
74NCNN_EXPORT float log10f(float);
75
76/*
77* ====================================================
78* probability functions
79* ====================================================
80*/
81NCNN_EXPORT float erf(float);
82NCNN_EXPORT float erff(float);
83NCNN_EXPORT float erfcf(float);
84
85/*
86* ====================================================
87* other functions
88* ====================================================
89*/
90NCNN_EXPORT int msb(unsigned int);
91NCNN_EXPORT float fmaf(float, float, float);
92NCNN_EXPORT float copysignf(float, float);
93NCNN_EXPORT void fesetround(int);
94NCNN_EXPORT int fegetround();
95NCNN_EXPORT float nearbyintf(float);
96
97#ifdef __cplusplus
98} // extern "C"
99#endif
100
101#endif // NCNN_SIMPLEMATH
102
103#endif // NCNN_SIMPLEMATH_H