summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-07-27 08:56:05 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:48:53 -0700
commit72633ca8a03300577cb2c175cddd9e7e88c0704f (patch)
treeacc73cb85d9d55f5ccdb5c23093e0b3e9a0554b6
parentf73d71935122aaef2e32e8c34f1004864d05c934 (diff)
Adding missing math functions for mac osx compatiblity.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13558]
-rw-r--r--src/cuda-sim/cuda-math.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cuda-sim/cuda-math.h b/src/cuda-sim/cuda-math.h
index e9f2895..b4502a1 100644
--- a/src/cuda-sim/cuda-math.h
+++ b/src/cuda-sim/cuda-math.h
@@ -334,6 +334,20 @@ float __powf(float a, float b)
return powf(a, b);
}
+// math functions missing in Mac OSX GCC
+#ifdef __APPLE__
+int isnanf(float a)
+{
+ return (isnan(a));
+}
+
+int __signbitd(double d)
+{
+ unsigned long long int u = *((unsigned long long int*)&d);
+ return ((u & 0x8000000000000000ULL) != 0);
+}
+#endif
+
#undef __CUDACC__
#define __CUDA_INTERNAL_COMPILATION__
#include <math_functions.h>