From 6d19231a70ca67b1e27fa889280e0f256b1ee1de Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 9 May 2011 17:42:29 +0100 Subject: [PATCH] Automatic detection of the CUDA compiler? --- glm/core/setup.hpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 06c6010f..e180a5bd 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -88,6 +88,23 @@ // Force generic C++ compiler #ifdef GLM_FORCE_COMPILER_UNKNOWN # define GLM_COMPILER GLM_COMPILER_UNKNOWN + +// CUDA +#elif defined(__CUDACC__) +# if CUDA_VERSION < 3000 +# error "GLM requires CUDA 3.0 or higher" +# elif CUDA_VERSION == 3000 +# define GLM_COMPILER GLM_COMPILER_CUDA30 +# elif CUDA_VERSION == 3010 +# define GLM_COMPILER GLM_COMPILER_CUDA31 +# elif CUDA_VERSION == 3020 +# define GLM_COMPILER GLM_COMPILER_CUDA32 +# elif CUDA_VERSION == 4000 +# define GLM_COMPILER GLM_COMPILER_CUDA40 +# else +# define GLM_COMPILER GLM_COMPILER_CUDA +# endif + // Visual C++ #elif defined(_MSC_VER) # if _MSC_VER == 900 @@ -168,24 +185,6 @@ #elif defined(__MWERKS__) # define GLM_COMPILER GLM_COMPILER_CODEWARRIOR -// CUDA -/* -#elif defined(__CUDACC__) -# if CUDA_VERSION < 3000 -# error "GLM requires CUDA 3.0 or higher" -# elif CUDA_VERSION == 3000 -# define GLM_COMPILER GLM_COMPILER_CUDA30 -# elif CUDA_VERSION == 3010 -# define GLM_COMPILER GLM_COMPILER_CUDA31 -# elif CUDA_VERSION == 3020 -# define GLM_COMPILER GLM_COMPILER_CUDA32 -# elif CUDA_VERSION == 4000 -# define GLM_COMPILER GLM_COMPILER_CUDA40 -# else -# define GLM_COMPILER GLM_COMPILER_CUDA -# endif -*/ - #else # define GLM_COMPILER GLM_COMPILER_UNKNOWN #endif