Line | |
---|
1 | #ifndef _VDT_STD_H_
|
---|
2 | #define _VDT_STD_H_
|
---|
3 |
|
---|
4 | #include <cmath>
|
---|
5 |
|
---|
6 | // wrapper around std function just to benefit of naming
|
---|
7 | // to be used in vectorized wrappers
|
---|
8 |
|
---|
9 | namespace vdt {
|
---|
10 |
|
---|
11 | template<typename T>
|
---|
12 | inline T fast_sqrt(T x) { return std::sqrt(x); }
|
---|
13 |
|
---|
14 | template<typename T>
|
---|
15 | inline T fast_div(T x,T y) { return x/y; }
|
---|
16 |
|
---|
17 | template<typename T>
|
---|
18 | inline T fast_fma(T x,T y, T z) { return x*y+z; }
|
---|
19 |
|
---|
20 | // correclty rounded
|
---|
21 | template<typename T>
|
---|
22 | inline T fast_fmac(T x, T y, T z) { return std::fma(x,y,z); }
|
---|
23 |
|
---|
24 | template<typename T>
|
---|
25 | inline T fast_pow(T x, T y) { return std::pow(x, y); }
|
---|
26 |
|
---|
27 | template<typename T>
|
---|
28 | inline T fast_round(T x) { return std::round(x); }
|
---|
29 | }
|
---|
30 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.