Allow all tests to pass with EIGEN_TEST_NO_EXPLICIT_VECTORIZATION

This commit is contained in:
Antonio Sánchez
2022-04-12 14:48:22 +00:00
parent efb08e0bb5
commit 3342fc7e4d
5 changed files with 28 additions and 13 deletions

View File

@@ -510,7 +510,9 @@ EIGEN_DECLARE_TEST(evaluators)
const size_t K = 2;
const size_t N = 5;
float *destMem = new float[(M*N) + 1];
float *dest = (internal::UIntPtr(destMem)%EIGEN_MAX_ALIGN_BYTES) == 0 ? destMem+1 : destMem;
// In case of no alignment, avoid division by zero.
constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
float *dest = (internal::UIntPtr(destMem)%alignment) == 0 ? destMem+1 : destMem;
const Matrix<float, Dynamic, Dynamic, RowMajor> a = Matrix<float, Dynamic, Dynamic, RowMajor>::Random(M, K);
const Matrix<float, Dynamic, Dynamic, RowMajor> b = Matrix<float, Dynamic, Dynamic, RowMajor>::Random(K, N);