mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
Set cost of constant expression to 0 (the cost should be amortized through the expression)
This commit is contained in:
parent
deb8306e60
commit
f5b1c73945
@ -26,7 +26,8 @@ struct scalar_constant_op {
|
|||||||
};
|
};
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
struct functor_traits<scalar_constant_op<Scalar> >
|
struct functor_traits<scalar_constant_op<Scalar> >
|
||||||
{ enum { Cost = 1, PacketAccess = packet_traits<Scalar>::Vectorizable, IsRepeatable = true }; };
|
{ enum { Cost = 0 /* as the constant value should be loaded in register only once for the whole expression */,
|
||||||
|
PacketAccess = packet_traits<Scalar>::Vectorizable, IsRepeatable = true }; };
|
||||||
|
|
||||||
template<typename Scalar> struct scalar_identity_op {
|
template<typename Scalar> struct scalar_identity_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_identity_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_identity_op)
|
||||||
|
Loading…
Reference in New Issue
Block a user