0
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2026-01-18 17:31:19 +01:00

fix errors in windows builds and tests

This commit is contained in:
Charles Schlosser
2025-10-07 22:47:35 +00:00
parent eea6587b0e
commit 13bd14974d
5 changed files with 17 additions and 35 deletions

View File

@@ -65,7 +65,8 @@ struct plain_array {
template <typename T, int Size, int MatrixOrArrayOptions>
struct plain_array<T, Size, MatrixOrArrayOptions, 0> {
T array[Size];
// on some 32-bit platforms, stack-allocated arrays are aligned to 4 bytes, not the preferred alignment of T
EIGEN_ALIGN_TO_BOUNDARY(alignof(T)) T array[Size];
#if defined(EIGEN_NO_DEBUG) || defined(EIGEN_TESTING_PLAINOBJECT_CTOR)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() = default;
#else
@@ -73,12 +74,6 @@ struct plain_array<T, Size, MatrixOrArrayOptions, 0> {
#endif
};
template <typename T, int MatrixOrArrayOptions, int Alignment>
struct plain_array<T, 0, MatrixOrArrayOptions, Alignment> {
T array[1];
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() = default;
};
template <typename T, int Size, int Options, int Alignment>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap_plain_array(plain_array<T, Size, Options, Alignment>& a,
plain_array<T, Size, Options, Alignment>& b,

View File

@@ -31,23 +31,20 @@
build:windows:x86:msvc-14.29:default:
extends: .build:windows
variables:
EIGEN_CI_MSVC_VER: "14.29"
EIGEN_CI_MSVC_ARCH: "x86"
EIGEN_CI_MSVC_ARCH: "x64_x86"
# MSVC 14.29 (VS 2019) 64 bit
build:windows:x86-64:msvc-14.29:default:
extends: .build:windows
variables:
EIGEN_CI_MSVC_VER: "14.29"
build:windows:x86-64:msvc-14.29:avx2:
extends: build:windows:x86-64:msvc-14.29:default
extends: .build:windows
variables:
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX2=on"
build:windows:x86-64:msvc-14.29:avx512dq:
extends: build:windows:x86-64:msvc-14.29:default
extends: .build:windows
variables:
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX512DQ=on"
@@ -73,5 +70,4 @@ build:windows:x86-64:msvc-14.29:avx512dq:
build:windows:x86-64:cuda-11.4:msvc-14.29:
extends: .build:windows:cuda
variables:
EIGEN_CI_MSVC_VER: "14.29"
EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V11_4

View File

@@ -19,35 +19,29 @@
# MSVC 14.29 (VS 2019) 64 bit
.test:windows:x86-64:msvc-14.29:default:
test:windows:x86-64:msvc-14.29:default:official:
extends: .test:windows
needs: [ build:windows:x86-64:msvc-14.29:default ]
test:windows:x86-64:msvc-14.29:default:official:
extends: .test:windows:x86-64:msvc-14.29:default
variables:
EIGEN_CI_CTEST_LABEL: Official
test:windows:x86-64:msvc-14.29:default:unsupported:
extends: .test:windows:x86-64:msvc-14.29:default
extends: test:windows:x86-64:msvc-14.29:default:official
variables:
EIGEN_CI_CTEST_LABEL: Unsupported
.test:windows:x86-64:msvc-14.29:avx2:
test:windows:x86-64:msvc-14.29:avx2:official:
extends: .test:windows
needs: [ build:windows:x86-64:msvc-14.29:avx2 ]
test:windows:x86-64:msvc-14.29:avx2:official:
extends: .test:windows:x86-64:msvc-14.29:avx2
variables:
EIGEN_CI_CTEST_LABEL: Official
test:windows:x86-64:msvc-14.29:avx2:unsupported:
extends: .test:windows:x86-64:msvc-14.29:avx2
extends: test:windows:x86-64:msvc-14.29:avx2:official
variables:
EIGEN_CI_CTEST_LABEL: Unsupported
.test:windows:x86-64:msvc-14.29:avx512dq:
test:windows:x86-64:msvc-14.29:avx512dq:official:
extends: .test:windows
needs: [ build:windows:x86-64:msvc-14.29:avx512dq ]
tags:
@@ -55,14 +49,11 @@ test:windows:x86-64:msvc-14.29:avx2:unsupported:
- windows
- x86-64
- avx512
test:windows:x86-64:msvc-14.29:avx512dq:official:
extends: .test:windows:x86-64:msvc-14.29:avx512dq
variables:
EIGEN_CI_CTEST_LABEL: Official
test:windows:x86-64:msvc-14.29:avx512dq:unsupported:
extends: .test:windows:x86-64:msvc-14.29:avx512dq
extends: test:windows:x86-64:msvc-14.29:avx512dq:official
variables:
EIGEN_CI_CTEST_LABEL: Unsupported

View File

@@ -126,12 +126,12 @@ void homogeneous(void) {
}
{
const Eigen::PermutationMatrix<Size> P{Eigen::Vector<int, Size>::EqualSpaced(0, 1)};
const auto right = Eigen::Vector<Scalar, Size - 1>::Random().eval().homogeneous();
const auto left = Eigen::RowVector<Scalar, Size - 1>::Random().eval().homogeneous();
PermutationMatrix<Size> P{Vector<int, Size>::EqualSpaced(0, 1).reverse()};
auto right = Vector<Scalar, Size - 1>::Random().eval().nestByValue().homogeneous();
auto left = RowVector<Scalar, Size - 1>::Random().eval().nestByValue().homogeneous();
VERIFY_IS_APPROX(P * right, P * right.eval());
VERIFY_IS_APPROX(left * P, left.eval() * P);
VERIFY_IS_APPROX(P * right, right.reverse());
VERIFY_IS_APPROX(left * P, left.reverse());
}
}

View File

@@ -352,7 +352,7 @@ void test_cref_move_ctor(const DenseBase<Derived> &expr) {
const double *data1 = cref1.data(), *obj_data1 = static_cast<CRefDerived &>(cref1).m_object.data();
VERIFY(test_is_equal(data1, obj_data1, owns_data));
CRef cref2(std::move(cref1));
VERIFY_IS_EQUAL(data1, cref1.data());
VERIFY_IS_EQUAL(std::uintptr_t(data1), std::uintptr_t(cref1.data()));
const double *data2 = cref2.data(), *obj_data2 = static_cast<CRefDerived &>(cref2).m_object.data();
VERIFY(test_is_equal(data1, data2, MatrixType::MaxSizeAtCompileTime == Dynamic || !owns_data));
VERIFY(test_is_equal(data1, obj_data2, MatrixType::MaxSizeAtCompileTime == Dynamic && owns_data));