mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-01 08:14:10 +08:00
Made it possible to use the sigmoid functor within a CUDA kernel.
This commit is contained in:
parent
e25e3a041b
commit
d20efc974d
@ -40,8 +40,8 @@ struct scalar_sigmoid_op {
|
||||
return one / (one + std::exp(-x));
|
||||
}
|
||||
|
||||
template <typename Packet>
|
||||
inline Packet packetOp(const Packet& x) const {
|
||||
template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
Packet packetOp(const Packet& x) const {
|
||||
const Packet one = pset1<Packet>(1);
|
||||
return pdiv(one, padd(one, pexp(pnegate(x))));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user