summaryrefslogtreecommitdiff
path: root/src/cuda-sim/cuda-math.h
diff options
context:
space:
mode:
authorTimothy G Rogers <[email protected]>2018-11-01 17:14:09 -0400
committerGitHub Enterprise <[email protected]>2018-11-01 17:14:09 -0400
commit68fb9df6d85479cdbae25a185a81d7ec723b3ac2 (patch)
tree68f4048e0f1bf390312184fe21083a8501e0a255 /src/cuda-sim/cuda-math.h
parent1be6f76f5d57bd5dda6f0ca4dae3824f0e55eff9 (diff)
parentf06a527258b4a6634f8f148536bb86635b058d55 (diff)
Merge pull request #30 from abdallm/dev
Dev
Diffstat (limited to 'src/cuda-sim/cuda-math.h')
-rw-r--r--src/cuda-sim/cuda-math.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cuda-sim/cuda-math.h b/src/cuda-sim/cuda-math.h
index 4721e8a..afac330 100644
--- a/src/cuda-sim/cuda-math.h
+++ b/src/cuda-sim/cuda-math.h
@@ -67,6 +67,8 @@
#ifndef CUDA_MATH
#define CUDA_MATH
+#include <cmath>
+
// cuda math implementations
#undef max
#undef min
@@ -148,6 +150,7 @@ float __ll2float_rd(long long int a) {
#include <device_types.h>
#include <fenv.h>
+
// 32-bit integer to float
float __int2float_rn(int a) {
int orig_rnd_mode = fegetround();
@@ -321,7 +324,7 @@ float __internal_accurate_fdividef(float a, float b)
float __saturatef(float a)
{
float b;
- if (isnan(a)) b = 0.0f;
+ if (std::isnan(a)) b = 0.0f;
else if (a >= 1.0f) b = 1.0f;
else if (a <= 0.0f) b = 0.0f;
else b = a;