mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Bug #1785: Introduce numext::rint.
This provides a new op that matches std::rint and previous behavior of pround. Also adds corresponding unsupported/../Tensor op. Performance is the same as e. g. floor (tested SSE/AVX).
This commit is contained in:
@@ -518,6 +518,7 @@ template<typename Scalar,typename Packet> void packetmath_real()
|
||||
CHECK_CWISE1_IF(PacketTraits::HasRound, numext::round, internal::pround);
|
||||
CHECK_CWISE1_IF(PacketTraits::HasCeil, numext::ceil, internal::pceil);
|
||||
CHECK_CWISE1_IF(PacketTraits::HasFloor, numext::floor, internal::pfloor);
|
||||
CHECK_CWISE1_IF(PacketTraits::HasRint, numext::rint, internal::print);
|
||||
|
||||
// See bug 1785.
|
||||
for (int i=0; i<size; ++i)
|
||||
@@ -526,6 +527,7 @@ template<typename Scalar,typename Packet> void packetmath_real()
|
||||
data2[i] = -1.5 + i;
|
||||
}
|
||||
CHECK_CWISE1_IF(PacketTraits::HasRound, numext::round, internal::pround);
|
||||
CHECK_CWISE1_IF(PacketTraits::HasRint, numext::rint, internal::print);
|
||||
|
||||
for (int i=0; i<size; ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user