diff options
| author | Tor Aamodt <[email protected]> | 2010-07-15 23:11:12 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2010-07-15 23:11:12 -0800 |
| commit | 7e7e98eda7ab893ee12b307a97ab5eaf23f63af9 (patch) | |
| tree | 0331f32478d93d3437fcc222f94b180381748e5f /src/cuda-sim/cuda-math.h | |
| parent | 69f2911e04ffb1b19eef1fafb8c040af271f656e (diff) | |
compiles with CUDA 3.1 (but, nothing tested)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6832]
Diffstat (limited to 'src/cuda-sim/cuda-math.h')
| -rw-r--r-- | src/cuda-sim/cuda-math.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 <device_types.h> #define __CUDA_INTERNAL_COMPILATION__ +#if CUDART_VERSION >= 3000 +#define __CUDACC__ +#include <device_functions.h> +#else #include <math_functions.h> +#endif #undef __CUDA_INTERNAL_COMPILATION__ #undef __attribute__ + +#if CUDART_VERSION >= 3000 +#define __internal_float2int float2int +#define __internal_float2uint float2uint +#include <math.h> +#define __internal_accurate_fdividef fdividef +#endif + } #endif |
