1
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2025-05-18 23:57:39 +08:00

Made it possible to use the sigmoid functor within a CUDA kernel.

This commit is contained in:
Benoit Steiner 2015-12-04 09:38:15 -08:00
parent e25e3a041b
commit d20efc974d

@ -40,8 +40,8 @@ struct scalar_sigmoid_op {
return one / (one + std::exp(-x)); return one / (one + std::exp(-x));
} }
template <typename Packet> template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
inline Packet packetOp(const Packet& x) const { Packet packetOp(const Packet& x) const {
const Packet one = pset1<Packet>(1); const Packet one = pset1<Packet>(1);
return pdiv(one, padd(one, pexp(pnegate(x)))); return pdiv(one, padd(one, pexp(pnegate(x))));
} }