Math operators are now using consistent precision throughout the project
This commit is contained in:
@@ -25,12 +25,16 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
//#include <cmath>
|
#include <math.h> // isnan, isinf
|
||||||
// using namespace std; // Potentially bad practice to declare namespace std here
|
|
||||||
#include <math.h> // isnan, isinf // Overloads incorrect/bugged with GCC <= 6.0
|
|
||||||
//#include <tgmath.h> // Even this does not work
|
|
||||||
#include <stdlib.h> // rand
|
#include <stdlib.h> // rand
|
||||||
|
|
||||||
|
#if AC_DOUBLE_PRECISION != 1
|
||||||
|
#define exp(x) expf(x)
|
||||||
|
#define sin(x) sinf(x)
|
||||||
|
#define cos(x) cosf(x)
|
||||||
|
#define sqrt(x) sqrtf(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
static inline const T
|
static inline const T
|
||||||
max(const T& a, const T& b)
|
max(const T& a, const T& b)
|
||||||
|
@@ -68,10 +68,6 @@ typedef cuDoubleComplex acComplex;
|
|||||||
#else
|
#else
|
||||||
typedef cuFloatComplex acComplex;
|
typedef cuFloatComplex acComplex;
|
||||||
#define acComplex(x, y) make_cuFloatComplex(x, y)
|
#define acComplex(x, y) make_cuFloatComplex(x, y)
|
||||||
#define exp(x) expf(x)
|
|
||||||
#define sin(x) sinf(x)
|
|
||||||
#define cos(x) cosf(x)
|
|
||||||
#define sqrt(x) sqrtf(x)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static __device__ inline acComplex
|
static __device__ inline acComplex
|
||||||
|
Reference in New Issue
Block a user