summaryrefslogtreecommitdiff
path: root/src/cuda-sim/cuda-math.h
diff options
context:
space:
mode:
authorgreen349 <[email protected]>2018-04-11 16:15:31 -0400
committerRoland Green <[email protected]>2018-04-11 18:28:52 -0400
commitf25a04e6a3db604f52d655fa98b99ad8f5343015 (patch)
treef08ab8ff85d78c9fb47b34113547c24dbbe59853 /src/cuda-sim/cuda-math.h
parent755a3cfa1b2b1711f395702d32a927dc53bee212 (diff)
Add support for isnan to compile with GCC-4.8.2
Diffstat (limited to 'src/cuda-sim/cuda-math.h')
-rw-r--r--src/cuda-sim/cuda-math.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cuda-sim/cuda-math.h b/src/cuda-sim/cuda-math.h
index 4721e8a..f88c526 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
@@ -321,7 +323,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;