This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Alignment error C2719 with AutoDiffScalar on MSVC 14

Tags: None
(comma "," separated)
alejandrocastro
Registered Member
Posts
15
Karma
0
OS
The very simple code below performs the operation a = constant * b (line 20 of that code) where constant is a double and a and b are a Matrix<AutoDiffScalar<Vector2d>, 3, 1>. You can copy/paste this code if willing to test and it'd be self-contained.

Edited to make this code self-contained.

Code: Select all
#include <Eigen/Dense>
#include <unsupported/Eigen/AutoDiff>

using Eigen::AutoDiffScalar;
using Eigen::Vector2d;

/// A column vector of size 3, templated on scalar type.
template <typename Scalar>
using Vector3 = Eigen::Matrix<Scalar, 3, 1>;

int main() {
  typedef AutoDiffScalar<Vector2d> T;

  Vector3<T> input_vector(1.0, 3.14, 2.18);

  Vector3<T> expected;

  const double kGain = 2.0;
  expected =  kGain * input_vector;  // LINE 20: THIS IS THE LINE THAT TRIGGERS THE ERROR.

  return 0;
}


With MSVC 14 on Windows 32 bit I get the error: error C2719: 'unnamed-parameter': formal parameter with requested alignment of 16 won't be aligned.
Full error below:

Code: Select all
c:\users\administrator\workspace\experimental\0b4ef046\build\install\include\eigen3\eigen\src/Core/util/Meta.h(273): error C2719: 'unnamed-parameter': formal parameter with requested alignment of 16 won't be aligned

c:\users\administrator\workspace\experimental\0b4ef046\build\install\include\eigen3\eigen\src/Core/CwiseUnaryOp.h(43): note: see reference to class template instantiation 'Eigen::internal::result_of<UnaryOp (Eigen::AutoDiffScalar<Eigen::Vector2d>)>' being compiled

        with

        [

            UnaryOp=Eigen::internal::scalar_multiple_op<Eigen::AutoDiffScalar<Eigen::Vector2d>>

        ]

c:\users\administrator\workspace\experimental\0b4ef046\build\install\include\eigen3\eigen\src/Core/CwiseUnaryOp.h(95): note: see reference to class template instantiation 'Eigen::internal::traits<Derived>' being compiled

        with

        [

            Derived=Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<Eigen::AutoDiffScalar<Eigen::Vector2d>>,const Eigen::Matrix<T,3,1,0,3,1>>

        ]

c:\users\administrator\workspace\experimental\0b4ef046\build\install\include\eigen3\eigen\src/Core/CwiseUnaryOp.h(56): note: see reference to class template instantiation 'Eigen::CwiseUnaryOpImpl<UnaryOp,XprType,Eigen::internal::traits<Derived>::StorageKind>' being compiled

        with

        [

            UnaryOp=Eigen::internal::scalar_multiple_op<Eigen::AutoDiffScalar<Eigen::Vector2d>>,

            XprType=Eigen::Matrix<T,3,1,0,3,1>,

            Derived=Eigen::Matrix<T,3,1,0,3,1>

        ]

..\systems\framework\primitives\test\dummy_test.cc(20): note: see reference to class template instantiation 'Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<Eigen::AutoDiffScalar<Eigen::Vector2d>>,const Derived>' being compiled

        with

        [

            Derived=Eigen::Matrix<T,3,1,0,3,1>

        ]


Any help would be greatly appreciated. Thank you in advance.
alejandrocastro
Registered Member
Posts
15
Karma
0
OS
You can see the results of our CI here https://drake-jenkins.csail.mit.edu/job ... ntal/3657/

The only one build failing is on Windows 32.
alejandrocastro
Registered Member
Posts
15
Karma
0
OS
I just filed a bug here: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1279

Hopefully it gets fixed and helps others!


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]