packet_ostream.h
Go to the documentation of this file.
1 #ifndef TEST_PACKET_OSTREAM
2 #define TEST_PACKET_OSTREAM
3 
4 #include <type_traits>
5 #include <ostream>
6 
7 // Include this header to be able to print Packets while debugging.
8 
9 template <typename Packet,
10  typename EnableIf = std::enable_if_t<Eigen::internal::unpacket_traits<Packet>::vectorizable> >
11 std::ostream& operator<<(std::ostream& os, const Packet& packet) {
14  Eigen::internal::pstoreu(v, packet);
15  os << "{" << v[0];
17  os << "," << v[i];
18  }
19  os << "}";
20  return os;
21 }
22 
23 #endif // TEST_PACKET_OSTREAM
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
internal::packet_traits< Scalar >::type Packet
Definition: benchmark-blocking-sizes.cpp:54
std::ostream & operator<<(std::ostream &s, const DenseBase< Derived > &m)
Definition: IO.h:222
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:911
Definition: GenericPacketMath.h:134
Definition: ZVector/PacketMath.h:50