mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
bug #970: Add EIGEN_DEVICE_FUNC to RValue functions, in case Cuda supports RValue-references.
This commit is contained in:
parent
26275b250a
commit
531fa9de77
@ -145,6 +145,7 @@ class Array
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
Array(Array&& other)
|
Array(Array&& other)
|
||||||
: Base(std::move(other))
|
: Base(std::move(other))
|
||||||
{
|
{
|
||||||
@ -152,6 +153,7 @@ class Array
|
|||||||
if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
|
if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
|
||||||
Base::_set_noalias(other);
|
Base::_set_noalias(other);
|
||||||
}
|
}
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
Array& operator=(Array&& other)
|
Array& operator=(Array&& other)
|
||||||
{
|
{
|
||||||
other.swap(*this);
|
other.swap(*this);
|
||||||
|
@ -298,6 +298,7 @@ template<typename T, int _Options> class DenseStorage<T, Dynamic, Dynamic, Dynam
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
DenseStorage(DenseStorage&& other)
|
DenseStorage(DenseStorage&& other)
|
||||||
: m_data(std::move(other.m_data))
|
: m_data(std::move(other.m_data))
|
||||||
, m_rows(std::move(other.m_rows))
|
, m_rows(std::move(other.m_rows))
|
||||||
@ -307,6 +308,7 @@ template<typename T, int _Options> class DenseStorage<T, Dynamic, Dynamic, Dynam
|
|||||||
other.m_rows = 0;
|
other.m_rows = 0;
|
||||||
other.m_cols = 0;
|
other.m_cols = 0;
|
||||||
}
|
}
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
DenseStorage& operator=(DenseStorage&& other)
|
DenseStorage& operator=(DenseStorage&& other)
|
||||||
{
|
{
|
||||||
using std::swap;
|
using std::swap;
|
||||||
@ -371,6 +373,7 @@ template<typename T, int _Rows, int _Options> class DenseStorage<T, Dynamic, _Ro
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
DenseStorage(DenseStorage&& other)
|
DenseStorage(DenseStorage&& other)
|
||||||
: m_data(std::move(other.m_data))
|
: m_data(std::move(other.m_data))
|
||||||
, m_cols(std::move(other.m_cols))
|
, m_cols(std::move(other.m_cols))
|
||||||
@ -378,6 +381,7 @@ template<typename T, int _Rows, int _Options> class DenseStorage<T, Dynamic, _Ro
|
|||||||
other.m_data = nullptr;
|
other.m_data = nullptr;
|
||||||
other.m_cols = 0;
|
other.m_cols = 0;
|
||||||
}
|
}
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
DenseStorage& operator=(DenseStorage&& other)
|
DenseStorage& operator=(DenseStorage&& other)
|
||||||
{
|
{
|
||||||
using std::swap;
|
using std::swap;
|
||||||
@ -438,6 +442,7 @@ template<typename T, int _Cols, int _Options> class DenseStorage<T, Dynamic, Dyn
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
DenseStorage(DenseStorage&& other)
|
DenseStorage(DenseStorage&& other)
|
||||||
: m_data(std::move(other.m_data))
|
: m_data(std::move(other.m_data))
|
||||||
, m_rows(std::move(other.m_rows))
|
, m_rows(std::move(other.m_rows))
|
||||||
@ -445,6 +450,7 @@ template<typename T, int _Cols, int _Options> class DenseStorage<T, Dynamic, Dyn
|
|||||||
other.m_data = nullptr;
|
other.m_data = nullptr;
|
||||||
other.m_rows = 0;
|
other.m_rows = 0;
|
||||||
}
|
}
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
DenseStorage& operator=(DenseStorage&& other)
|
DenseStorage& operator=(DenseStorage&& other)
|
||||||
{
|
{
|
||||||
using std::swap;
|
using std::swap;
|
||||||
|
@ -219,6 +219,7 @@ class Matrix
|
|||||||
{ Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
|
{ Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
|
||||||
|
|
||||||
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
Matrix(Matrix&& other)
|
Matrix(Matrix&& other)
|
||||||
: Base(std::move(other))
|
: Base(std::move(other))
|
||||||
{
|
{
|
||||||
@ -226,6 +227,7 @@ class Matrix
|
|||||||
if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
|
if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
|
||||||
Base::_set_noalias(other);
|
Base::_set_noalias(other);
|
||||||
}
|
}
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
Matrix& operator=(Matrix&& other)
|
Matrix& operator=(Matrix&& other)
|
||||||
{
|
{
|
||||||
other.swap(*this);
|
other.swap(*this);
|
||||||
|
Loading…
Reference in New Issue
Block a user