mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix sizeof unit test
This commit is contained in:
@@ -83,7 +83,7 @@ struct plain_array
|
|||||||
template <typename T, int Size, int MatrixOrArrayOptions>
|
template <typename T, int Size, int MatrixOrArrayOptions>
|
||||||
struct plain_array<T, Size, MatrixOrArrayOptions, EIGEN_ALIGN_BYTES>
|
struct plain_array<T, Size, MatrixOrArrayOptions, EIGEN_ALIGN_BYTES>
|
||||||
{
|
{
|
||||||
EIGEN_USER_ALIGN32 T array[Size];
|
EIGEN_USER_ALIGN_DEFAULT T array[Size];
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
plain_array()
|
plain_array()
|
||||||
@@ -102,7 +102,7 @@ struct plain_array<T, Size, MatrixOrArrayOptions, EIGEN_ALIGN_BYTES>
|
|||||||
template <typename T, int MatrixOrArrayOptions, int Alignment>
|
template <typename T, int MatrixOrArrayOptions, int Alignment>
|
||||||
struct plain_array<T, 0, MatrixOrArrayOptions, Alignment>
|
struct plain_array<T, 0, MatrixOrArrayOptions, Alignment>
|
||||||
{
|
{
|
||||||
EIGEN_USER_ALIGN32 T array[1];
|
EIGEN_USER_ALIGN_DEFAULT T array[1];
|
||||||
EIGEN_DEVICE_FUNC plain_array() {}
|
EIGEN_DEVICE_FUNC plain_array() {}
|
||||||
EIGEN_DEVICE_FUNC plain_array(constructor_without_unaligned_array_assert) {}
|
EIGEN_DEVICE_FUNC plain_array(constructor_without_unaligned_array_assert) {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ template<typename MatrixType> void verifySizeOf(const MatrixType&)
|
|||||||
{
|
{
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
if (MatrixType::RowsAtCompileTime!=Dynamic && MatrixType::ColsAtCompileTime!=Dynamic)
|
if (MatrixType::RowsAtCompileTime!=Dynamic && MatrixType::ColsAtCompileTime!=Dynamic)
|
||||||
VERIFY(std::ptrdiff_t(sizeof(MatrixType))==std::ptrdiff_t(sizeof(Scalar))*std::ptrdiff_t(MatrixType::SizeAtCompileTime));
|
VERIFY_IS_EQUAL(std::ptrdiff_t(sizeof(MatrixType)),std::ptrdiff_t(sizeof(Scalar))*std::ptrdiff_t(MatrixType::SizeAtCompileTime));
|
||||||
else
|
else
|
||||||
VERIFY(sizeof(MatrixType)==sizeof(Scalar*) + 2 * sizeof(typename MatrixType::Index));
|
VERIFY_IS_EQUAL(sizeof(MatrixType),sizeof(Scalar*) + 2 * sizeof(typename MatrixType::Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_sizeof()
|
void test_sizeof()
|
||||||
|
|||||||
Reference in New Issue
Block a user