mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Improve inlining
This commit is contained in:
parent
010afe1619
commit
a4c76f8d34
@ -806,7 +806,8 @@ struct Assignment<DstXprType, SrcXprType, Functor, Dense2Dense, Scalar>
|
|||||||
template< typename DstXprType, typename SrcXprType, typename Functor, typename Scalar>
|
template< typename DstXprType, typename SrcXprType, typename Functor, typename Scalar>
|
||||||
struct Assignment<DstXprType, SrcXprType, Functor, EigenBase2EigenBase, Scalar>
|
struct Assignment<DstXprType, SrcXprType, Functor, EigenBase2EigenBase, Scalar>
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar> &/*func*/)
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
|
static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar> &/*func*/)
|
||||||
{
|
{
|
||||||
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
|
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
|
||||||
src.evalTo(dst);
|
src.evalTo(dst);
|
||||||
|
@ -97,7 +97,8 @@ struct product_evaluator<Product<Lhs, Rhs, Options>, ProductTag, LhsShape, RhsSh
|
|||||||
Flags = Base::Flags | EvalBeforeNestingBit
|
Flags = Base::Flags | EvalBeforeNestingBit
|
||||||
};
|
};
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr)
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
|
explicit product_evaluator(const XprType& xpr)
|
||||||
: m_result(xpr.rows(), xpr.cols())
|
: m_result(xpr.rows(), xpr.cols())
|
||||||
{
|
{
|
||||||
::new (static_cast<Base*>(this)) Base(m_result);
|
::new (static_cast<Base*>(this)) Base(m_result);
|
||||||
@ -412,7 +413,8 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
|
|||||||
typedef typename XprType::PacketScalar PacketScalar;
|
typedef typename XprType::PacketScalar PacketScalar;
|
||||||
typedef typename XprType::PacketReturnType PacketReturnType;
|
typedef typename XprType::PacketReturnType PacketReturnType;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr)
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
|
explicit product_evaluator(const XprType& xpr)
|
||||||
: m_lhs(xpr.lhs()),
|
: m_lhs(xpr.lhs()),
|
||||||
m_rhs(xpr.rhs()),
|
m_rhs(xpr.rhs()),
|
||||||
m_lhsImpl(m_lhs), // FIXME the creation of the evaluator objects should result in a no-op, but check that!
|
m_lhsImpl(m_lhs), // FIXME the creation of the evaluator objects should result in a no-op, but check that!
|
||||||
|
@ -776,7 +776,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType, typename Functor>
|
template<int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType, typename Functor>
|
||||||
EIGEN_DEVICE_FUNC void call_triangular_assignment_loop(const DstXprType& dst, const SrcXprType& src, const Functor &func)
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
|
void call_triangular_assignment_loop(const DstXprType& dst, const SrcXprType& src, const Functor &func)
|
||||||
{
|
{
|
||||||
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
|
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
|
||||||
|
|
||||||
@ -800,7 +801,8 @@ EIGEN_DEVICE_FUNC void call_triangular_assignment_loop(const DstXprType& dst, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType>
|
template<int Mode, bool SetOpposite, typename DstXprType, typename SrcXprType>
|
||||||
EIGEN_DEVICE_FUNC void call_triangular_assignment_loop(const DstXprType& dst, const SrcXprType& src)
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
|
void call_triangular_assignment_loop(const DstXprType& dst, const SrcXprType& src)
|
||||||
{
|
{
|
||||||
call_triangular_assignment_loop<Mode,SetOpposite>(dst, src, internal::assign_op<typename DstXprType::Scalar>());
|
call_triangular_assignment_loop<Mode,SetOpposite>(dst, src, internal::assign_op<typename DstXprType::Scalar>());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user