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

Copy-ctor for move semantic

Tags: None
(comma "," separated)
pavelh
Registered Member
Posts
9
Karma
0

Copy-ctor for move semantic

Sat Aug 10, 2013 11:21 am
Another issue with Intel C++ compiler.

It needs copy-ctor for move sematic used in DenseStorage class:

...\Eigen\src/Core/PlainObjectBase.h(439): warning #734: "Eigen::DenseStorage<T, -1, -1, -1, _Options>::DenseStorage(const Eigen::DenseStorage<T, -1, -1, -1, _Options> &) [with T=mpfr::mpreal, _Options=0]" (declared at line 312 of "...\Eigen\src/Core/DenseStorage.h"), required for copy that was eliminated, is inaccessible
: m_storage( std::move(other.m_storage) )
^
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 12:00 pm
Can you please post the full call stack. I don't yet get where the compiler is eliminating (eliding) a copy.

- Hauke
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 12:06 pm
Hi Pavel,

I think I see what happens. Could you please try to add a move constructor/assignment to mpfr::mpreal - just for testing purposes.

Thanks,
Hauke
pavelh
Registered Member
Posts
9
Karma
0

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 12:09 pm
There are few different starting points in my code:

I.
...\Eigen\src/Core/PlainObjectBase.h(439): warning #734: "Eigen::DenseStorage<T, -1,
-1, -1, _Options>::DenseStorage(const Eigen::DenseStorage<T, -1, -1, -1, _Options> &) [with T=mplab::ComplexScalar, _O
ptions=0]" (declared at line 312 of "U:\Development\trunk\libs\eigen-mp-3.2\Eigen\src/Core/DenseStorage.h"), required f
or copy that was eliminated, is inaccessible
: m_storage( std::move(other.m_storage) )
^
detected during:
instantiation of "Eigen::PlainObjectBase<Derived>::PlainObjectBase(Eigen::PlainObjectBase<Derived> &&) [w
ith Derived=Eigen::Matrix<mplab::ComplexScalar, -1, -1, 0, -1, -1>]" at line 217 of "U:\Development\trunk\libs\eigen-
mp-3.2\Eigen\src/Core/Matrix.h"
instantiation of "Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(Eigen::Matri
x<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> &&) [with _Scalar=mplab::ComplexScalar, _Rows=-1, _Cols=-1, _O
ptions=0, _MaxRows=-1, _MaxCols=-1]" at line 360 of "U:\Development\trunk\libs\eigen-mp-3.2\Eigen\src/Eigenvalues/Eig
enSolver.h"
instantiation of "Eigen::EigenSolver<_MatrixType>::EigenvectorsType Eigen::EigenSolver<_MatrixType>::eige
nvectors() const [with _MatrixType=mplab::RealMatrix]" at line 190 of "Eigenvalues.cpp"


II.
U:\Development\trunk\libs\eigen-mp-3.2\Eigen\src/Core/PlainObjectBase.h(439): warning #734: "Eigen::DenseStorage<T, -1,
-1, -1, _Options>::DenseStorage(const Eigen::DenseStorage<T, -1, -1, -1, _Options> &) [with T=mplab::RealScalar, _Opti
ons=0]" (declared at line 312 of "U:\Development\trunk\libs\eigen-mp-3.2\Eigen\src/Core/DenseStorage.h"), required for
copy that was eliminated, is inaccessible [U:\Development\trunk\mplab3\mplab\mplab.vcxproj]
: m_storage( std::move(other.m_storage) )
^
detected during:
instantiation of "Eigen::PlainObjectBase<Derived>::PlainObjectBase(Eigen::PlainObjectBase<Derived> &&) [w
ith Derived=Eigen::Matrix<mplab::RealScalar, -1, -1, 0, -1, -1>]" at line 217 of "U:\Development\trunk\libs\eigen-mp-
3.2\Eigen\src/Core/Matrix.h"
instantiation of "Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(Eigen::Matri
x<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> &&) [with _Scalar=mplab::RealScalar, _Rows=-1, _Cols=-1, _Opti
ons=0, _MaxRows=-1, _MaxCols=-1]" at line 1251 of "LinearAlgebra.cpp"
instantiation of "MatrixType mplab::trisylv(MatrixType &, MatrixType &, MatrixType &) [with MatrixType=mp
lab::RealMatrix]" at line 1268 of "LinearAlgebra.cpp"


***
mplab::RealMatrix is Eigen::Matrix <mpfr::mpreal>
mplab::ComplexMatrix is Eigen::Matrix < std::complex <mpfr::mpreal> >
Same with scalars.
pavelh
Registered Member
Posts
9
Karma
0

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 12:11 pm
Ahh, ok, will try in a minute.
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 12:24 pm
Well, we might simply add the constructor and assignment operator. It's anyways trivial and as your compiler is telling you actually not used so it will hardly hurt.
pavelh
Registered Member
Posts
9
Karma
0

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 12:29 pm
I've added move constructor / assignment to mpreal.
Same warnings. Seems it complains about DenseStorage () constructor in particular.

Then may I ask your opinion about problem related to SparseQR, I've described it in different thread:
viewtopic.php?f=74&t=112254

Would greatly appreciate your help.
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 1:01 pm
Hi,

I have quickly patched DenseStorage - the file is here: http://ideone.com/2GJ48F
I did not yet push since I had no time to test the code.

Regards,
Hauke
pavelh
Registered Member
Posts
9
Karma
0

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 1:15 pm
Warning disappeared. Now is compiling my test suite - will post the results.

Thank you very much!
pavelh
Registered Member
Posts
9
Karma
0

Re: Copy-ctor for move semantic

Sat Aug 10, 2013 1:31 pm
All tests in my application passed without any problems. Thank you for your ultra fast help & fix!
Besides now mpreal is move-enabled as a side effect :).


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]