From 9fdc6258cfac14b6cee30f63047d2b63c87e69d9 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 24 Feb 2014 18:13:49 +0100 Subject: [PATCH] Implement bug #317: use a template function call to suppress unused variable warnings. This also fix the issue of the previous changeset in a much nicer way. --- .../Core/products/GeneralBlockPanelKernel.h | 18 ++++++------------ Eigen/src/Core/products/GeneralMatrixVector.h | 15 ++------------- Eigen/src/Core/util/Macros.h | 7 ++++++- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 10cd34e9e..08cc14bd7 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -1128,12 +1128,10 @@ EIGEN_DONT_INLINE void gemm_pack_lhs::size }; EIGEN_ASM_COMMENT("EIGEN PRODUCT PACK LHS"); + EIGEN_UNUSED_VARIABLE(stride); + EIGEN_UNUSED_VARIABLE(offset); eigen_assert(((!PanelMode) && stride==0 && offset==0) || (PanelMode && stride>=depth && offset<=stride)); eigen_assert( (StorageOrder==RowMajor) || ((Pack1%PacketSize)==0 && Pack1<=4*PacketSize) ); -#ifdef __clang__ - // Workaround clang ABI change with unsed arguments - if(!PanelMode) depth += stride + offset; -#endif conj_if::IsComplex && Conjugate> cj; const_blas_data_mapper lhs(_lhs,lhsStride); Index count = 0; @@ -1219,11 +1217,9 @@ EIGEN_DONT_INLINE void gemm_pack_rhs=depth && offset<=stride)); -#ifdef __clang__ - // Workaround clang ABI change with unsed arguments - if(!PanelMode) depth += stride + offset; -#endif conj_if::IsComplex && Conjugate> cj; Index packet_cols = (cols/nr) * nr; Index count = 0; @@ -1274,11 +1270,9 @@ EIGEN_DONT_INLINE void gemm_pack_rhs=depth && offset<=stride)); -#ifdef __clang__ - // Workaround clang ABI change with unsed arguments - if(!PanelMode) depth += stride + offset; -#endif conj_if::IsComplex && Conjugate> cj; Index packet_cols = (cols/nr) * nr; Index count = 0; diff --git a/Eigen/src/Core/products/GeneralMatrixVector.h b/Eigen/src/Core/products/GeneralMatrixVector.h index c3e1e7142..a73ce5ff0 100644 --- a/Eigen/src/Core/products/GeneralMatrixVector.h +++ b/Eigen/src/Core/products/GeneralMatrixVector.h @@ -92,14 +92,8 @@ EIGEN_DONT_INLINE void general_matrix_vector_product void ignore_unused_variable(const T&) {} + } +} +#define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var); #if !defined(EIGEN_ASM_COMMENT) #if (defined __GNUC__) && ( defined(__i386__) || defined(__x86_64__) )