Re: [eigen] Merge the evaluator branch

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Gael,

As far as I can tell the new evaluator merge breaks the following code. It builds fine on 3.2.4.

#include "Eigen/Dense"
int main(int argc, char** argv) {
  Eigen::MatrixXd A = Eigen::MatrixXd::Zero(2,2);
  const double d[] = {1.0, 1.0};
  Eigen::Map<const Eigen::Matrix<double, Eigen::Dynamic, 1> > D(d, 2);
  A += D.array().square().matrix().asDiagonal();
  return 0;
};

but dies with the errors below. I was able to bisect it down to

changeset:   6359:e4505314c25f
parent:      6356:3ecf1d79d11a
user:        Gael Guennebaud <g.gael@xxxxxxx>
date:        Fri Aug 29 15:31:32 2014 +0200
summary:     Enable evaluators by default


In file included from ../test_eigen.cc:1:
In file included from ./Eigen/Dense:1:
In file included from ./Eigen/Core:323:
./Eigen/src/Core/AssignEvaluator.h:758:66: error: no viable conversion from 'const Eigen::internal::add_assign_op<double>' to 'const internal::assign_op<typename
      Matrix<double, -1, -1, 0, -1, -1>::Scalar>'
  Assignment<ActualDstTypeCleaned,Src,Func>::run(actualDst, src, func);
                                                                 ^~~~
./Eigen/src/Core/AssignEvaluator.h:711:3: note: in instantiation of function template specialization 'Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, -1, -1,
      0, -1, -1>, Eigen::DiagonalWrapper<const Eigen::MatrixWrapper<const Eigen::CwiseUnaryOp<Eigen::internal::scalar_square_op<double>, const
      Eigen::ArrayWrapper<Eigen::Map<const Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> > > > > >, Eigen::internal::add_assign_op<double> >' requested here
  call_assignment_no_alias(dst, src, func);
  ^
./Eigen/src/Core/EigenBase.h:139:3: note: in instantiation of function template specialization 'Eigen::internal::call_assignment<Eigen::Matrix<double, -1, -1, 0, -1, -1>,
      Eigen::DiagonalWrapper<const Eigen::MatrixWrapper<const Eigen::CwiseUnaryOp<Eigen::internal::scalar_square_op<double>, const Eigen::ArrayWrapper<Eigen::Map<const
      Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> > > > > >, Eigen::internal::add_assign_op<double> >' requested here
  call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar>());
  ^
../test_eigen.cc:6:5: note: in instantiation of function template specialization 'Eigen::DenseBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>
     >::operator+=<Eigen::DiagonalWrapper<const Eigen::MatrixWrapper<const Eigen::CwiseUnaryOp<Eigen::internal::scalar_square_op<double>, const
      Eigen::ArrayWrapper<Eigen::Map<const Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> > > > > > >' requested here
  A += D.array().square().matrix().asDiagonal();
    ^
./Eigen/src/Core/functors/AssignmentFunctors.h:23:27: note: candidate constructor not viable: no known conversion from 'const Eigen::internal::add_assign_op<double>' to
      'const Eigen::internal::assign_op<double> &' for 1st argument
  EIGEN_EMPTY_STRUCT_CTOR(assign_op)
                          ^
./Eigen/src/Core/util/XprHelper.h:20:43: note: expanded from macro 'EIGEN_EMPTY_STRUCT_CTOR'
    EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X(const X& ) {}
                                          ^
./Eigen/src/Core/DiagonalMatrix.h:363:123: note: passing argument to parameter here
  static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar> &/*func*/)



On Mon, Oct 13, 2014 at 8:32 AM, Gael Guennebaud <gael.guennebaud@xxxxxxxxx> wrote:
>
>
> Thank you for the effort.
>
> Regarding std::swap, cuda does not provide a device compatible version and we shall probably define our own to keep the code cleaner.
>
> Gael.
>
>
> On Mon, Oct 13, 2014 at 5:20 PM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> On 22.09.2014 16:32, Gael Guennebaud wrote:
>>>
>>> On Sun, Sep 21, 2014 at 6:30 PM, Christoph Hertzberg <
>>> chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>>>
>>>> Furthermore, there seems to be some problems with cuda:
>>>> http://manao..inria.fr/CDash/viewBuildError.php?buildid=14352
>>>
>>>
>>> right, I did not tested with nvcc yet.
>>
>>
>> This should work again after this commit:
>> https://bitbucket.org/eigen/eigen/commits/1f059a5ac4acc
>>
>>
>> Cheers,
>> Christoph
>>
>>
>>
>> --
>> ----------------------------------------------
>> Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
>> Cartesium 0.049
>> Universität Bremen
>> Enrique-Schmidt-Straße 5
>> 28359 Bremen
>>
>> Tel: +49 (421) 218-64252
>> ----------------------------------------------
>>
>>
>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/