aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/SparseLU/SparseLU_gemm_kernel.h14
-rw-r--r--test/sparse_basic.cpp1
-rw-r--r--test/unalignedcount.cpp2
3 files changed, 14 insertions, 3 deletions
diff --git a/Eigen/src/SparseLU/SparseLU_gemm_kernel.h b/Eigen/src/SparseLU/SparseLU_gemm_kernel.h
index 11e7318b5..293857bf8 100644
--- a/Eigen/src/SparseLU/SparseLU_gemm_kernel.h
+++ b/Eigen/src/SparseLU/SparseLU_gemm_kernel.h
@@ -93,8 +93,16 @@ void sparselu_gemm(int m, int n, int d, const Scalar* A, int lda, const Scalar*
a0 = pload<Packet>(A0);
a1 = pload<Packet>(A1);
- if(RK==4) a2 = pload<Packet>(A2);
- if(RK==4) a3 = pload<Packet>(A3);
+ if(RK==4)
+ {
+ a2 = pload<Packet>(A2);
+ a3 = pload<Packet>(A3);
+ }
+ else
+ {
+ // workaround "may be used uninitialized in this function" warning
+ a2 = a3 = a0;
+ }
#define KMADD(c, a, b, tmp) tmp = b; tmp = pmul(a,tmp); c = padd(c,tmp);
#define WORK(I) \
@@ -137,6 +145,7 @@ void sparselu_gemm(int m, int n, int d, const Scalar* A, int lda, const Scalar*
{
WORK(0);
}
+#undef WORK
// process the remaining rows without vectorization
for(int i=actual_b_end2; i<actual_b; ++i)
{
@@ -154,7 +163,6 @@ void sparselu_gemm(int m, int n, int d, const Scalar* A, int lda, const Scalar*
Bc0 += RK;
Bc1 += RK;
-#undef WORK
} // peeled loop on k
} // peeled loop on the columns j
// process the last column (we now perform a matrux-vector product)
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp
index cebb5e6a0..798716887 100644
--- a/test/sparse_basic.cpp
+++ b/test/sparse_basic.cpp
@@ -449,6 +449,7 @@ void test_sparse_basic()
{
for(int i = 0; i < g_repeat; i++) {
int s = Eigen::internal::random<int>(1,50);
+ EIGEN_UNUSED_VARIABLE(s);
CALL_SUBTEST_1(( sparse_basic(SparseMatrix<double>(8, 8)) ));
CALL_SUBTEST_2(( sparse_basic(SparseMatrix<std::complex<double>, ColMajor>(s, s)) ));
CALL_SUBTEST_2(( sparse_basic(SparseMatrix<std::complex<double>, RowMajor>(s, s)) ));
diff --git a/test/unalignedcount.cpp b/test/unalignedcount.cpp
index 5451159e6..ca7e159f3 100644
--- a/test/unalignedcount.cpp
+++ b/test/unalignedcount.cpp
@@ -40,5 +40,7 @@ void test_unalignedcount()
#else
// The following line is to eliminate "variable not used" warnings
nb_load = nb_loadu = nb_store = nb_storeu = 0;
+ int a(0), b(0);
+ VERIFY(a==b);
#endif
}