Vector Optimized Library of Kernels 3.2.0
Architecture-tuned implementations of math kernels
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1/*
2 * Copyright 2012, 2017, 2020 Free Software Foundation, Inc.
3 *
4 * This file is part of VOLK
5 *
6 * SPDX-License-Identifier: LGPL-3.0-or-later
7 */
8
9#ifndef _MSC_VER // [
10#error "Use this header only with Microsoft Visual C++ compilers!"
11#endif // _MSC_VER ]
12
13#ifndef _MSC_CONFIG_H_ // [
14#define _MSC_CONFIG_H_
15
17// enable inline functions for C code
19#ifndef __cplusplus
20#define inline __inline
21#endif
22
24// signed size_t
26#include <stddef.h>
27typedef ptrdiff_t ssize_t;
28
30// rint functions
32#if _MSC_VER < 1800
33#include <math.h>
34static inline long lrint(double x) { return (long)(x > 0.0 ? x + 0.5 : x - 0.5); }
35static inline long lrintf(float x) { return (long)(x > 0.0f ? x + 0.5f : x - 0.5f); }
36static inline long long llrint(double x)
37{
38 return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);
39}
40static inline long long llrintf(float x)
41{
42 return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);
43}
44static inline double rint(double x) { return (x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5); }
45static inline float rintf(float x)
46{
47 return (x > 0.0f) ? floorf(x + 0.5f) : ceilf(x - 0.5f);
48}
49#endif
50
52// math constants
54#if _MSC_VER < 1800
55#include <math.h>
56#define INFINITY HUGE_VAL
57#endif
58
60// random and srandom
62#include <stdlib.h>
63static inline long int random(void) { return rand(); }
64static inline void srandom(unsigned int seed) { srand(seed); }
65
66#endif // _MSC_CONFIG_H_ ]
static float rintf(float x)
Definition config.h:45
static double rint(double x)
Definition config.h:44
static long int random(void)
Definition config.h:63
static long lrintf(float x)
Definition config.h:35
static long long llrint(double x)
Definition config.h:36
ptrdiff_t ssize_t
Definition config.h:27
static void srandom(unsigned int seed)
Definition config.h:64
static long long llrintf(float x)
Definition config.h:40
static long lrint(double x)
Definition config.h:34