26#ifndef itkOpenCLOstreamSupport_h
27#define itkOpenCLOstreamSupport_h
38template <
typename u
charT,
typename traits>
39inline std::basic_ostream<ucharT, traits> &
40operator<<(std::basic_ostream<ucharT, traits> & strm,
const cl_uchar & _v)
42 strm <<
"(uchar)(" << _v <<
")";
47template <
typename u
charT,
typename traits>
48inline std::basic_ostream<ucharT, traits> &
49operator<<(std::basic_ostream<ucharT, traits> & strm,
const cl_uchar2 & _v)
52 for (
unsigned int i = 0; i < 2; ++i)
65template <
typename u
charT,
typename traits>
66inline std::basic_ostream<ucharT, traits> &
67operator<<(std::basic_ostream<ucharT, traits> & strm,
const cl_uchar4 & _v)
70 for (
unsigned int i = 0; i < 4; ++i)
83template <
typename u
charT,
typename traits>
84inline std::basic_ostream<ucharT, traits> &
85operator<<(std::basic_ostream<ucharT, traits> & strm,
const cl_uchar8 & _v)
88 for (
unsigned int i = 0; i < 8; ++i)
101template <
typename u
charT,
typename traits>
102inline std::basic_ostream<ucharT, traits> &
103operator<<(std::basic_ostream<ucharT, traits> & strm,
const cl_uchar16 & _v)
105 strm <<
"(uchar16)(";
106 for (
unsigned int i = 0; i < 16; ++i)
121template <
typename charT,
typename traits>
122inline std::basic_ostream<charT, traits> &
123operator<<(std::basic_ostream<charT, traits> & strm,
const cl_char & _v)
125 strm <<
"(char)(" << _v <<
")";
130template <
typename charT,
typename traits>
131inline std::basic_ostream<charT, traits> &
132operator<<(std::basic_ostream<charT, traits> & strm,
const cl_char2 & _v)
135 for (
unsigned int i = 0; i < 2; ++i)
148template <
typename charT,
typename traits>
149inline std::basic_ostream<charT, traits> &
150operator<<(std::basic_ostream<charT, traits> & strm,
const cl_char4 & _v)
153 for (
unsigned int i = 0; i < 4; ++i)
166template <
typename charT,
typename traits>
167inline std::basic_ostream<charT, traits> &
168operator<<(std::basic_ostream<charT, traits> & strm,
const cl_char8 & _v)
171 for (
unsigned int i = 0; i < 8; ++i)
184template <
typename charT,
typename traits>
185inline std::basic_ostream<charT, traits> &
186operator<<(std::basic_ostream<charT, traits> & strm,
const cl_char16 & _v)
189 for (
unsigned int i = 0; i < 16; ++i)
204template <
typename u
shortT,
typename traits>
205inline std::basic_ostream<ushortT, traits> &
206operator<<(std::basic_ostream<ushortT, traits> & strm,
const cl_ushort & _v)
208 strm <<
"(ushort)(" << _v <<
")";
213template <
typename u
shortT,
typename traits>
214inline std::basic_ostream<ushortT, traits> &
215operator<<(std::basic_ostream<ushortT, traits> & strm,
const cl_ushort2 & _v)
217 strm <<
"(ushort2)(";
218 for (
unsigned int i = 0; i < 2; ++i)
231template <
typename u
shortT,
typename traits>
232inline std::basic_ostream<ushortT, traits> &
233operator<<(std::basic_ostream<ushortT, traits> & strm,
const cl_ushort4 & _v)
235 strm <<
"(ushort4)(";
236 for (
unsigned int i = 0; i < 4; ++i)
249template <
typename u
shortT,
typename traits>
250inline std::basic_ostream<ushortT, traits> &
251operator<<(std::basic_ostream<ushortT, traits> & strm,
const cl_ushort8 & _v)
253 strm <<
"(ushort8)(";
254 for (
unsigned int i = 0; i < 8; ++i)
267template <
typename u
shortT,
typename traits>
268inline std::basic_ostream<ushortT, traits> &
269operator<<(std::basic_ostream<ushortT, traits> & strm,
const cl_ushort16 & _v)
271 strm <<
"(ushort16)(";
272 for (
unsigned int i = 0; i < 16; ++i)
287template <
typename shortT,
typename traits>
288inline std::basic_ostream<shortT, traits> &
289operator<<(std::basic_ostream<shortT, traits> & strm,
const cl_short & _v)
291 strm <<
"(short)(" << _v <<
")";
296template <
typename shortT,
typename traits>
297inline std::basic_ostream<shortT, traits> &
298operator<<(std::basic_ostream<shortT, traits> & strm,
const cl_short2 & _v)
301 for (
unsigned int i = 0; i < 2; ++i)
314template <
typename shortT,
typename traits>
315inline std::basic_ostream<shortT, traits> &
316operator<<(std::basic_ostream<shortT, traits> & strm,
const cl_short4 & _v)
319 for (
unsigned int i = 0; i < 4; ++i)
332template <
typename shortT,
typename traits>
333inline std::basic_ostream<shortT, traits> &
334operator<<(std::basic_ostream<shortT, traits> & strm,
const cl_short8 & _v)
337 for (
unsigned int i = 0; i < 8; ++i)
350template <
typename shortT,
typename traits>
351inline std::basic_ostream<shortT, traits> &
352operator<<(std::basic_ostream<shortT, traits> & strm,
const cl_short16 & _v)
354 strm <<
"(short16)(";
355 for (
unsigned int i = 0; i < 16; ++i)
370template <
typename charT,
typename traits>
371inline std::basic_ostream<charT, traits> &
372operator<<(std::basic_ostream<charT, traits> & strm,
const cl_uint & _v)
374 strm <<
"(uint)(" << _v <<
")";
379template <
typename charT,
typename traits>
380inline std::basic_ostream<charT, traits> &
381operator<<(std::basic_ostream<charT, traits> & strm,
const cl_uint2 & _v)
384 for (
unsigned int i = 0; i < 2; ++i)
397template <
typename charT,
typename traits>
398inline std::basic_ostream<charT, traits> &
399operator<<(std::basic_ostream<charT, traits> & strm,
const cl_uint4 & _v)
402 for (
unsigned int i = 0; i < 4; ++i)
415template <
typename charT,
typename traits>
416inline std::basic_ostream<charT, traits> &
417operator<<(std::basic_ostream<charT, traits> & strm,
const cl_uint8 & _v)
420 for (
unsigned int i = 0; i < 8; ++i)
433template <
typename charT,
typename traits>
434inline std::basic_ostream<charT, traits> &
435operator<<(std::basic_ostream<charT, traits> & strm,
const cl_uint16 & _v)
438 for (
unsigned int i = 0; i < 16; ++i)
453template <
typename charT,
typename traits>
454inline std::basic_ostream<charT, traits> &
455operator<<(std::basic_ostream<charT, traits> & strm,
const cl_int & _v)
457 strm <<
"(int)(" << _v <<
")";
462template <
typename charT,
typename traits>
463inline std::basic_ostream<charT, traits> &
464operator<<(std::basic_ostream<charT, traits> & strm,
const cl_int2 & _v)
467 for (
unsigned int i = 0; i < 2; ++i)
480template <
typename charT,
typename traits>
481inline std::basic_ostream<charT, traits> &
482operator<<(std::basic_ostream<charT, traits> & strm,
const cl_int4 & _v)
485 for (
unsigned int i = 0; i < 4; ++i)
498template <
typename charT,
typename traits>
499inline std::basic_ostream<charT, traits> &
500operator<<(std::basic_ostream<charT, traits> & strm,
const cl_int8 & _v)
503 for (
unsigned int i = 0; i < 8; ++i)
516template <
typename charT,
typename traits>
517inline std::basic_ostream<charT, traits> &
518operator<<(std::basic_ostream<charT, traits> & strm,
const cl_int16 & _v)
521 for (
unsigned int i = 0; i < 16; ++i)
536template <
typename u
longT,
typename traits>
537inline std::basic_ostream<ulongT, traits> &
538operator<<(std::basic_ostream<ulongT, traits> & strm,
const cl_ulong & _v)
540 strm <<
"(ulong)(" << _v <<
")";
545template <
typename u
longT,
typename traits>
546inline std::basic_ostream<ulongT, traits> &
547operator<<(std::basic_ostream<ulongT, traits> & strm,
const cl_ulong2 & _v)
550 for (
unsigned int i = 0; i < 2; ++i)
563template <
typename u
longT,
typename traits>
564inline std::basic_ostream<ulongT, traits> &
565operator<<(std::basic_ostream<ulongT, traits> & strm,
const cl_ulong4 & _v)
568 for (
unsigned int i = 0; i < 4; ++i)
581template <
typename u
longT,
typename traits>
582inline std::basic_ostream<ulongT, traits> &
583operator<<(std::basic_ostream<ulongT, traits> & strm,
const cl_ulong8 & _v)
586 for (
unsigned int i = 0; i < 8; ++i)
599template <
typename u
longT,
typename traits>
600inline std::basic_ostream<ulongT, traits> &
601operator<<(std::basic_ostream<ulongT, traits> & strm,
const cl_ulong16 & _v)
603 strm <<
"(ulong16)(";
604 for (
unsigned int i = 0; i < 16; ++i)
619template <
typename longT,
typename traits>
620inline std::basic_ostream<longT, traits> &
621operator<<(std::basic_ostream<longT, traits> & strm,
const cl_long & _v)
623 strm <<
"(long)(" << _v <<
")";
628template <
typename longT,
typename traits>
629inline std::basic_ostream<longT, traits> &
630operator<<(std::basic_ostream<longT, traits> & strm,
const cl_long2 & _v)
633 for (
unsigned int i = 0; i < 2; ++i)
646template <
typename longT,
typename traits>
647inline std::basic_ostream<longT, traits> &
648operator<<(std::basic_ostream<longT, traits> & strm,
const cl_long4 & _v)
651 for (
unsigned int i = 0; i < 4; ++i)
664template <
typename longT,
typename traits>
665inline std::basic_ostream<longT, traits> &
666operator<<(std::basic_ostream<longT, traits> & strm,
const cl_long8 & _v)
669 for (
unsigned int i = 0; i < 8; ++i)
682template <
typename longT,
typename traits>
683inline std::basic_ostream<longT, traits> &
684operator<<(std::basic_ostream<longT, traits> & strm,
const cl_long16 & _v)
687 for (
unsigned int i = 0; i < 16; ++i)
702template <
typename charT,
typename traits>
703inline std::basic_ostream<charT, traits> &
704operator<<(std::basic_ostream<charT, traits> & strm,
const cl_float & _v)
706 strm <<
"(float)(" << _v <<
")";
711template <
typename charT,
typename traits>
712inline std::basic_ostream<charT, traits> &
713operator<<(std::basic_ostream<charT, traits> & strm,
const cl_float2 & _v)
716 for (
unsigned int i = 0; i < 2; ++i)
718 strm << std::fixed << std::setprecision(8) << _v.s[i];
729template <
typename charT,
typename traits>
730inline std::basic_ostream<charT, traits> &
731operator<<(std::basic_ostream<charT, traits> & strm,
const cl_float4 & _v)
734 for (
unsigned int i = 0; i < 4; ++i)
736 strm << std::fixed << std::setprecision(8) << _v.s[i];
747template <
typename charT,
typename traits>
748inline std::basic_ostream<charT, traits> &
749operator<<(std::basic_ostream<charT, traits> & strm,
const cl_float8 & _v)
752 for (
unsigned int i = 0; i < 8; ++i)
754 strm << std::fixed << std::setprecision(8) << _v.s[i];
765template <
typename charT,
typename traits>
766inline std::basic_ostream<charT, traits> &
767operator<<(std::basic_ostream<charT, traits> & strm,
const cl_float16 & _v)
769 strm <<
"(float16)(";
770 for (
unsigned int i = 0; i < 16; ++i)
772 strm << std::fixed << std::setprecision(8) << _v.s[i];
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)