From d93c1c113b9540e7a66d4b2c2dc3c1e99b5d26a1 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 21 Feb 2013 19:05:23 +0100 Subject: [PATCH] NVCC: EIGEN_NO_DEBUG must be defined before including Macro.h --- Eigen/Core | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index 5d0a3e785..dd8da38b5 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -14,6 +14,18 @@ // first thing Eigen does: stop the compiler from committing suicide #include "src/Core/util/DisableStupidWarnings.h" +// Handle NVCC/CUDA +#ifdef __CUDACC__ + // Do not try to vectorize on CUDA! + #define EIGEN_DONT_VECTORIZE + // Do not try asserts on CUDA! + #define EIGEN_NO_DEBUG + // All functions callable from CUDA code must be qualified with __device__ + #define EIGEN_DEVICE_FUNC __host__ __device__ +#else + #define EIGEN_DEVICE_FUNC +#endif + // then include this file where all our macros are defined. It's really important to do it first because // it's where we do all the alignment settings (platform detection and honoring the user's will if he // defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization. @@ -49,18 +61,6 @@ #endif #endif -// Handle NVCC/CUDA -#ifdef __CUDACC__ - // Do not try to vectorize on CUDA! - #define EIGEN_DONT_VECTORIZE - // Do not try asserts on CUDA! - #define EIGEN_NO_DEBUG - // All functions callable from CUDA code must be qualified with __device__ - #define EIGEN_DEVICE_FUNC __host__ __device__ -#else - #define EIGEN_DEVICE_FUNC -#endif - #ifndef EIGEN_DONT_VECTORIZE #if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)