11 #ifndef EIGEN_GENERIC_PACKET_MATH_H 12 #define EIGEN_GENERIC_PACKET_MATH_H 26 #ifndef EIGEN_DEBUG_ALIGNED_LOAD 27 #define EIGEN_DEBUG_ALIGNED_LOAD 30 #ifndef EIGEN_DEBUG_UNALIGNED_LOAD 31 #define EIGEN_DEBUG_UNALIGNED_LOAD 34 #ifndef EIGEN_DEBUG_ALIGNED_STORE 35 #define EIGEN_DEBUG_ALIGNED_STORE 38 #ifndef EIGEN_DEBUG_UNALIGNED_STORE 39 #define EIGEN_DEBUG_UNALIGNED_STORE 132 template <
typename SrcPacket,
typename TgtPacket>
133 EIGEN_DEVICE_FUNC
inline TgtPacket
135 return static_cast<TgtPacket
>(a);
137 template <
typename SrcPacket,
typename TgtPacket>
138 EIGEN_DEVICE_FUNC
inline TgtPacket
139 pcast(
const SrcPacket& a,
const SrcPacket& ) {
140 return static_cast<TgtPacket
>(a);
143 template <
typename SrcPacket,
typename TgtPacket>
144 EIGEN_DEVICE_FUNC
inline TgtPacket
145 pcast(
const SrcPacket& a,
const SrcPacket& ,
const SrcPacket& ,
const SrcPacket& ) {
146 return static_cast<TgtPacket
>(a);
150 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 155 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 160 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 165 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 169 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 174 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 179 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 181 const Packet&
b) {
return numext::mini(a, b); }
184 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 186 const Packet&
b) {
return numext::maxi(a, b); }
189 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 193 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 197 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 201 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 205 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 209 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 213 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 217 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 221 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 225 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 242 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 244 {
return pload1<Packet>(from); }
255 template<
typename Packet> EIGEN_DEVICE_FUNC
259 a0 = pload1<Packet>(a+0);
260 a1 = pload1<Packet>(a+1);
261 a2 = pload1<Packet>(a+2);
262 a3 = pload1<Packet>(a+3);
272 template<
typename Packet> EIGEN_DEVICE_FUNC
276 a0 = pload1<Packet>(a+0);
277 a1 = pload1<Packet>(a+1);
285 template<
typename Scalar,
typename Packet> EIGEN_DEVICE_FUNC
inline void pstore(Scalar* to,
const Packet& from)
289 template<
typename Scalar,
typename Packet> EIGEN_DEVICE_FUNC
inline void pstoreu(Scalar* to,
const Packet& from)
292 template<
typename Scalar,
typename Packet> EIGEN_DEVICE_FUNC
inline Packet pgather(
const Scalar* from,
Index )
293 {
return ploadu<Packet>(from); }
295 template<
typename Scalar,
typename Packet> EIGEN_DEVICE_FUNC
inline void pscatter(Scalar* to,
const Packet& from,
Index )
299 template<
typename Scalar> EIGEN_DEVICE_FUNC
inline void prefetch(
const Scalar* addr)
302 #if defined(__LP64__) 304 asm(
" prefetch.L1 [ %1 ];" :
"=l"(addr) :
"l"(addr));
307 asm(
" prefetch.L1 [ %1 ];" :
"=r"(addr) :
"r"(addr));
309 #elif (!EIGEN_COMP_MSVC) && (EIGEN_COMP_GNUC || EIGEN_COMP_CLANG || EIGEN_COMP_ICC) 310 __builtin_prefetch(addr);
319 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 330 template<
typename Packet> EIGEN_DEVICE_FUNC
inline 444 template<
typename Packet>
447 pstore(to, pset1<Packet>(a));
451 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 459 template<
typename Packet,
int Alignment>
463 return pload<Packet>(from);
465 return ploadu<Packet>(from);
470 template<
typename Scalar,
typename Packet,
int Alignment>
484 template<
typename Packet,
int LoadMode>
487 return ploadt<Packet, LoadMode>(from);
491 template<
int Offset,
typename PacketType>
513 template<
int Offset,
typename PacketType>
526 template<>
inline std::complex<float>
pmul(
const std::complex<float>& a,
const std::complex<float>&
b)
529 template<>
inline std::complex<double>
pmul(
const std::complex<double>& a,
const std::complex<double>&
b)
543 template<
typename Packet> EIGEN_DEVICE_FUNC
inline void 556 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 558 return ifPacket.select[0] ? thenPacket : elsePacket;
562 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 572 return pblend(mask, pset1<Packet>(b), a);
576 template<
typename Packet> EIGEN_DEVICE_FUNC
inline Packet 586 return pblend(mask, pset1<Packet>(b), a);
593 #endif // EIGEN_GENERIC_PACKET_MATH_H
EIGEN_DEVICE_FUNC void pbroadcast4(const typename unpacket_traits< Packet >::type *a, Packet &a0, Packet &a1, Packet &a2, Packet &a3)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt(const typename unpacket_traits< Packet >::type *from)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt_ro(const typename unpacket_traits< Packet >::type *from)
#define EIGEN_ALWAYS_INLINE
EIGEN_DEVICE_FUNC void pbroadcast2(const typename unpacket_traits< Packet >::type *a, Packet &a0, Packet &a1)
#define EIGEN_STRONG_INLINE
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
void palign(PacketType &first, const PacketType &second)
EIGEN_DEVICE_FUNC Packet por(const Packet &a, const Packet &b)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pasin(const Packet &a)
EIGEN_STRONG_INLINE Packet4cf pinsertfirst(const Packet4cf &a, std::complex< float > b)
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_min(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet patan(const Packet &a)
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_max(const Packet &a)
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
EIGEN_DEVICE_FUNC const LogReturnType log() const
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
DerType::Scalar imag(const AutoDiffScalar< DerType > &)
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psqrt(const Packet &a)
EIGEN_DEVICE_FUNC Packet pload1(const typename unpacket_traits< Packet >::type *a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptanh(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
EIGEN_DEVICE_FUNC Packet ploadquad(const typename unpacket_traits< Packet >::type *from)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psinh(const Packet &a)
EIGEN_DEVICE_FUNC void pscatter(Scalar *to, const Packet &from, Index)
EIGEN_STRONG_INLINE Packet2cf pcplxflip(const Packet2cf &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet plset(const typename unpacket_traits< Packet >::type &a)
EIGEN_DEVICE_FUNC Packet preduxp(const Packet *vecs)
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
EIGEN_DEVICE_FUNC const RoundReturnType round() const
EIGEN_DEVICE_FUNC const CosReturnType cos() const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pceil(const Packet &a)
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptan(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog1p(const Packet &a)
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
EIGEN_DEVICE_FUNC const Log1pReturnType log1p() const
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
EIGEN_DEVICE_FUNC Packet parg(const Packet &a)
EIGEN_DEVICE_FUNC Packet ploadu(const typename unpacket_traits< Packet >::type *from)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pacos(const Packet &a)
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
void pstore1(typename unpacket_traits< Packet >::type *to, const typename unpacket_traits< Packet >::type &a)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type pfirst(const Packet &a)
EIGEN_DEVICE_FUNC const TanReturnType tan() const
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
#define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet ploaddup(const typename unpacket_traits< Packet >::type *from)
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet prsqrt(const Packet &a)
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC TgtPacket pcast(const SrcPacket &a)
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog10(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pfloor(const Packet &a)
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
EIGEN_DEVICE_FUNC Packet pandnot(const Packet &a, const Packet &b)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pround(const Packet &a)
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet4cf pinsertlast(const Packet4cf &a, std::complex< float > b)
EIGEN_DEVICE_FUNC const Log10ReturnType log10() const
EIGEN_DEVICE_FUNC Packet pxor(const Packet &a, const Packet &b)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
EIGEN_DEVICE_FUNC const SinReturnType sin() const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin(const Packet &a)
EIGEN_DEVICE_FUNC void prefetch(const Scalar *addr)
EIGEN_DEVICE_FUNC Packet pset1(const typename unpacket_traits< Packet >::type &a)
static void run(PacketType &, const PacketType &)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret(Scalar *to, const Packet &from)
const AutoDiffScalar< DerType > & real(const AutoDiffScalar< DerType > &x)
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcosh(const Packet &a)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC const AsinReturnType asin() const
EIGEN_DEVICE_FUNC Packet pmax(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC conditional<(unpacket_traits< Packet >::size%8)==0, typename unpacket_traits< Packet >::half, Packet >::type predux_downto4(const Packet &a)
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
EIGEN_DEVICE_FUNC Packet pgather(const Scalar *from, Index)
EIGEN_DEVICE_FUNC Packet pand(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Packet pload(const typename unpacket_traits< Packet >::type *from)
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)