From 72633ca8a03300577cb2c175cddd9e7e88c0704f Mon Sep 17 00:00:00 2001 From: Wilson Fung Date: Fri, 27 Jul 2012 08:56:05 -0800 Subject: Adding missing math functions for mac osx compatiblity. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13558] --- src/cuda-sim/cuda-math.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/cuda-sim') 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 -- cgit v1.3