From e5f134006b431d7d307c8ce7706c5aa1df09895c Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Thu, 30 Oct 2014 19:59:09 +0100 Subject: [PATCH] EIGEN_UNUSED_VARIABLE works better than casting to void. Make this also usable from CUDA code --- Eigen/src/Core/util/Macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index c09854951..61d7be752 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -251,7 +251,7 @@ #endif #ifdef EIGEN_NO_DEBUG -#define EIGEN_ONLY_USED_FOR_DEBUG(x) (void)x +#define EIGEN_ONLY_USED_FOR_DEBUG(x) EIGEN_UNUSED_VARIABLE(x) #else #define EIGEN_ONLY_USED_FOR_DEBUG(x) #endif @@ -277,7 +277,7 @@ // Suppresses 'unused variable' warnings. namespace Eigen { namespace internal { - template void ignore_unused_variable(const T&) {} + template EIGEN_DEVICE_FUNC void ignore_unused_variable(const T&) {} } } #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var);