From 7e7e98eda7ab893ee12b307a97ab5eaf23f63af9 Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 23:11:12 -0800 Subject: compiles with CUDA 3.1 (but, nothing tested) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6832] --- src/cuda-sim/cuda-math.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/cuda-sim/cuda-math.h') diff --git a/src/cuda-sim/cuda-math.h b/src/cuda-sim/cuda-math.h index d495461..ea7f5fd 100644 --- a/src/cuda-sim/cuda-math.h +++ b/src/cuda-sim/cuda-math.h @@ -47,6 +47,7 @@ namespace cuda_math { #define __attribute__(a) // to remove warnings inside math_functions.h #undef INT_MAX +#if CUDART_VERSION < 3000 // DEVICE_BUILTIN struct int4 { int x, y, z, w; @@ -69,13 +70,29 @@ namespace cuda_math { typedef struct float2 float2; extern float rsqrtf(float); // CUDA 2.3 beta +#else +#define UINT_MAX ((unsigned int)-1) +#endif #define CUDA_FLOAT_MATH_FUNCTIONS #include #define __CUDA_INTERNAL_COMPILATION__ +#if CUDART_VERSION >= 3000 +#define __CUDACC__ +#include +#else #include +#endif #undef __CUDA_INTERNAL_COMPILATION__ #undef __attribute__ + +#if CUDART_VERSION >= 3000 +#define __internal_float2int float2int +#define __internal_float2uint float2uint +#include +#define __internal_accurate_fdividef fdividef +#endif + } #endif -- cgit v1.3