summaryrefslogtreecommitdiff
path: root/src/cuda-sim/cuda-math.h
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-16 11:59:09 -0800
committerTor Aamodt <[email protected]>2010-07-16 11:59:09 -0800
commit93a64be21eb3746de0b96a2f2a365f59cd8f1bbc (patch)
tree15a83e210cebc1a90a6afc55d8ce6576689c3494 /src/cuda-sim/cuda-math.h
parent043791634414119a1708390b442ae201fe0d930c (diff)
- template runs/passes with CUDA 3.1, but requires that CUDA 2.3
is installed for math intrinsics used in instructions.cc (since CUDA 3.1 does not seem to define __uint2float). - currently cuda-math.h has hardcoded paths to my own install of CUDA 2.3 (need to determine whether we can build simulator with CUDA 2.3 and run CUDA 3.1 / compute_2x PTX, or need to make current setup more portable) - modified ptxinfo.l to print out meaningful error message if error occurs on first line - modified ptxinfo.l,y to understand "for 'compute_NN'" syntax - updated template to 3.1 SDK version - updated cuda_runtime_api.cc to select highest compute capability version when multiple versions are present. - updated template/BlackScholes Makefiles to generate a "DLL build" instead of static linked build (still confusing... requires one to copy config files... probably need to modify config scripts) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6837]
Diffstat (limited to 'src/cuda-sim/cuda-math.h')
-rw-r--r--src/cuda-sim/cuda-math.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/cuda-sim/cuda-math.h b/src/cuda-sim/cuda-math.h
index ea7f5fd..5abf4f3 100644
--- a/src/cuda-sim/cuda-math.h
+++ b/src/cuda-sim/cuda-math.h
@@ -47,7 +47,6 @@ 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;
@@ -70,27 +69,21 @@ namespace cuda_math {
typedef struct float2 float2;
extern float rsqrtf(float); // CUDA 2.3 beta
-#else
-#define UINT_MAX ((unsigned int)-1)
-#endif
+#if CUDART_VERSION < 3000
#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
+#else
+#define CUDA_FLOAT_MATH_FUNCTIONS
+#include "/home/taamodt/nvcuda/2.3/cuda/include/device_types.h"
+#define __CUDA_INTERNAL_COMPILATION__
+#include "/home/taamodt/nvcuda/2.3/cuda/include/math_functions.h"
+#undef __CUDA_INTERNAL_COMPILATION__
+#undef __attribute__
#endif
}