mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add exp2() as a packet op and array method.
This commit is contained in:
@@ -376,6 +376,22 @@ struct functor_traits<scalar_exp_op<Scalar>> {
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_exp2_op {
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& a) const { return internal::pexp2(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pexp2(a);
|
||||
}
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_exp2_op<Scalar>> {
|
||||
enum {
|
||||
PacketAccess = packet_traits<Scalar>::HasExp,
|
||||
Cost = functor_traits<scalar_exp_op<Scalar>>::Cost // TODO measure cost of exp2
|
||||
};
|
||||
};
|
||||
|
||||
/** \internal
|
||||
*
|
||||
* \brief Template functor to compute the exponential of a scalar - 1.
|
||||
|
||||
Reference in New Issue
Block a user