mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix failing MSVC tests due to compiler bugs.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
d6235d76db
commit
394aabb0a3
22
test/packet_ostream.h
Normal file
22
test/packet_ostream.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef TEST_PACKET_OSTREAM
|
||||
#define TEST_PACKET_OSTREAM
|
||||
|
||||
#include <type_traits>
|
||||
#include <ostream>
|
||||
|
||||
// Include this header to be able to print Packets while debugging.
|
||||
|
||||
template<typename Packet, typename EnableIf = std::enable_if_t<Eigen::internal::unpacket_traits<Packet>::vectorizable> >
|
||||
std::ostream& operator<<(std::ostream& os, const Packet& packet) {
|
||||
using Scalar = typename Eigen::internal::unpacket_traits<Packet>::type;
|
||||
Scalar v[Eigen::internal::unpacket_traits<Packet>::size];
|
||||
Eigen::internal::pstoreu(v, packet);
|
||||
os << "{" << v[0];
|
||||
for (int i=1; i<Eigen::internal::unpacket_traits<Packet>::size; ++i) {
|
||||
os << "," << v[i];
|
||||
}
|
||||
os << "}";
|
||||
return os;
|
||||
}
|
||||
|
||||
#endif // TEST_PACKET_OSTREAM
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "packetmath_test_shared.h"
|
||||
#include "random_without_cast_overflow.h"
|
||||
#include "packet_ostream.h"
|
||||
|
||||
template <typename T>
|
||||
inline T REF_ADD(const T& a, const T& b) {
|
||||
|
||||
Reference in New Issue
Block a user