mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix errors in windows builds and tests
This commit is contained in:
@@ -65,7 +65,8 @@ struct plain_array {
|
|||||||
|
|
||||||
template <typename T, int Size, int MatrixOrArrayOptions>
|
template <typename T, int Size, int MatrixOrArrayOptions>
|
||||||
struct plain_array<T, Size, MatrixOrArrayOptions, 0> {
|
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)
|
#if defined(EIGEN_NO_DEBUG) || defined(EIGEN_TESTING_PLAINOBJECT_CTOR)
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() = default;
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() = default;
|
||||||
#else
|
#else
|
||||||
@@ -73,12 +74,6 @@ struct plain_array<T, Size, MatrixOrArrayOptions, 0> {
|
|||||||
#endif
|
#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>
|
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,
|
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,
|
plain_array<T, Size, Options, Alignment>& b,
|
||||||
|
|||||||
@@ -31,23 +31,20 @@
|
|||||||
build:windows:x86:msvc-14.29:default:
|
build:windows:x86:msvc-14.29:default:
|
||||||
extends: .build:windows
|
extends: .build:windows
|
||||||
variables:
|
variables:
|
||||||
EIGEN_CI_MSVC_VER: "14.29"
|
EIGEN_CI_MSVC_ARCH: "x64_x86"
|
||||||
EIGEN_CI_MSVC_ARCH: "x86"
|
|
||||||
|
|
||||||
# MSVC 14.29 (VS 2019) 64 bit
|
# MSVC 14.29 (VS 2019) 64 bit
|
||||||
|
|
||||||
build:windows:x86-64:msvc-14.29:default:
|
build:windows:x86-64:msvc-14.29:default:
|
||||||
extends: .build:windows
|
extends: .build:windows
|
||||||
variables:
|
|
||||||
EIGEN_CI_MSVC_VER: "14.29"
|
|
||||||
|
|
||||||
build:windows:x86-64:msvc-14.29:avx2:
|
build:windows:x86-64:msvc-14.29:avx2:
|
||||||
extends: build:windows:x86-64:msvc-14.29:default
|
extends: .build:windows
|
||||||
variables:
|
variables:
|
||||||
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX2=on"
|
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX2=on"
|
||||||
|
|
||||||
build:windows:x86-64:msvc-14.29:avx512dq:
|
build:windows:x86-64:msvc-14.29:avx512dq:
|
||||||
extends: build:windows:x86-64:msvc-14.29:default
|
extends: .build:windows
|
||||||
variables:
|
variables:
|
||||||
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX512DQ=on"
|
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:
|
build:windows:x86-64:cuda-11.4:msvc-14.29:
|
||||||
extends: .build:windows:cuda
|
extends: .build:windows:cuda
|
||||||
variables:
|
variables:
|
||||||
EIGEN_CI_MSVC_VER: "14.29"
|
|
||||||
EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V11_4
|
EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V11_4
|
||||||
@@ -19,35 +19,29 @@
|
|||||||
|
|
||||||
# MSVC 14.29 (VS 2019) 64 bit
|
# 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
|
extends: .test:windows
|
||||||
needs: [ build:windows:x86-64:msvc-14.29:default ]
|
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:
|
variables:
|
||||||
EIGEN_CI_CTEST_LABEL: Official
|
EIGEN_CI_CTEST_LABEL: Official
|
||||||
|
|
||||||
test:windows:x86-64:msvc-14.29:default:unsupported:
|
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:
|
variables:
|
||||||
EIGEN_CI_CTEST_LABEL: Unsupported
|
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
|
extends: .test:windows
|
||||||
needs: [ build:windows:x86-64:msvc-14.29:avx2 ]
|
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:
|
variables:
|
||||||
EIGEN_CI_CTEST_LABEL: Official
|
EIGEN_CI_CTEST_LABEL: Official
|
||||||
|
|
||||||
test:windows:x86-64:msvc-14.29:avx2:unsupported:
|
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:
|
variables:
|
||||||
EIGEN_CI_CTEST_LABEL: Unsupported
|
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
|
extends: .test:windows
|
||||||
needs: [ build:windows:x86-64:msvc-14.29:avx512dq ]
|
needs: [ build:windows:x86-64:msvc-14.29:avx512dq ]
|
||||||
tags:
|
tags:
|
||||||
@@ -55,14 +49,11 @@ test:windows:x86-64:msvc-14.29:avx2:unsupported:
|
|||||||
- windows
|
- windows
|
||||||
- x86-64
|
- x86-64
|
||||||
- avx512
|
- avx512
|
||||||
|
|
||||||
test:windows:x86-64:msvc-14.29:avx512dq:official:
|
|
||||||
extends: .test:windows:x86-64:msvc-14.29:avx512dq
|
|
||||||
variables:
|
variables:
|
||||||
EIGEN_CI_CTEST_LABEL: Official
|
EIGEN_CI_CTEST_LABEL: Official
|
||||||
|
|
||||||
test:windows:x86-64:msvc-14.29:avx512dq:unsupported:
|
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:
|
variables:
|
||||||
EIGEN_CI_CTEST_LABEL: Unsupported
|
EIGEN_CI_CTEST_LABEL: Unsupported
|
||||||
|
|
||||||
|
|||||||
@@ -126,12 +126,12 @@ void homogeneous(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const Eigen::PermutationMatrix<Size> P{Eigen::Vector<int, Size>::EqualSpaced(0, 1)};
|
PermutationMatrix<Size> P{Vector<int, Size>::EqualSpaced(0, 1).reverse()};
|
||||||
const auto right = Eigen::Vector<Scalar, Size - 1>::Random().eval().homogeneous();
|
auto right = Vector<Scalar, Size - 1>::Random().eval().nestByValue().homogeneous();
|
||||||
const auto left = Eigen::RowVector<Scalar, Size - 1>::Random().eval().homogeneous();
|
auto left = RowVector<Scalar, Size - 1>::Random().eval().nestByValue().homogeneous();
|
||||||
|
|
||||||
VERIFY_IS_APPROX(P * right, P * right.eval());
|
VERIFY_IS_APPROX(P * right, right.reverse());
|
||||||
VERIFY_IS_APPROX(left * P, left.eval() * P);
|
VERIFY_IS_APPROX(left * P, left.reverse());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
const double *data1 = cref1.data(), *obj_data1 = static_cast<CRefDerived &>(cref1).m_object.data();
|
||||||
VERIFY(test_is_equal(data1, obj_data1, owns_data));
|
VERIFY(test_is_equal(data1, obj_data1, owns_data));
|
||||||
CRef cref2(std::move(cref1));
|
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();
|
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, data2, MatrixType::MaxSizeAtCompileTime == Dynamic || !owns_data));
|
||||||
VERIFY(test_is_equal(data1, obj_data2, MatrixType::MaxSizeAtCompileTime == Dynamic && owns_data));
|
VERIFY(test_is_equal(data1, obj_data2, MatrixType::MaxSizeAtCompileTime == Dynamic && owns_data));
|
||||||
|
|||||||
Reference in New Issue
Block a user