2 * Copyright (c) 2017-2018 ARM Limited.
4 * SPDX-License-Identifier: MIT
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 #ifndef __ARM_COMPUTE_TEST_TYPE_PRINTER_H__
25 #define __ARM_COMPUTE_TEST_TYPE_PRINTER_H__
27 #include "arm_compute/core/CL/CLTypes.h"
28 #include "arm_compute/core/Dimensions.h"
29 #include "arm_compute/core/Error.h"
30 #include "arm_compute/core/GPUTarget.h"
31 #include "arm_compute/core/HOGInfo.h"
32 #include "arm_compute/core/Size2D.h"
33 #include "arm_compute/core/Strides.h"
34 #include "arm_compute/core/TensorInfo.h"
35 #include "arm_compute/core/Types.h"
37 #include "tests/Types.h"
45 /** Formatted output of the Dimensions type.
47 * @param[out] os Output stream.
48 * @param[in] dimensions Type to output.
50 * @return Modified output stream.
53 inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
55 if(dimensions.num_dimensions() > 0)
59 for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
61 os << "x" << dimensions[d];
68 /** Formatted output of the NonLinearFilterFunction type.
70 * @param[out] os Output stream.
71 * @param[in] function Type to output.
73 * @return Modified output stream.
75 inline ::std::ostream &operator<<(::std::ostream &os, const NonLinearFilterFunction &function)
79 case NonLinearFilterFunction::MAX:
82 case NonLinearFilterFunction::MEDIAN:
85 case NonLinearFilterFunction::MIN:
89 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
95 /** Formatted output of the NonLinearFilterFunction type.
97 * @param[in] function Type to output.
99 * @return Formatted string.
101 inline std::string to_string(const NonLinearFilterFunction &function)
103 std::stringstream str;
108 /** Formatted output of the MatrixPattern type.
110 * @param[out] os Output stream.
111 * @param[in] pattern Type to output.
113 * @return Modified output stream.
115 inline ::std::ostream &operator<<(::std::ostream &os, const MatrixPattern &pattern)
119 case MatrixPattern::BOX:
122 case MatrixPattern::CROSS:
125 case MatrixPattern::DISK:
128 case MatrixPattern::OTHER:
132 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
138 /** Formatted output of the MatrixPattern type.
140 * @param[in] pattern Type to output.
142 * @return Formatted string.
144 inline std::string to_string(const MatrixPattern &pattern)
146 std::stringstream str;
151 /** Formatted output of the RoundingPolicy type.
153 * @param[out] os Output stream.
154 * @param[in] rounding_policy Type to output.
156 * @return Modified output stream.
158 inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy)
160 switch(rounding_policy)
162 case RoundingPolicy::TO_ZERO:
165 case RoundingPolicy::TO_NEAREST_UP:
166 os << "TO_NEAREST_UP";
168 case RoundingPolicy::TO_NEAREST_EVEN:
169 os << "TO_NEAREST_EVEN";
172 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
178 /** Formatted output of the WeightsInfo type.
180 * @param[out] os Output stream.
181 * @param[in] weights_info Type to output.
183 * @return Modified output stream.
185 inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info)
187 os << weights_info.are_reshaped() << ";";
188 os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second;
193 /** Formatted output of the ROIPoolingInfo type.
195 * @param[out] os Output stream.
196 * @param[in] pool_info Type to output.
198 * @return Modified output stream.
200 inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
202 os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
206 /** Formatted output of the QuantizationInfo type.
208 * @param[out] os Output stream.
209 * @param[in] quantization_info Type to output.
211 * @return Modified output stream.
213 inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &quantization_info)
215 os << "Scale:" << quantization_info.scale << "~"
216 << "Offset:" << quantization_info.offset;
220 /** Formatted output of the QuantizationInfo type.
222 * @param[in] quantization_info Type to output.
224 * @return Formatted string.
226 inline std::string to_string(const QuantizationInfo &quantization_info)
228 std::stringstream str;
229 str << quantization_info;
233 /** Formatted output of the FixedPointOp type.
235 * @param[out] os Output stream.
236 * @param[in] op Type to output.
238 * @return Modified output stream.
240 inline ::std::ostream &operator<<(::std::ostream &os, const FixedPointOp &op)
244 case FixedPointOp::ADD:
247 case FixedPointOp::SUB:
250 case FixedPointOp::MUL:
253 case FixedPointOp::EXP:
256 case FixedPointOp::LOG:
259 case FixedPointOp::INV_SQRT:
262 case FixedPointOp::RECIPROCAL:
266 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
272 /** Formatted output of the FixedPointOp type.
274 * @param[in] op Type to output.
276 * @return Formatted string.
278 inline std::string to_string(const FixedPointOp &op)
280 std::stringstream str;
285 /** Formatted output of the activation function type.
287 * @param[out] os Output stream.
288 * @param[in] act_function Type to output.
290 * @return Modified output stream.
292 inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
296 case ActivationLayerInfo::ActivationFunction::ABS:
299 case ActivationLayerInfo::ActivationFunction::LINEAR:
302 case ActivationLayerInfo::ActivationFunction::LOGISTIC:
305 case ActivationLayerInfo::ActivationFunction::RELU:
308 case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
309 os << "BOUNDED_RELU";
311 case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
314 case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
317 case ActivationLayerInfo::ActivationFunction::SQRT:
320 case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU:
321 os << "LU_BOUNDED_RELU";
323 case ActivationLayerInfo::ActivationFunction::SQUARE:
326 case ActivationLayerInfo::ActivationFunction::TANH:
330 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
336 /** Formatted output of the activation function info type.
338 * @param[in] info Type to output.
340 * @return Formatted string.
342 inline std::string to_string(const arm_compute::ActivationLayerInfo &info)
344 std::stringstream str;
347 str << info.activation();
352 /** Formatted output of the activation function type.
354 * @param[in] function Type to output.
356 * @return Formatted string.
358 inline std::string to_string(const arm_compute::ActivationLayerInfo::ActivationFunction &function)
360 std::stringstream str;
365 /** Formatted output of the NormType type.
367 * @param[out] os Output stream.
368 * @param[in] norm_type Type to output.
370 * @return Modified output stream.
372 inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type)
376 case NormType::CROSS_MAP:
379 case NormType::IN_MAP_1D:
382 case NormType::IN_MAP_2D:
386 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
392 /** Formatted output of @ref NormalizationLayerInfo.
394 * @param[in] info Type to output.
396 * @return Formatted string.
398 inline std::string to_string(const arm_compute::NormalizationLayerInfo &info)
400 std::stringstream str;
401 str << info.type() << ":NormSize=" << info.norm_size();
405 /** Formatted output of @ref NormalizationLayerInfo.
407 * @param[out] os Output stream.
408 * @param[in] info Type to output.
410 * @return Modified output stream.
412 inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info)
414 os << info.type() << ":NormSize=" << info.norm_size();
418 /** Formatted output of the PoolingType type.
420 * @param[out] os Output stream.
421 * @param[in] pool_type Type to output.
423 * @return Modified output stream.
425 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type)
429 case PoolingType::AVG:
432 case PoolingType::MAX:
435 case PoolingType::L2:
439 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
445 /** Formatted output of @ref PoolingLayerInfo.
447 * @param[out] os Output stream.
448 * @param[in] info Type to output.
450 * @return Modified output stream.
452 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info)
454 os << info.pool_type();
459 /** Formatted output of @ref RoundingPolicy.
461 * @param[in] rounding_policy Type to output.
463 * @return Formatted string.
465 inline std::string to_string(const RoundingPolicy &rounding_policy)
467 std::stringstream str;
468 str << rounding_policy;
472 /** Formatted output of the DataLayout type.
474 * @param[out] os Output stream.
475 * @param[in] data_layout Type to output.
477 * @return Modified output stream.
479 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout)
483 case DataLayout::UNKNOWN:
486 case DataLayout::NHWC:
489 case DataLayout::NCHW:
493 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
499 /** Formatted output of the DataLayout type.
501 * @param[in] data_layout Type to output.
503 * @return Formatted string.
505 inline std::string to_string(const arm_compute::DataLayout &data_layout)
507 std::stringstream str;
512 /** Formatted output of the DataType type.
514 * @param[out] os Output stream.
515 * @param[in] data_type Type to output.
517 * @return Modified output stream.
519 inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
523 case DataType::UNKNOWN:
532 case DataType::QASYMM8:
568 case DataType::SIZET:
572 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
578 /** Formatted output of the DataType type.
580 * @param[in] data_type Type to output.
582 * @return Formatted string.
584 inline std::string to_string(const arm_compute::DataType &data_type)
586 std::stringstream str;
591 /** Formatted output of the Format type.
593 * @param[out] os Output stream.
594 * @param[in] format Type to output.
596 * @return Modified output stream.
598 inline ::std::ostream &operator<<(::std::ostream &os, const Format &format)
602 case Format::UNKNOWN:
632 case Format::RGBA8888:
638 case Format::YUYV422:
650 case Format::UYVY422:
654 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
660 /** Formatted output of the Format type.
662 * @param[in] format Type to output.
664 * @return Formatted string.
666 inline std::string to_string(const Format &format)
668 std::stringstream str;
673 /** Formatted output of the Channel type.
675 * @param[out] os Output stream.
676 * @param[in] channel Type to output.
678 * @return Modified output stream.
680 inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel)
684 case Channel::UNKNOWN:
721 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
727 /** Formatted output of the Channel type.
729 * @param[in] channel Type to output.
731 * @return Formatted string.
733 inline std::string to_string(const Channel &channel)
735 std::stringstream str;
740 /** Formatted output of the BorderMode type.
742 * @param[out] os Output stream.
743 * @param[in] mode Type to output.
745 * @return Modified output stream.
747 inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode)
751 case BorderMode::UNDEFINED:
754 case BorderMode::CONSTANT:
757 case BorderMode::REPLICATE:
761 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
767 /** Formatted output of the BorderSize type.
769 * @param[out] os Output stream.
770 * @param[in] border Type to output.
772 * @return Modified output stream.
774 inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border)
776 os << border.top << ","
777 << border.right << ","
778 << border.bottom << ","
784 /** Formatted output of the InterpolationPolicy type.
786 * @param[out] os Output stream.
787 * @param[in] policy Type to output.
789 * @return Modified output stream.
791 inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy)
795 case InterpolationPolicy::NEAREST_NEIGHBOR:
796 os << "NEAREST_NEIGHBOR";
798 case InterpolationPolicy::BILINEAR:
801 case InterpolationPolicy::AREA:
805 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
811 /** Formatted output of the SamplingPolicy type.
813 * @param[out] os Output stream.
814 * @param[in] policy Type to output.
816 * @return Modified output stream.
818 inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy)
822 case SamplingPolicy::CENTER:
825 case SamplingPolicy::TOP_LEFT:
829 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
835 /** Formatted output of the TensorInfo type.
837 * @param[in] info Type to output.
839 * @return Formatted string.
841 inline std::string to_string(const TensorInfo &info)
843 std::stringstream str;
844 str << "{Shape=" << info.tensor_shape() << ","
845 << "Type=" << info.data_type() << ","
846 << "Channels=" << info.num_channels() << ","
847 << "FixedPointPos=" << info.fixed_point_position() << "}";
851 /** Formatted output of the Dimensions type.
853 * @param[in] dimensions Type to output.
855 * @return Formatted string.
857 template <typename T>
858 inline std::string to_string(const Dimensions<T> &dimensions)
860 std::stringstream str;
865 /** Formatted output of the Strides type.
867 * @param[in] stride Type to output.
869 * @return Formatted string.
871 inline std::string to_string(const Strides &stride)
873 std::stringstream str;
878 /** Formatted output of the TensorShape type.
880 * @param[in] shape Type to output.
882 * @return Formatted string.
884 inline std::string to_string(const TensorShape &shape)
886 std::stringstream str;
891 /** Formatted output of the Coordinates type.
893 * @param[in] coord Type to output.
895 * @return Formatted string.
897 inline std::string to_string(const Coordinates &coord)
899 std::stringstream str;
904 /** Formatted output of the Rectangle type.
906 * @param[out] os Output stream.
907 * @param[in] rect Type to output.
909 * @return Modified output stream.
911 inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect)
913 os << rect.width << "x" << rect.height;
914 os << "+" << rect.x << "+" << rect.y;
919 /** Formatted output of the PadStrideInfo type.
921 * @param[out] os Output stream.
922 * @param[in] pad_stride_info Type to output.
924 * @return Modified output stream.
926 inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info)
928 os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
930 os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << ","
931 << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom();
936 /** Formatted output of the PadStrideInfo type.
938 * @param[in] pad_stride_info Type to output.
940 * @return Formatted string.
942 inline std::string to_string(const PadStrideInfo &pad_stride_info)
944 std::stringstream str;
945 str << pad_stride_info;
949 /** Formatted output of the BorderMode type.
951 * @param[in] mode Type to output.
953 * @return Formatted string.
955 inline std::string to_string(const BorderMode &mode)
957 std::stringstream str;
962 /** Formatted output of the BorderSize type.
964 * @param[in] border Type to output.
966 * @return Formatted string.
968 inline std::string to_string(const BorderSize &border)
970 std::stringstream str;
975 /** Formatted output of the InterpolationPolicy type.
977 * @param[in] policy Type to output.
979 * @return Formatted string.
981 inline std::string to_string(const InterpolationPolicy &policy)
983 std::stringstream str;
988 /** Formatted output of the SamplingPolicy type.
990 * @param[in] policy Type to output.
992 * @return Formatted string.
994 inline std::string to_string(const SamplingPolicy &policy)
996 std::stringstream str;
1001 /** Formatted output of the ConvertPolicy type.
1003 * @param[out] os Output stream.
1004 * @param[in] policy Type to output.
1006 * @return Modified output stream.
1008 inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy)
1012 case ConvertPolicy::WRAP:
1015 case ConvertPolicy::SATURATE:
1019 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1025 inline std::string to_string(const ConvertPolicy &policy)
1027 std::stringstream str;
1032 /** Formatted output of the Reduction Operations.
1034 * @param[out] os Output stream.
1035 * @param[in] op Type to output.
1037 * @return Modified output stream.
1039 inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op)
1043 case ReductionOperation::SUM_SQUARE:
1047 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1053 /** Formatted output of the Reduction Operations.
1055 * @param[in] op Type to output.
1057 * @return Formatted string.
1059 inline std::string to_string(const ReductionOperation &op)
1061 std::stringstream str;
1066 /** Formatted output of the Norm Type.
1068 * @param[in] type Type to output.
1070 * @return Formatted string.
1072 inline std::string to_string(const NormType &type)
1074 std::stringstream str;
1079 /** Formatted output of the Pooling Type.
1081 * @param[in] type Type to output.
1083 * @return Formatted string.
1085 inline std::string to_string(const PoolingType &type)
1087 std::stringstream str;
1092 /** Formatted output of the Pooling Layer Info.
1094 * @param[in] info Type to output.
1096 * @return Formatted string.
1098 inline std::string to_string(const PoolingLayerInfo &info)
1100 std::stringstream str;
1101 str << "{Type=" << info.pool_type() << ","
1102 << "IsGlobalPooling=" << info.is_global_pooling();
1103 if(!info.is_global_pooling())
1106 << "PoolSize=" << info.pool_size().width << "," << info.pool_size().height << ","
1107 << "PadStride=" << info.pad_stride_info();
1113 /** Formatted output of the KeyPoint type.
1115 * @param[out] os Output stream
1116 * @param[in] point Type to output.
1118 * @return Modified output stream.
1120 inline ::std::ostream &operator<<(::std::ostream &os, const KeyPoint &point)
1122 os << "{x=" << point.x << ","
1123 << "y=" << point.y << ","
1124 << "strength=" << point.strength << ","
1125 << "scale=" << point.scale << ","
1126 << "orientation=" << point.orientation << ","
1127 << "tracking_status=" << point.tracking_status << ","
1128 << "error=" << point.error << "}";
1133 /** Formatted output of the PhaseType type.
1135 * @param[out] os Output stream
1136 * @param[in] phase_type Type to output.
1138 * @return Modified output stream.
1140 inline ::std::ostream &operator<<(::std::ostream &os, const PhaseType &phase_type)
1144 case PhaseType::SIGNED:
1147 case PhaseType::UNSIGNED:
1151 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1157 /** Formatted output of the PhaseType type.
1159 * @param[in] type Type to output.
1161 * @return Formatted string.
1163 inline std::string to_string(const arm_compute::PhaseType &type)
1165 std::stringstream str;
1170 /** Formatted output of the MagnitudeType type.
1172 * @param[out] os Output stream
1173 * @param[in] magnitude_type Type to output.
1175 * @return Modified output stream.
1177 inline ::std::ostream &operator<<(::std::ostream &os, const MagnitudeType &magnitude_type)
1179 switch(magnitude_type)
1181 case MagnitudeType::L1NORM:
1184 case MagnitudeType::L2NORM:
1188 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1194 /** Formatted output of the MagnitudeType type.
1196 * @param[in] type Type to output.
1198 * @return Formatted string.
1200 inline std::string to_string(const arm_compute::MagnitudeType &type)
1202 std::stringstream str;
1207 /** Formatted output of the GradientDimension type.
1209 * @param[out] os Output stream
1210 * @param[in] dim Type to output
1212 * @return Modified output stream.
1214 inline ::std::ostream &operator<<(::std::ostream &os, const GradientDimension &dim)
1218 case GradientDimension::GRAD_X:
1221 case GradientDimension::GRAD_Y:
1224 case GradientDimension::GRAD_XY:
1228 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1234 /** Formatted output of the GradientDimension type.
1236 * @param[in] type Type to output
1238 * @return Formatted string.
1240 inline std::string to_string(const arm_compute::GradientDimension &type)
1242 std::stringstream str;
1247 /** Formatted output of the HOGNormType type.
1249 * @param[out] os Output stream
1250 * @param[in] norm_type Type to output
1252 * @return Modified output stream.
1254 inline ::std::ostream &operator<<(::std::ostream &os, const HOGNormType &norm_type)
1258 case HOGNormType::L1_NORM:
1261 case HOGNormType::L2_NORM:
1264 case HOGNormType::L2HYS_NORM:
1268 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1274 /** Formatted output of the HOGNormType type.
1276 * @param[in] type Type to output
1278 * @return Formatted string.
1280 inline std::string to_string(const HOGNormType &type)
1282 std::stringstream str;
1287 /** Formatted output of the Size2D type.
1289 * @param[out] os Output stream
1290 * @param[in] size Type to output
1292 * @return Modified output stream.
1294 inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size)
1296 os << size.width << "x" << size.height;
1301 /** Formatted output of the Size2D type.
1303 * @param[in] type Type to output
1305 * @return Formatted string.
1307 inline std::string to_string(const Size2D &type)
1309 std::stringstream str;
1314 /** Formatted output of the HOGInfo type.
1316 * @param[out] os Output stream
1317 * @param[in] hog_info Type to output
1319 * @return Modified output stream.
1321 inline ::std::ostream &operator<<(::std::ostream &os, const HOGInfo &hog_info)
1323 os << "{CellSize=" << hog_info.cell_size() << ","
1324 << "BlockSize=" << hog_info.block_size() << ","
1325 << "DetectionWindowSize=" << hog_info.detection_window_size() << ","
1326 << "BlockStride=" << hog_info.block_stride() << ","
1327 << "NumBins=" << hog_info.num_bins() << ","
1328 << "NormType=" << hog_info.normalization_type() << ","
1329 << "L2HystThreshold=" << hog_info.l2_hyst_threshold() << ","
1330 << "PhaseType=" << hog_info.phase_type() << "}";
1335 /** Formatted output of the HOGInfo type.
1337 * @param[in] type Type to output
1339 * @return Formatted string.
1341 inline std::string to_string(const HOGInfo &type)
1343 std::stringstream str;
1348 /** Formatted output of the ConvolutionMethod type.
1350 * @param[out] os Output stream
1351 * @param[in] conv_method Type to output
1353 * @return Modified output stream.
1355 inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method)
1359 case ConvolutionMethod::GEMM:
1362 case ConvolutionMethod::DIRECT:
1365 case ConvolutionMethod::WINOGRAD:
1369 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1375 /** Formatted output of the ConvolutionMethod type.
1377 * @param[in] conv_method Type to output
1379 * @return Formatted string.
1381 inline std::string to_string(const ConvolutionMethod &conv_method)
1383 std::stringstream str;
1388 /** Formatted output of the GPUTarget type.
1390 * @param[out] os Output stream
1391 * @param[in] gpu_target Type to output
1393 * @return Modified output stream.
1395 inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target)
1399 case GPUTarget::GPU_ARCH_MASK:
1400 os << "GPU_ARCH_MASK";
1402 case GPUTarget::MIDGARD:
1405 case GPUTarget::BIFROST:
1408 case GPUTarget::T600:
1411 case GPUTarget::T700:
1414 case GPUTarget::T800:
1417 case GPUTarget::G71:
1420 case GPUTarget::G72:
1423 case GPUTarget::G51:
1426 case GPUTarget::G51BIG:
1429 case GPUTarget::G51LIT:
1432 case GPUTarget::TNOX:
1435 case GPUTarget::TTRX:
1438 case GPUTarget::TBOX:
1442 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1448 /** Formatted output of the GPUTarget type.
1450 * @param[in] gpu_target Type to output
1452 * @return Formatted string.
1454 inline std::string to_string(const GPUTarget &gpu_target)
1456 std::stringstream str;
1461 /** Formatted output of the DetectionWindow type.
1463 * @param[out] os Output stream
1464 * @param[in] detection_window Type to output
1466 * @return Modified output stream.
1468 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window)
1470 os << "{x=" << detection_window.x << ","
1471 << "y=" << detection_window.y << ","
1472 << "width=" << detection_window.width << ","
1473 << "height=" << detection_window.height << ","
1474 << "idx_class=" << detection_window.idx_class << ","
1475 << "score=" << detection_window.score << "}";
1480 /** Formatted output of the DetectionWindow type.
1482 * @param[in] detection_window Type to output
1484 * @return Formatted string.
1486 inline std::string to_string(const DetectionWindow &detection_window)
1488 std::stringstream str;
1489 str << detection_window;
1493 /** Formatted output of the Termination type.
1495 * @param[out] os Output stream
1496 * @param[in] termination Type to output
1498 * @return Modified output stream.
1500 inline ::std::ostream &operator<<(::std::ostream &os, const Termination &termination)
1504 case Termination::TERM_CRITERIA_EPSILON:
1505 os << "TERM_CRITERIA_EPSILON";
1507 case Termination::TERM_CRITERIA_ITERATIONS:
1508 os << "TERM_CRITERIA_ITERATIONS";
1510 case Termination::TERM_CRITERIA_BOTH:
1511 os << "TERM_CRITERIA_BOTH";
1514 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1520 /** Formatted output of the Termination type.
1522 * @param[in] termination Type to output
1524 * @return Formatted string.
1526 inline std::string to_string(const Termination &termination)
1528 std::stringstream str;
1533 /** Formatted output of the WinogradInfo type. */
1534 inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info)
1536 os << "{OutputTileSize=" << info.output_tile_size << ","
1537 << "KernelSize=" << info.kernel_size << ","
1538 << "PadStride=" << info.convolution_info << ","
1539 << "OutputDataLayout=" << info.output_data_layout << "}";
1544 inline std::string to_string(const WinogradInfo &type)
1546 std::stringstream str;
1550 } // namespace arm_compute
1551 #endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */