Math operators are now using consistent precision throughout the project

This commit is contained in:
jpekkila
2020-01-27 17:04:14 +02:00
parent 2bc3f9fedd
commit e751ee991b
2 changed files with 8 additions and 8 deletions

View File

@@ -25,12 +25,16 @@
*
*/
#pragma once
//#include <cmath>
// 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 <math.h> // isnan, isinf
#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>
static inline const T
max(const T& a, const T& b)

View File

@@ -68,10 +68,6 @@ typedef cuDoubleComplex acComplex;
#else
typedef cuFloatComplex acComplex;
#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
static __device__ inline acComplex