From a8fdcae55d1f002966fc9b963597a404f30baa09 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Wed, 18 Nov 2020 13:23:13 -0800 Subject: Fix sparse_extra_3, disable counting temporaries for testing DynamicSparseMatrix. Multiplication of column-major `DynamicSparseMatrix`es involves three temporaries: - two for transposing twice to sort the coefficients (`ConservativeSparseSparseProduct.h`, L160-161) - one for a final copy assignment (`SparseAssign.h`, L108) The latter is avoided in an optimization for `SparseMatrix`. Since `DynamicSparseMatrix` is deprecated in favor of `SparseMatrix`, it's not worth the effort to optimize further, so I simply disabled counting temporaries via a macro. Note that due to the inclusion of `sparse_product.cpp`, the `sparse_extra` tests actually re-run all the original `sparse_product` tests as well. We may want to simply drop the `DynamicSparseMatrix` tests altogether, which would eliminate the test duplication. Related to #2048 --- unsupported/test/sparse_extra.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'unsupported/test') diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp index b5d656fdc..cbb799acc 100644 --- a/unsupported/test/sparse_extra.cpp +++ b/unsupported/test/sparse_extra.cpp @@ -22,6 +22,9 @@ static long g_dense_op_sparse_count = 0; #endif #define EIGEN_NO_DEPRECATED_WARNING +// Disable counting of temporaries, since sparse_product(DynamicSparseMatrix) +// has an extra copy-assignment. +#define EIGEN_SPARSE_PRODUCT_IGNORE_TEMPORARY_COUNT #include "sparse_product.cpp" #if 0 // sparse_basic(DynamicSparseMatrix) does not compile at all -> disabled -- cgit v1.2.3