mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-08 22:21:49 +08:00
Made the supression of unused variables portable.
EIGEN_UNUSED is not supported on non GCC systems.
This commit is contained in:
parent
2a64fa4947
commit
4c5778d29d
@ -160,7 +160,8 @@ static void run(Index rows, Index cols, Index depth,
|
|||||||
else
|
else
|
||||||
#endif // EIGEN_HAS_OPENMP
|
#endif // EIGEN_HAS_OPENMP
|
||||||
{
|
{
|
||||||
(void)info; // info is not used
|
EIGEN_UNUSED_VARIABLE(info);
|
||||||
|
|
||||||
// this is the sequential version!
|
// this is the sequential version!
|
||||||
Scalar* blockA = ei_aligned_stack_new(Scalar, kc*mc);
|
Scalar* blockA = ei_aligned_stack_new(Scalar, kc*mc);
|
||||||
std::size_t sizeB = kc*Blocking::PacketSize*Blocking::nr + kc*cols;
|
std::size_t sizeB = kc*Blocking::PacketSize*Blocking::nr + kc*cols;
|
||||||
|
@ -176,6 +176,9 @@
|
|||||||
#define EIGEN_UNUSED
|
#define EIGEN_UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Suppresses 'unused variable' warnings.
|
||||||
|
#define EIGEN_UNUSED_VARIABLE(var) (void)var;
|
||||||
|
|
||||||
#if (defined __GNUC__)
|
#if (defined __GNUC__)
|
||||||
#define EIGEN_ASM_COMMENT(X) asm("#"X)
|
#define EIGEN_ASM_COMMENT(X) asm("#"X)
|
||||||
#else
|
#else
|
||||||
|
@ -218,7 +218,7 @@ inline void ei_aligned_free(void *ptr)
|
|||||||
**/
|
**/
|
||||||
inline void* ei_aligned_realloc(void *ptr, size_t new_size, size_t old_size)
|
inline void* ei_aligned_realloc(void *ptr, size_t new_size, size_t old_size)
|
||||||
{
|
{
|
||||||
(void)old_size; // Suppress 'unused variable' warning. Seen in boost tee.
|
EIGEN_UNUSED_VARIABLE(old_size);
|
||||||
|
|
||||||
void *result;
|
void *result;
|
||||||
#if !EIGEN_ALIGN
|
#if !EIGEN_ALIGN
|
||||||
|
@ -382,9 +382,9 @@ struct ei_sparse_product_selector2<Lhs,Rhs,ResultType,RowMajor,ColMajor,ColMajor
|
|||||||
static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res)
|
static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res)
|
||||||
{
|
{
|
||||||
// prevent warnings until the code is fixed
|
// prevent warnings until the code is fixed
|
||||||
(void) lhs;
|
EIGEN_UNUSED_VARIABLE(lhs);
|
||||||
(void) rhs;
|
EIGEN_UNUSED_VARIABLE(rhs);
|
||||||
(void) res;
|
EIGEN_UNUSED_VARIABLE(res);
|
||||||
|
|
||||||
// typedef SparseMatrix<typename ResultType::Scalar,RowMajor> RowMajorMatrix;
|
// typedef SparseMatrix<typename ResultType::Scalar,RowMajor> RowMajorMatrix;
|
||||||
// RowMajorMatrix rhsRow = rhs;
|
// RowMajorMatrix rhsRow = rhs;
|
||||||
|
@ -34,9 +34,8 @@ void test_first_aligned_helper(Scalar *array, int size)
|
|||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
void test_none_aligned_helper(Scalar *array, int size)
|
void test_none_aligned_helper(Scalar *array, int size)
|
||||||
{
|
{
|
||||||
// Suppress 'unreferenced formal parameter's warnings.
|
EIGEN_UNUSED_VARIABLE(array);
|
||||||
(void)array;
|
EIGEN_UNUSED_VARIABLE(size);
|
||||||
(void)size;
|
|
||||||
VERIFY(ei_packet_traits<Scalar>::size == 1 || ei_first_aligned(array, size) == size);
|
VERIFY(ei_packet_traits<Scalar>::size == 1 || ei_first_aligned(array, size) == size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,8 +235,8 @@ void test_triangular()
|
|||||||
{
|
{
|
||||||
for(int i = 0; i < g_repeat ; i++)
|
for(int i = 0; i < g_repeat ; i++)
|
||||||
{
|
{
|
||||||
EIGEN_UNUSED int r = ei_random<int>(2,20);
|
int r = ei_random<int>(2,20); EIGEN_UNUSED_VARIABLE(r);
|
||||||
EIGEN_UNUSED int c = ei_random<int>(2,20);
|
int c = ei_random<int>(2,20); EIGEN_UNUSED_VARIABLE(c);
|
||||||
|
|
||||||
CALL_SUBTEST_1( triangular_square(Matrix<float, 1, 1>()) );
|
CALL_SUBTEST_1( triangular_square(Matrix<float, 1, 1>()) );
|
||||||
CALL_SUBTEST_2( triangular_square(Matrix<float, 2, 2>()) );
|
CALL_SUBTEST_2( triangular_square(Matrix<float, 2, 2>()) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user