summaryrefslogtreecommitdiff
path: root/test/i965_streamable.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/i965_streamable.h')
-rw-r--r--test/i965_streamable.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/i965_streamable.h b/test/i965_streamable.h
index 4969c141..0f7e1291 100644
--- a/test/i965_streamable.h
+++ b/test/i965_streamable.h
@@ -29,6 +29,7 @@
#include <iostream>
#include <iomanip>
#include <sstream>
+#include <valarray>
#include <va/va.h>
namespace std {
@@ -55,6 +56,30 @@ namespace std {
}
return os << std::dec << "}";
}
+
+ template <typename T> inline std::ostream&
+ operator<<(std::ostream& os, const std::valarray<T>& a)
+ {
+ os << "{";
+ for (const auto& s : a) {
+ if (&s != &a[0])
+ os << ",";
+ os << s;
+ }
+ return os << "}";
+ }
+
+ template <> inline std::ostream&
+ operator<<(std::ostream& os, const std::valarray<uint8_t>& a)
+ {
+ os << "{" << std::hex;
+ for (const auto& s : a) {
+ if (&s != &a[0])
+ os << ",";
+ os << "0x" << std::setfill('0') << std::setw(2) << unsigned(s);
+ }
+ return os << std::dec << "}";
+ }
}// namespace std
template <typename T>