From 13bd14974de5358d666254f2fd1306c9f539216b Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Tue, 7 Oct 2025 22:47:35 +0000 Subject: [PATCH] fix errors in windows builds and tests --- Eigen/src/Core/DenseStorage.h | 9 ++------- ci/build.windows.gitlab-ci.yml | 10 +++------- ci/test.windows.gitlab-ci.yml | 21 ++++++--------------- test/geo_homogeneous.cpp | 10 +++++----- test/ref.cpp | 2 +- 5 files changed, 17 insertions(+), 35 deletions(-) diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index d62586c99..45c8779ac 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -65,7 +65,8 @@ struct plain_array { template struct plain_array { - 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 { #endif }; -template -struct plain_array { - T array[1]; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() = default; -}; - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap_plain_array(plain_array& a, plain_array& b, diff --git a/ci/build.windows.gitlab-ci.yml b/ci/build.windows.gitlab-ci.yml index 87be69495..7cd4567e8 100644 --- a/ci/build.windows.gitlab-ci.yml +++ b/ci/build.windows.gitlab-ci.yml @@ -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 \ No newline at end of file diff --git a/ci/test.windows.gitlab-ci.yml b/ci/test.windows.gitlab-ci.yml index 17bb065de..3c398a4ec 100644 --- a/ci/test.windows.gitlab-ci.yml +++ b/ci/test.windows.gitlab-ci.yml @@ -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 diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp index 1b515d73c..c5ee7361e 100644 --- a/test/geo_homogeneous.cpp +++ b/test/geo_homogeneous.cpp @@ -126,12 +126,12 @@ void homogeneous(void) { } { - const Eigen::PermutationMatrix P{Eigen::Vector::EqualSpaced(0, 1)}; - const auto right = Eigen::Vector::Random().eval().homogeneous(); - const auto left = Eigen::RowVector::Random().eval().homogeneous(); + PermutationMatrix P{Vector::EqualSpaced(0, 1).reverse()}; + auto right = Vector::Random().eval().nestByValue().homogeneous(); + auto left = RowVector::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()); } } diff --git a/test/ref.cpp b/test/ref.cpp index deb238f61..8b19355a7 100644 --- a/test/ref.cpp +++ b/test/ref.cpp @@ -352,7 +352,7 @@ void test_cref_move_ctor(const DenseBase &expr) { const double *data1 = cref1.data(), *obj_data1 = static_cast(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(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));