blob: 91532bdaac633e20bd0ea00005b58f2d050d7893 [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*
SiCong Lidb4a6c12021-02-05 09:30:57 +00002 * Copyright (c) 2017-2021 Arm Limited.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
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:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
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
22 * SOFTWARE.
23 */
Anthony Barbier4dbc0a92018-08-27 13:39:47 +010024#ifndef __ARM_COMPUTE_TYPE_PRINTER_H__
25#define __ARM_COMPUTE_TYPE_PRINTER_H__
Anthony Barbier6ff3b192017-09-04 18:44:23 +010026
27#include "arm_compute/core/Dimensions.h"
28#include "arm_compute/core/Error.h"
Michele Di Giorgiob8fc60f2018-04-25 11:58:07 +010029#include "arm_compute/core/GPUTarget.h"
morgolockaba2f912020-05-05 16:28:19 +010030#include "arm_compute/core/KernelDescriptors.h"
John Richardson25f23682017-11-27 14:35:09 +000031#include "arm_compute/core/Size2D.h"
John Richardsona36eae12017-09-26 16:55:59 +010032#include "arm_compute/core/Strides.h"
Georgios Pinitas3faea252017-10-30 14:13:50 +000033#include "arm_compute/core/TensorInfo.h"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010034#include "arm_compute/core/Types.h"
Vidhya Sudhan Loganathan050471e2019-04-25 09:27:24 +010035#include "arm_compute/runtime/CL/CLTunerTypes.h"
SiCong Lidb4a6c12021-02-05 09:30:57 +000036#include "arm_compute/runtime/CL/CLTypes.h"
ramelg013ae3d882021-09-12 23:07:47 +010037#include "arm_compute/runtime/FunctionDescriptors.h"
Matthew Bentham758b5ba2020-03-05 23:37:48 +000038#include "support/StringSupport.h"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010039
40#include <ostream>
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010041#include <sstream>
42#include <string>
Anthony Barbier6ff3b192017-09-04 18:44:23 +010043
44namespace arm_compute
45{
Anthony Barbierb940fd62018-06-04 14:14:32 +010046/** Formatted output if arg is not null
47 *
48 * @param[in] arg Object to print
49 *
50 * @return String representing arg.
51 */
52template <typename T>
53std::string to_string_if_not_null(T *arg)
54{
55 if(arg == nullptr)
56 {
57 return "nullptr";
58 }
59 else
60 {
61 return to_string(*arg);
62 }
63}
Anthony Barbierb4670212018-05-18 16:55:39 +010064
Alex Gildayc357c472018-03-21 13:54:09 +000065/** Formatted output of the Dimensions type.
66 *
67 * @param[out] os Output stream.
68 * @param[in] dimensions Type to output.
69 *
70 * @return Modified output stream.
71 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010072template <typename T>
73inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
74{
Anthony Barbier6ff3b192017-09-04 18:44:23 +010075 if(dimensions.num_dimensions() > 0)
76 {
77 os << dimensions[0];
78
79 for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
80 {
Freddie Liardetdd23f2a2021-06-17 13:30:11 +010081 os << "," << dimensions[d];
Anthony Barbier6ff3b192017-09-04 18:44:23 +010082 }
83 }
84
Anthony Barbier6ff3b192017-09-04 18:44:23 +010085 return os;
86}
87
Alex Gildayc357c472018-03-21 13:54:09 +000088/** Formatted output of the RoundingPolicy type.
89 *
90 * @param[out] os Output stream.
91 * @param[in] rounding_policy Type to output.
92 *
93 * @return Modified output stream.
94 */
Anthony Barbier2a07e182017-08-04 18:20:27 +010095inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy)
Anthony Barbier6ff3b192017-09-04 18:44:23 +010096{
Anthony Barbier2a07e182017-08-04 18:20:27 +010097 switch(rounding_policy)
Anthony Barbier6ff3b192017-09-04 18:44:23 +010098 {
Anthony Barbier2a07e182017-08-04 18:20:27 +010099 case RoundingPolicy::TO_ZERO:
100 os << "TO_ZERO";
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100101 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +0100102 case RoundingPolicy::TO_NEAREST_UP:
103 os << "TO_NEAREST_UP";
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100104 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +0100105 case RoundingPolicy::TO_NEAREST_EVEN:
106 os << "TO_NEAREST_EVEN";
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100107 break;
108 default:
109 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
110 }
111
112 return os;
113}
114
Alex Gildayc357c472018-03-21 13:54:09 +0000115/** Formatted output of the WeightsInfo type.
116 *
117 * @param[out] os Output stream.
118 * @param[in] weights_info Type to output.
119 *
120 * @return Modified output stream.
121 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100122inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info)
Isabella Gottardi1fab09f2017-07-13 15:55:57 +0100123{
Anthony Barbier2a07e182017-08-04 18:20:27 +0100124 os << weights_info.are_reshaped() << ";";
125 os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100126
127 return os;
128}
129
Alex Gildayc357c472018-03-21 13:54:09 +0000130/** Formatted output of the ROIPoolingInfo type.
131 *
132 * @param[out] os Output stream.
133 * @param[in] pool_info Type to output.
134 *
135 * @return Modified output stream.
136 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100137inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
Sanghoon Lee70f82912017-08-24 14:21:24 +0100138{
Anthony Barbier2a07e182017-08-04 18:20:27 +0100139 os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
Georgios Pinitasd9769582017-08-03 10:19:40 +0100140 return os;
141}
142
giuros0118870812018-09-13 09:31:40 +0100143/** Formatted output of the ROIPoolingInfo type.
144 *
145 * @param[in] pool_info Type to output.
146 *
147 * @return Formatted string.
148 */
149inline std::string to_string(const ROIPoolingLayerInfo &pool_info)
150{
151 std::stringstream str;
152 str << pool_info;
153 return str.str();
154}
155
morgolockaba2f912020-05-05 16:28:19 +0100156/** Formatted output of the GEMMKernelInfo type.
157 *
158 * @param[out] os Output stream.
159 * @param[in] gemm_info Type to output.
160 *
161 * @return Modified output stream.
162 */
163inline ::std::ostream &operator<<(::std::ostream &os, const GEMMKernelInfo &gemm_info)
164{
165 os << "( m= " << gemm_info.m;
166 os << " n= " << gemm_info.n;
167 os << " k= " << gemm_info.k;
168 os << " depth_output_gemm3d= " << gemm_info.depth_output_gemm3d;
169 os << " reinterpret_input_as_3d= " << gemm_info.reinterpret_input_as_3d;
170 os << " broadcast_bias= " << gemm_info.broadcast_bias;
171 os << " fp_mixed_precision= " << gemm_info.fp_mixed_precision;
172 os << " mult_transpose1xW_width= " << gemm_info.mult_transpose1xW_width;
173 os << " mult_interleave4x4_height= " << gemm_info.mult_interleave4x4_height;
174 os << " a_offset = " << gemm_info.a_offset;
175 os << " b_offset = " << gemm_info.b_offset;
176 os << ")";
177 return os;
178}
179
180/** Formatted output of the GEMMLHSMatrixInfo type.
181 *
182 * @param[out] os Output stream.
183 * @param[in] gemm_info Type to output.
184 *
185 * @return Modified output stream.
186 */
187inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLHSMatrixInfo &gemm_info)
188{
189 os << "( m0= " << (unsigned int)gemm_info.m0 << " k0= " << gemm_info.k0 << " v0= " << gemm_info.v0 << " trans= " << gemm_info.transpose << " inter= " << gemm_info.interleave << "})";
190 return os;
191}
192
193/** Formatted output of the GEMMRHSMatrixInfo type.
194 *
195 * @param[out] os Output stream.
196 * @param[in] gemm_info Type to output.
197 *
198 * @return Modified output stream.
199 */
200inline ::std::ostream &operator<<(::std::ostream &os, const GEMMRHSMatrixInfo &gemm_info)
201{
SiCong Lidb4a6c12021-02-05 09:30:57 +0000202 os << "( n0= " << (unsigned int)gemm_info.n0 << " k0= " << gemm_info.k0 << " h0= " << gemm_info.h0 << " trans= " << gemm_info.transpose << " inter= " << gemm_info.interleave << " exp_img=" <<
203 gemm_info.export_to_cl_image << "})";
morgolockaba2f912020-05-05 16:28:19 +0100204 return os;
205}
206
207/** Formatted output of the GEMMRHSMatrixInfo type.
208 *
209 * @param[in] gemm_info GEMMRHSMatrixInfo to output.
210 *
211 * @return Formatted string.
212 */
213inline std::string to_string(const GEMMRHSMatrixInfo &gemm_info)
214{
215 std::stringstream str;
216 str << gemm_info;
217 return str.str();
218}
219
220/** Formatted output of the GEMMLHSMatrixInfo type.
221 *
222 * @param[in] gemm_info GEMMLHSMatrixInfo to output.
223 *
224 * @return Formatted string.
225 */
226inline std::string to_string(const GEMMLHSMatrixInfo &gemm_info)
227{
228 std::stringstream str;
229 str << gemm_info;
230 return str.str();
231}
232
233/** Formatted output of the GEMMKernelInfo type.
234 *
235 * @param[in] gemm_info GEMMKernelInfo Type to output.
236 *
237 * @return Formatted string.
238 */
239inline std::string to_string(const GEMMKernelInfo &gemm_info)
240{
241 std::stringstream str;
242 str << gemm_info;
243 return str.str();
244}
245
giuros01c04a0e82018-10-03 12:44:35 +0100246/** Formatted output of the BoundingBoxTransformInfo type.
247 *
248 * @param[out] os Output stream.
249 * @param[in] bbox_info Type to output.
250 *
251 * @return Modified output stream.
252 */
253inline ::std::ostream &operator<<(::std::ostream &os, const BoundingBoxTransformInfo &bbox_info)
254{
255 auto weights = bbox_info.weights();
256 os << "(" << bbox_info.img_width() << "x" << bbox_info.img_height() << ")~" << bbox_info.scale() << "(weights = {" << weights[0] << ", " << weights[1] << ", " << weights[2] << ", " << weights[3] <<
257 "})";
258 return os;
259}
260
261/** Formatted output of the BoundingBoxTransformInfo type.
262 *
263 * @param[in] bbox_info Type to output.
264 *
265 * @return Formatted string.
266 */
267inline std::string to_string(const BoundingBoxTransformInfo &bbox_info)
268{
269 std::stringstream str;
270 str << bbox_info;
271 return str.str();
272}
273
Manuel Bottini5209be52019-02-13 16:34:56 +0000274/** Formatted output of the ComputeAnchorsInfo type.
275 *
276 * @param[out] os Output stream.
277 * @param[in] anchors_info Type to output.
278 *
279 * @return Modified output stream.
280 */
281inline ::std::ostream &operator<<(::std::ostream &os, const ComputeAnchorsInfo &anchors_info)
282{
283 os << "(" << anchors_info.feat_width() << "x" << anchors_info.feat_height() << ")~" << anchors_info.spatial_scale();
284 return os;
285}
286
287/** Formatted output of the ComputeAnchorsInfo type.
288 *
289 * @param[in] anchors_info Type to output.
290 *
291 * @return Formatted string.
292 */
293inline std::string to_string(const ComputeAnchorsInfo &anchors_info)
294{
295 std::stringstream str;
296 str << anchors_info;
297 return str.str();
298}
299
300/** Formatted output of the GenerateProposalsInfo type.
301 *
302 * @param[out] os Output stream.
303 * @param[in] proposals_info Type to output.
304 *
305 * @return Modified output stream.
306 */
307inline ::std::ostream &operator<<(::std::ostream &os, const GenerateProposalsInfo &proposals_info)
308{
309 os << "(" << proposals_info.im_width() << "x" << proposals_info.im_height() << ")~" << proposals_info.im_scale();
310 return os;
311}
312
313/** Formatted output of the GenerateProposalsInfo type.
314 *
315 * @param[in] proposals_info Type to output.
316 *
317 * @return Formatted string.
318 */
319inline std::string to_string(const GenerateProposalsInfo &proposals_info)
320{
321 std::stringstream str;
322 str << proposals_info;
323 return str.str();
324}
325
Alex Gildayc357c472018-03-21 13:54:09 +0000326/** Formatted output of the QuantizationInfo type.
327 *
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100328 * @param[out] os Output stream.
329 * @param[in] qinfo Type to output.
Alex Gildayc357c472018-03-21 13:54:09 +0000330 *
331 * @return Modified output stream.
332 */
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100333inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &qinfo)
Chunosovd621bca2017-11-03 17:33:15 +0700334{
Georgios Pinitas3d13af82019-06-04 13:04:16 +0100335 const UniformQuantizationInfo uqinfo = qinfo.uniform();
336 os << "Scale:" << uqinfo.scale << "~";
337 os << "Offset:" << uqinfo.offset;
Chunosovd621bca2017-11-03 17:33:15 +0700338 return os;
339}
340
Alex Gildayc357c472018-03-21 13:54:09 +0000341/** Formatted output of the QuantizationInfo type.
342 *
343 * @param[in] quantization_info Type to output.
344 *
345 * @return Formatted string.
346 */
Chunosovd621bca2017-11-03 17:33:15 +0700347inline std::string to_string(const QuantizationInfo &quantization_info)
348{
349 std::stringstream str;
350 str << quantization_info;
351 return str.str();
352}
353
Alex Gildayc357c472018-03-21 13:54:09 +0000354/** Formatted output of the activation function type.
355 *
356 * @param[out] os Output stream.
357 * @param[in] act_function Type to output.
358 *
359 * @return Modified output stream.
360 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100361inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
362{
363 switch(act_function)
364 {
365 case ActivationLayerInfo::ActivationFunction::ABS:
366 os << "ABS";
367 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100368 case ActivationLayerInfo::ActivationFunction::LINEAR:
369 os << "LINEAR";
370 break;
371 case ActivationLayerInfo::ActivationFunction::LOGISTIC:
372 os << "LOGISTIC";
373 break;
374 case ActivationLayerInfo::ActivationFunction::RELU:
375 os << "RELU";
376 break;
Georgios Pinitas579c0492017-07-12 16:12:12 +0100377 case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
378 os << "BOUNDED_RELU";
379 break;
380 case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
381 os << "LEAKY_RELU";
382 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100383 case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
384 os << "SOFT_RELU";
385 break;
386 case ActivationLayerInfo::ActivationFunction::SQRT:
387 os << "SQRT";
388 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +0100389 case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU:
390 os << "LU_BOUNDED_RELU";
Kevin Petitd9f80712017-12-06 12:18:48 +0000391 break;
Georgios Pinitasfb0fdcd2019-08-22 17:10:04 +0100392 case ActivationLayerInfo::ActivationFunction::ELU:
393 os << "ELU";
394 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100395 case ActivationLayerInfo::ActivationFunction::SQUARE:
396 os << "SQUARE";
397 break;
398 case ActivationLayerInfo::ActivationFunction::TANH:
399 os << "TANH";
400 break;
Usama Arif6a98a6e2019-05-10 17:07:27 +0100401 case ActivationLayerInfo::ActivationFunction::IDENTITY:
402 os << "IDENTITY";
403 break;
morgolock07df3d42020-02-27 11:46:28 +0000404 case ActivationLayerInfo::ActivationFunction::HARD_SWISH:
405 os << "HARD_SWISH";
406 break;
407
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100408 default:
409 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
410 }
411
412 return os;
413}
414
Alex Gildayc357c472018-03-21 13:54:09 +0000415/** Formatted output of the activation function info type.
416 *
417 * @param[in] info Type to output.
418 *
419 * @return Formatted string.
420 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100421inline std::string to_string(const arm_compute::ActivationLayerInfo &info)
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100422{
423 std::stringstream str;
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000424 if(info.enabled())
425 {
426 str << info.activation();
427 }
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100428 return str.str();
429}
430
ramelg013ae3d882021-09-12 23:07:47 +0100431/** Formatted output of the activation function info type.
432 *
433 * @param[in] info Type to output.
434 *
435 * @return Formatted string.
436 */
437inline std::string to_string(const arm_compute::ActivationLayerInfo *info)
438{
439 std::string ret_str = "nullptr";
440 if(info != nullptr)
441 {
442 std::stringstream str;
443 if(info->enabled())
444 {
445 str << info->activation();
446 }
447 ret_str = str.str();
448 }
449 return ret_str;
450}
451
Alex Gildayc357c472018-03-21 13:54:09 +0000452/** Formatted output of the activation function type.
453 *
454 * @param[in] function Type to output.
455 *
456 * @return Formatted string.
457 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100458inline std::string to_string(const arm_compute::ActivationLayerInfo::ActivationFunction &function)
459{
460 std::stringstream str;
461 str << function;
462 return str.str();
463}
464
Alex Gildayc357c472018-03-21 13:54:09 +0000465/** Formatted output of the NormType type.
466 *
467 * @param[out] os Output stream.
468 * @param[in] norm_type Type to output.
469 *
470 * @return Modified output stream.
471 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100472inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type)
473{
474 switch(norm_type)
475 {
476 case NormType::CROSS_MAP:
477 os << "CROSS_MAP";
478 break;
479 case NormType::IN_MAP_1D:
480 os << "IN_MAP_1D";
481 break;
482 case NormType::IN_MAP_2D:
483 os << "IN_MAP_2D";
484 break;
485 default:
486 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
487 }
488
489 return os;
490}
491
Alex Gildayc357c472018-03-21 13:54:09 +0000492/** Formatted output of @ref NormalizationLayerInfo.
493 *
494 * @param[in] info Type to output.
495 *
496 * @return Formatted string.
497 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100498inline std::string to_string(const arm_compute::NormalizationLayerInfo &info)
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100499{
500 std::stringstream str;
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000501 str << info.type() << ":NormSize=" << info.norm_size();
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100502 return str.str();
503}
504
Alex Gildayc357c472018-03-21 13:54:09 +0000505/** Formatted output of @ref NormalizationLayerInfo.
506 *
507 * @param[out] os Output stream.
508 * @param[in] info Type to output.
509 *
510 * @return Modified output stream.
511 */
Georgios Pinitas6f669f02017-09-26 12:32:57 +0100512inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info)
513{
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000514 os << info.type() << ":NormSize=" << info.norm_size();
Georgios Pinitas6f669f02017-09-26 12:32:57 +0100515 return os;
516}
517
Alex Gildayc357c472018-03-21 13:54:09 +0000518/** Formatted output of the PoolingType type.
519 *
520 * @param[out] os Output stream.
521 * @param[in] pool_type Type to output.
522 *
523 * @return Modified output stream.
524 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100525inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type)
526{
527 switch(pool_type)
528 {
529 case PoolingType::AVG:
530 os << "AVG";
531 break;
532 case PoolingType::MAX:
533 os << "MAX";
534 break;
Georgios Pinitascdf51452017-08-31 14:21:36 +0100535 case PoolingType::L2:
536 os << "L2";
537 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100538 default:
539 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
540 }
541
542 return os;
543}
544
Alex Gildayc357c472018-03-21 13:54:09 +0000545/** Formatted output of @ref PoolingLayerInfo.
546 *
547 * @param[out] os Output stream.
548 * @param[in] info Type to output.
549 *
550 * @return Modified output stream.
551 */
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100552inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info)
553{
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +0000554 os << info.pool_type;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100555
556 return os;
557}
558
Alex Gildayc357c472018-03-21 13:54:09 +0000559/** Formatted output of @ref RoundingPolicy.
560 *
561 * @param[in] rounding_policy Type to output.
562 *
563 * @return Formatted string.
564 */
John Richardsondd715f22017-09-18 16:10:48 +0100565inline std::string to_string(const RoundingPolicy &rounding_policy)
566{
567 std::stringstream str;
568 str << rounding_policy;
569 return str.str();
570}
571
Vidhya Sudhan Loganathand646ae12018-11-19 15:18:20 +0000572/** [Print DataLayout type] **/
Alex Gildayc357c472018-03-21 13:54:09 +0000573/** Formatted output of the DataLayout type.
574 *
575 * @param[out] os Output stream.
576 * @param[in] data_layout Type to output.
577 *
578 * @return Modified output stream.
579 */
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000580inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout)
581{
582 switch(data_layout)
583 {
584 case DataLayout::UNKNOWN:
585 os << "UNKNOWN";
586 break;
587 case DataLayout::NHWC:
588 os << "NHWC";
589 break;
590 case DataLayout::NCHW:
591 os << "NCHW";
592 break;
Adnan AlSinane4563a02021-09-01 15:32:03 +0100593 case DataLayout::NDHWC:
594 os << "NDHWC";
595 break;
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000596 default:
597 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
598 }
599
600 return os;
601}
602
Alex Gildayc357c472018-03-21 13:54:09 +0000603/** Formatted output of the DataLayout type.
604 *
605 * @param[in] data_layout Type to output.
606 *
607 * @return Formatted string.
608 */
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000609inline std::string to_string(const arm_compute::DataLayout &data_layout)
610{
611 std::stringstream str;
612 str << data_layout;
613 return str.str();
614}
Vidhya Sudhan Loganathand646ae12018-11-19 15:18:20 +0000615/** [Print DataLayout type] **/
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000616
Georgios Pinitase2220552018-07-20 13:23:44 +0100617/** Formatted output of the DataLayoutDimension type.
618 *
619 * @param[out] os Output stream.
620 * @param[in] data_layout_dim Data layout dimension to print.
621 *
622 * @return Modified output stream.
623 */
624inline ::std::ostream &operator<<(::std::ostream &os, const DataLayoutDimension &data_layout_dim)
625{
626 switch(data_layout_dim)
627 {
628 case DataLayoutDimension::WIDTH:
629 os << "WIDTH";
630 break;
631 case DataLayoutDimension::HEIGHT:
632 os << "HEIGHT";
633 break;
634 case DataLayoutDimension::CHANNEL:
635 os << "CHANNEL";
636 break;
637 case DataLayoutDimension::BATCHES:
638 os << "BATCHES";
639 break;
640 default:
641 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
642 }
643 return os;
644}
645
Alex Gildayc357c472018-03-21 13:54:09 +0000646/** Formatted output of the DataType type.
647 *
648 * @param[out] os Output stream.
649 * @param[in] data_type Type to output.
650 *
651 * @return Modified output stream.
652 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100653inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
654{
655 switch(data_type)
656 {
657 case DataType::UNKNOWN:
658 os << "UNKNOWN";
659 break;
660 case DataType::U8:
661 os << "U8";
662 break;
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100663 case DataType::QSYMM8:
664 os << "QSYMM8";
665 break;
Chunosovd621bca2017-11-03 17:33:15 +0700666 case DataType::QASYMM8:
667 os << "QASYMM8";
668 break;
Georgios Pinitas448a81f2019-11-21 14:10:25 +0000669 case DataType::QASYMM8_SIGNED:
670 os << "QASYMM8_SIGNED";
671 break;
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100672 case DataType::QSYMM8_PER_CHANNEL:
673 os << "QSYMM8_PER_CHANNEL";
674 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100675 case DataType::S8:
676 os << "S8";
677 break;
678 case DataType::U16:
679 os << "U16";
680 break;
681 case DataType::S16:
682 os << "S16";
683 break;
Manuel Bottini3689fcd2019-06-14 17:18:12 +0100684 case DataType::QSYMM16:
685 os << "QSYMM16";
686 break;
Michele Di Giorgio35ea9a72019-08-23 12:02:06 +0100687 case DataType::QASYMM16:
688 os << "QASYMM16";
689 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100690 case DataType::U32:
691 os << "U32";
692 break;
693 case DataType::S32:
694 os << "S32";
695 break;
696 case DataType::U64:
697 os << "U64";
698 break;
699 case DataType::S64:
700 os << "S64";
701 break;
Georgios Pinitase8291ac2020-02-26 09:58:13 +0000702 case DataType::BFLOAT16:
703 os << "BFLOAT16";
704 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100705 case DataType::F16:
706 os << "F16";
707 break;
708 case DataType::F32:
709 os << "F32";
710 break;
711 case DataType::F64:
712 os << "F64";
713 break;
714 case DataType::SIZET:
715 os << "SIZET";
716 break;
717 default:
718 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
719 }
720
721 return os;
722}
723
Alex Gildayc357c472018-03-21 13:54:09 +0000724/** Formatted output of the DataType type.
725 *
726 * @param[in] data_type Type to output.
727 *
728 * @return Formatted string.
729 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100730inline std::string to_string(const arm_compute::DataType &data_type)
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100731{
732 std::stringstream str;
733 str << data_type;
734 return str.str();
735}
736
Alex Gildayc357c472018-03-21 13:54:09 +0000737/** Formatted output of the Format type.
738 *
739 * @param[out] os Output stream.
740 * @param[in] format Type to output.
741 *
742 * @return Modified output stream.
743 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100744inline ::std::ostream &operator<<(::std::ostream &os, const Format &format)
745{
746 switch(format)
747 {
748 case Format::UNKNOWN:
749 os << "UNKNOWN";
750 break;
751 case Format::U8:
752 os << "U8";
753 break;
754 case Format::S16:
755 os << "S16";
756 break;
757 case Format::U16:
758 os << "U16";
759 break;
760 case Format::S32:
761 os << "S32";
762 break;
763 case Format::U32:
764 os << "U32";
765 break;
766 case Format::F16:
767 os << "F16";
768 break;
769 case Format::F32:
770 os << "F32";
771 break;
772 case Format::UV88:
773 os << "UV88";
774 break;
775 case Format::RGB888:
776 os << "RGB888";
777 break;
778 case Format::RGBA8888:
779 os << "RGBA8888";
780 break;
781 case Format::YUV444:
782 os << "YUV444";
783 break;
784 case Format::YUYV422:
785 os << "YUYV422";
786 break;
787 case Format::NV12:
788 os << "NV12";
789 break;
790 case Format::NV21:
791 os << "NV21";
792 break;
793 case Format::IYUV:
794 os << "IYUV";
795 break;
796 case Format::UYVY422:
797 os << "UYVY422";
798 break;
799 default:
800 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
801 }
802
803 return os;
804}
805
Alex Gildayc357c472018-03-21 13:54:09 +0000806/** Formatted output of the Format type.
807 *
808 * @param[in] format Type to output.
809 *
810 * @return Formatted string.
811 */
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100812inline std::string to_string(const Format &format)
813{
814 std::stringstream str;
815 str << format;
816 return str.str();
817}
818
Alex Gildayc357c472018-03-21 13:54:09 +0000819/** Formatted output of the Channel type.
820 *
821 * @param[out] os Output stream.
822 * @param[in] channel Type to output.
823 *
824 * @return Modified output stream.
825 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100826inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel)
827{
828 switch(channel)
829 {
830 case Channel::UNKNOWN:
831 os << "UNKNOWN";
832 break;
833 case Channel::C0:
834 os << "C0";
835 break;
836 case Channel::C1:
837 os << "C1";
838 break;
839 case Channel::C2:
840 os << "C2";
841 break;
842 case Channel::C3:
843 os << "C3";
844 break;
845 case Channel::R:
846 os << "R";
847 break;
848 case Channel::G:
849 os << "G";
850 break;
851 case Channel::B:
852 os << "B";
853 break;
854 case Channel::A:
855 os << "A";
856 break;
857 case Channel::Y:
858 os << "Y";
859 break;
860 case Channel::U:
861 os << "U";
862 break;
863 case Channel::V:
864 os << "V";
865 break;
866 default:
867 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
868 }
869
870 return os;
871}
872
Alex Gildayc357c472018-03-21 13:54:09 +0000873/** Formatted output of the Channel type.
874 *
875 * @param[in] channel Type to output.
876 *
877 * @return Formatted string.
878 */
Ioan-Cristian Szabo9414f642017-10-27 17:35:40 +0100879inline std::string to_string(const Channel &channel)
880{
881 std::stringstream str;
882 str << channel;
883 return str.str();
884}
885
Alex Gildayc357c472018-03-21 13:54:09 +0000886/** Formatted output of the BorderMode type.
887 *
888 * @param[out] os Output stream.
889 * @param[in] mode Type to output.
890 *
891 * @return Modified output stream.
892 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100893inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode)
894{
895 switch(mode)
896 {
897 case BorderMode::UNDEFINED:
898 os << "UNDEFINED";
899 break;
900 case BorderMode::CONSTANT:
901 os << "CONSTANT";
902 break;
903 case BorderMode::REPLICATE:
904 os << "REPLICATE";
905 break;
906 default:
907 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
908 }
909
910 return os;
911}
912
Alex Gildayc357c472018-03-21 13:54:09 +0000913/** Formatted output of the BorderSize type.
914 *
915 * @param[out] os Output stream.
916 * @param[in] border Type to output.
917 *
918 * @return Modified output stream.
919 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100920inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border)
921{
Moritz Pflanzerc87fbf82017-07-18 14:02:10 +0100922 os << border.top << ","
923 << border.right << ","
924 << border.bottom << ","
925 << border.left;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100926
927 return os;
928}
Anthony Barbier2a07e182017-08-04 18:20:27 +0100929
Giuseppe Rossinid7647d42018-07-17 18:13:13 +0100930/** Formatted output of the PaddingList type.
931 *
932 * @param[out] os Output stream.
933 * @param[in] padding Type to output.
934 *
935 * @return Modified output stream.
936 */
937inline ::std::ostream &operator<<(::std::ostream &os, const PaddingList &padding)
938{
939 os << "{";
940 for(auto const &p : padding)
941 {
942 os << "{" << p.first << "," << p.second << "}";
943 }
944 os << "}";
945 return os;
946}
947
giuros013175fcf2018-11-21 09:59:17 +0000948/** Formatted output of the Multiples type.
949 *
950 * @param[out] os Output stream.
951 * @param[in] multiples Type to output.
952 *
953 * @return Modified output stream.
954 */
955inline ::std::ostream &operator<<(::std::ostream &os, const Multiples &multiples)
956{
957 os << "(";
958 for(size_t i = 0; i < multiples.size() - 1; i++)
959 {
960 os << multiples[i] << ", ";
961 }
962 os << multiples.back() << ")";
963 return os;
964}
965
Alex Gildayc357c472018-03-21 13:54:09 +0000966/** Formatted output of the InterpolationPolicy type.
967 *
968 * @param[out] os Output stream.
969 * @param[in] policy Type to output.
970 *
971 * @return Modified output stream.
972 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100973inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy)
974{
975 switch(policy)
976 {
977 case InterpolationPolicy::NEAREST_NEIGHBOR:
978 os << "NEAREST_NEIGHBOR";
979 break;
980 case InterpolationPolicy::BILINEAR:
981 os << "BILINEAR";
982 break;
983 case InterpolationPolicy::AREA:
984 os << "AREA";
985 break;
986 default:
987 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
988 }
989
990 return os;
991}
992
Alex Gildayc357c472018-03-21 13:54:09 +0000993/** Formatted output of the SamplingPolicy type.
994 *
995 * @param[out] os Output stream.
996 * @param[in] policy Type to output.
997 *
998 * @return Modified output stream.
999 */
Daniil Efremov02bf80d2017-11-22 00:26:51 +07001000inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy)
1001{
1002 switch(policy)
1003 {
1004 case SamplingPolicy::CENTER:
1005 os << "CENTER";
1006 break;
1007 case SamplingPolicy::TOP_LEFT:
1008 os << "TOP_LEFT";
1009 break;
1010 default:
1011 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1012 }
1013
1014 return os;
1015}
1016
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001017/** Formatted output of the ITensorInfo type.
1018 *
1019 * @param[out] os Output stream.
1020 * @param[in] info Tensor information.
1021 *
1022 * @return Modified output stream.
1023 */
1024inline ::std::ostream &operator<<(std::ostream &os, const ITensorInfo *info)
1025{
Georgios Pinitasc6f95102021-03-30 10:03:01 +01001026 const DataType data_type = info->data_type();
1027 const DataLayout data_layout = info->data_layout();
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001028
1029 os << "Shape=" << info->tensor_shape() << ","
1030 << "DataLayout=" << string_from_data_layout(data_layout) << ","
1031 << "DataType=" << string_from_data_type(data_type) << ",";
1032
1033 if(is_data_type_quantized(data_type))
1034 {
1035 const QuantizationInfo qinfo = info->quantization_info();
1036 os << "QuantizationInfo=";
1037 if(is_data_type_quantized_per_channel(data_type))
1038 {
1039 os << "[";
1040 const auto scales = qinfo.scale();
1041 const auto offsets = qinfo.offset();
1042 os << "(" << scales[0] << ", " << offsets[0] << ")";
1043 for(size_t i = 1; i < scales.size(); ++i)
1044 {
1045 os << ",(" << scales[i] << ", " << offsets[i] << ")";
1046 }
1047 os << "]";
1048 }
1049 else
1050 {
1051 os << "(" << qinfo.uniform().scale << ", "
Georgios Pinitasc6f95102021-03-30 10:03:01 +01001052 << qinfo.uniform().offset << ")";
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001053 }
1054 }
1055 return os;
1056}
1057
ramelg013ae3d882021-09-12 23:07:47 +01001058/** Formatted output of the const TensorInfo& type.
Alex Gildayc357c472018-03-21 13:54:09 +00001059 *
Anthony Barbier366628a2018-08-01 13:55:03 +01001060 * @param[out] os Output stream.
1061 * @param[in] info Type to output.
1062 *
1063 * @return Modified output stream.
1064 */
1065inline ::std::ostream &operator<<(::std::ostream &os, const TensorInfo &info)
1066{
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001067 os << &info;
Georgios Pinitasc6f95102021-03-30 10:03:01 +01001068 return os;
Anthony Barbier366628a2018-08-01 13:55:03 +01001069}
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001070
ramelg013ae3d882021-09-12 23:07:47 +01001071/** Formatted output of the const TensorInfo& type.
Anthony Barbier366628a2018-08-01 13:55:03 +01001072 *
Alex Gildayc357c472018-03-21 13:54:09 +00001073 * @param[in] info Type to output.
1074 *
1075 * @return Formatted string.
1076 */
Georgios Pinitas3faea252017-10-30 14:13:50 +00001077inline std::string to_string(const TensorInfo &info)
1078{
1079 std::stringstream str;
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001080 str << &info;
Georgios Pinitas3faea252017-10-30 14:13:50 +00001081 return str.str();
1082}
1083
ramelg013ae3d882021-09-12 23:07:47 +01001084/** Formatted output of the const ITensorInfo& type.
1085 *
1086 * @param[in] info Type to output.
1087 *
1088 * @return Formatted string.
1089 */
1090inline std::string to_string(const ITensorInfo &info)
1091{
1092 std::stringstream str;
1093 str << &info;
1094 return str.str();
1095}
1096
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001097/** Formatted output of the ITensorInfo* type.
1098 *
1099 * @param[in] info Type to output.
1100 *
1101 * @return Formatted string.
1102 */
ramelg013ae3d882021-09-12 23:07:47 +01001103inline std::string to_string(ITensorInfo *info)
1104{
1105 std::string ret_str = "nullptr";
1106 if(info != nullptr)
1107 {
1108 std::stringstream str;
1109 str << info;
1110 ret_str = str.str();
1111 }
1112 return ret_str;
1113}
1114
1115/** Formatted output of the const ITensorInfo* type.
1116 *
1117 * @param[in] info Type to output.
1118 *
1119 * @return Formatted string.
1120 */
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001121inline std::string to_string(const ITensorInfo *info)
1122{
ramelg013ae3d882021-09-12 23:07:47 +01001123 std::string ret_str = "nullptr";
1124 if(info != nullptr)
1125 {
1126 std::stringstream str;
1127 str << info;
1128 ret_str = str.str();
1129 }
1130 return ret_str;
1131}
1132
1133/** Formatted output of the const ITensor* type.
1134 *
1135 * @param[in] tensor Type to output.
1136 *
1137 * @return Formatted string.
1138 */
1139inline std::string to_string(const ITensor *tensor)
1140{
1141 std::string ret_str = "nullptr";
1142 if(tensor != nullptr)
1143 {
1144 std::stringstream str;
1145 str << tensor->info();
1146 ret_str = str.str();
1147 }
1148 return ret_str;
1149}
1150
1151/** Formatted output of the ITensor* type.
1152 *
1153 * @param[in] tensor Type to output.
1154 *
1155 * @return Formatted string.
1156 */
1157inline std::string to_string(ITensor *tensor)
1158{
1159 std::string ret_str = "nullptr";
1160 if(tensor != nullptr)
1161 {
1162 std::stringstream str;
1163 str << tensor->info();
1164 ret_str = str.str();
1165 }
1166 return ret_str;
1167}
1168
1169/** Formatted output of the ITensor& type.
1170 *
1171 * @param[in] tensor Type to output.
1172 *
1173 * @return Formatted string.
1174 */
1175inline std::string to_string(ITensor &tensor)
1176{
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001177 std::stringstream str;
ramelg013ae3d882021-09-12 23:07:47 +01001178 str << tensor.info();
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001179 return str.str();
1180}
1181
Alex Gildayc357c472018-03-21 13:54:09 +00001182/** Formatted output of the Dimensions type.
1183 *
1184 * @param[in] dimensions Type to output.
1185 *
1186 * @return Formatted string.
1187 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001188template <typename T>
1189inline std::string to_string(const Dimensions<T> &dimensions)
1190{
1191 std::stringstream str;
1192 str << dimensions;
1193 return str.str();
1194}
1195
Alex Gildayc357c472018-03-21 13:54:09 +00001196/** Formatted output of the Strides type.
1197 *
1198 * @param[in] stride Type to output.
1199 *
1200 * @return Formatted string.
1201 */
John Richardsona36eae12017-09-26 16:55:59 +01001202inline std::string to_string(const Strides &stride)
1203{
1204 std::stringstream str;
1205 str << stride;
1206 return str.str();
1207}
1208
Alex Gildayc357c472018-03-21 13:54:09 +00001209/** Formatted output of the TensorShape type.
1210 *
1211 * @param[in] shape Type to output.
1212 *
1213 * @return Formatted string.
1214 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001215inline std::string to_string(const TensorShape &shape)
1216{
1217 std::stringstream str;
1218 str << shape;
1219 return str.str();
1220}
1221
Alex Gildayc357c472018-03-21 13:54:09 +00001222/** Formatted output of the Coordinates type.
1223 *
1224 * @param[in] coord Type to output.
1225 *
1226 * @return Formatted string.
1227 */
Abe Mbise925ca0f2017-10-02 19:16:33 +01001228inline std::string to_string(const Coordinates &coord)
1229{
1230 std::stringstream str;
1231 str << coord;
1232 return str.str();
1233}
1234
Anthony Barbierb940fd62018-06-04 14:14:32 +01001235/** Formatted output of the GEMMReshapeInfo type.
1236 *
1237 * @param[out] os Output stream.
1238 * @param[in] info Type to output.
1239 *
1240 * @return Modified output stream.
1241 */
1242inline ::std::ostream &operator<<(::std::ostream &os, const GEMMReshapeInfo &info)
1243{
1244 os << "{m=" << info.m() << ",";
1245 os << "n=" << info.n() << ",";
1246 os << "k=" << info.k() << ",";
1247 os << "mult_transpose1xW_width=" << info.mult_transpose1xW_width() << ",";
1248 os << "mult_interleave4x4_height=" << info.mult_interleave4x4_height();
1249 os << "}";
1250
1251 return os;
1252}
1253
1254/** Formatted output of the GEMMInfo type.
1255 *
1256 * @param[out] os Output stream.
1257 * @param[in] info Type to output.
1258 *
1259 * @return Modified output stream.
1260 */
1261inline ::std::ostream &operator<<(::std::ostream &os, const GEMMInfo &info)
1262{
1263 os << "{is_a_reshaped=" << info.is_a_reshaped() << ",";
1264 os << "is_b_reshaped=" << info.is_b_reshaped() << ",";
1265 os << "reshape_b_only_on_first_run=" << info.reshape_b_only_on_first_run() << ",";
Anthony Barbierb4670212018-05-18 16:55:39 +01001266 os << "depth_output_gemm3d=" << info.depth_output_gemm3d() << ",";
1267 os << "reinterpret_input_as_3d=" << info.reinterpret_input_as_3d() << ",";
1268 os << "retain_internal_weights=" << info.retain_internal_weights() << ",";
1269 os << "fp_mixed_precision=" << info.fp_mixed_precision() << ",";
1270 os << "broadcast_bias=" << info.broadcast_bias() << ",";
Pablo Marquez Tello9ac7b992021-09-15 10:14:20 +01001271 os << "pretranpose_B=" << info.pretranpose_B() << ",";
Anthony Barbierb940fd62018-06-04 14:14:32 +01001272
1273 return os;
1274}
1275
1276/** Formatted output of the Window::Dimension type.
1277 *
1278 * @param[out] os Output stream.
1279 * @param[in] dim Type to output.
1280 *
1281 * @return Modified output stream.
1282 */
1283inline ::std::ostream &operator<<(::std::ostream &os, const Window::Dimension &dim)
1284{
1285 os << "{start=" << dim.start() << ", end=" << dim.end() << ", step=" << dim.step() << "}";
1286
1287 return os;
1288}
1289/** Formatted output of the Window type.
1290 *
1291 * @param[out] os Output stream.
1292 * @param[in] win Type to output.
1293 *
1294 * @return Modified output stream.
1295 */
1296inline ::std::ostream &operator<<(::std::ostream &os, const Window &win)
1297{
1298 os << "{";
1299 for(unsigned int i = 0; i < Coordinates::num_max_dimensions; i++)
1300 {
1301 if(i > 0)
1302 {
1303 os << ", ";
1304 }
1305 os << win[i];
1306 }
1307 os << "}";
1308
1309 return os;
1310}
1311
1312/** Formatted output of the WeightsInfo type.
1313 *
1314 * @param[in] info Type to output.
1315 *
1316 * @return Formatted string.
1317 */
1318inline std::string to_string(const WeightsInfo &info)
1319{
1320 std::stringstream str;
1321 str << info;
1322 return str.str();
1323}
1324
1325/** Formatted output of the GEMMReshapeInfo type.
1326 *
1327 * @param[in] info Type to output.
1328 *
1329 * @return Formatted string.
1330 */
1331inline std::string to_string(const GEMMReshapeInfo &info)
1332{
1333 std::stringstream str;
1334 str << info;
1335 return str.str();
1336}
1337
1338/** Formatted output of the GEMMInfo type.
1339 *
1340 * @param[in] info Type to output.
1341 *
1342 * @return Formatted string.
1343 */
1344inline std::string to_string(const GEMMInfo &info)
1345{
1346 std::stringstream str;
1347 str << info;
1348 return str.str();
1349}
1350
1351/** Formatted output of the Window::Dimension type.
1352 *
1353 * @param[in] dim Type to output.
1354 *
1355 * @return Formatted string.
1356 */
1357inline std::string to_string(const Window::Dimension &dim)
1358{
1359 std::stringstream str;
1360 str << dim;
1361 return str.str();
1362}
1363/** Formatted output of the Window type.
1364 *
1365 * @param[in] win Type to output.
1366 *
1367 * @return Formatted string.
1368 */
1369inline std::string to_string(const Window &win)
1370{
1371 std::stringstream str;
1372 str << win;
1373 return str.str();
1374}
1375
Alex Gildayc357c472018-03-21 13:54:09 +00001376/** Formatted output of the Rectangle type.
1377 *
1378 * @param[out] os Output stream.
1379 * @param[in] rect Type to output.
1380 *
1381 * @return Modified output stream.
1382 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001383inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect)
1384{
1385 os << rect.width << "x" << rect.height;
1386 os << "+" << rect.x << "+" << rect.y;
1387
1388 return os;
1389}
1390
Usama Arif8cf8c112019-03-14 15:36:54 +00001391/** Formatted output of the PaddingMode type.
1392 *
1393 * @param[out] os Output stream.
1394 * @param[in] mode Type to output.
1395 *
1396 * @return Modified output stream.
1397 */
1398inline ::std::ostream &operator<<(::std::ostream &os, const PaddingMode &mode)
1399{
1400 switch(mode)
1401 {
1402 case PaddingMode::CONSTANT:
1403 os << "CONSTANT";
1404 break;
1405 case PaddingMode::REFLECT:
1406 os << "REFLECT";
1407 break;
1408 case PaddingMode::SYMMETRIC:
1409 os << "SYMMETRIC";
1410 break;
1411 default:
1412 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1413 }
1414
1415 return os;
1416}
1417
1418/** Formatted output of the PaddingMode type.
1419 *
1420 * @param[in] mode Type to output.
1421 *
1422 * @return Formatted string.
1423 */
1424inline std::string to_string(const PaddingMode &mode)
1425{
1426 std::stringstream str;
1427 str << mode;
1428 return str.str();
1429}
1430
Alex Gildayc357c472018-03-21 13:54:09 +00001431/** Formatted output of the PadStrideInfo type.
1432 *
1433 * @param[out] os Output stream.
1434 * @param[in] pad_stride_info Type to output.
1435 *
1436 * @return Modified output stream.
1437 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001438inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info)
1439{
1440 os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
1441 os << ";";
Jaroslaw Rzepeckia1ed41f2017-10-13 11:13:58 +01001442 os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << ","
1443 << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom();
Anthony Barbier2a07e182017-08-04 18:20:27 +01001444
1445 return os;
1446}
1447
Alex Gildayc357c472018-03-21 13:54:09 +00001448/** Formatted output of the PadStrideInfo type.
1449 *
1450 * @param[in] pad_stride_info Type to output.
1451 *
1452 * @return Formatted string.
1453 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001454inline std::string to_string(const PadStrideInfo &pad_stride_info)
1455{
1456 std::stringstream str;
1457 str << pad_stride_info;
1458 return str.str();
1459}
1460
Alex Gildayc357c472018-03-21 13:54:09 +00001461/** Formatted output of the BorderMode type.
1462 *
1463 * @param[in] mode Type to output.
1464 *
1465 * @return Formatted string.
1466 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001467inline std::string to_string(const BorderMode &mode)
1468{
1469 std::stringstream str;
1470 str << mode;
1471 return str.str();
1472}
1473
Alex Gildayc357c472018-03-21 13:54:09 +00001474/** Formatted output of the BorderSize type.
1475 *
1476 * @param[in] border Type to output.
1477 *
1478 * @return Formatted string.
1479 */
John Richardsonb482ce12017-09-18 12:44:01 +01001480inline std::string to_string(const BorderSize &border)
1481{
1482 std::stringstream str;
1483 str << border;
1484 return str.str();
1485}
1486
Giuseppe Rossinid7647d42018-07-17 18:13:13 +01001487/** Formatted output of the PaddingList type.
1488 *
1489 * @param[in] padding Type to output.
1490 *
1491 * @return Formatted string.
1492 */
1493inline std::string to_string(const PaddingList &padding)
1494{
1495 std::stringstream str;
1496 str << padding;
1497 return str.str();
1498}
1499
giuros013175fcf2018-11-21 09:59:17 +00001500/** Formatted output of the Multiples type.
1501 *
1502 * @param[in] multiples Type to output.
1503 *
1504 * @return Formatted string.
1505 */
1506inline std::string to_string(const Multiples &multiples)
1507{
1508 std::stringstream str;
1509 str << multiples;
1510 return str.str();
1511}
1512
Alex Gildayc357c472018-03-21 13:54:09 +00001513/** Formatted output of the InterpolationPolicy type.
1514 *
1515 * @param[in] policy Type to output.
1516 *
1517 * @return Formatted string.
1518 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001519inline std::string to_string(const InterpolationPolicy &policy)
1520{
1521 std::stringstream str;
1522 str << policy;
1523 return str.str();
1524}
1525
Alex Gildayc357c472018-03-21 13:54:09 +00001526/** Formatted output of the SamplingPolicy type.
1527 *
1528 * @param[in] policy Type to output.
1529 *
1530 * @return Formatted string.
1531 */
Daniil Efremov02bf80d2017-11-22 00:26:51 +07001532inline std::string to_string(const SamplingPolicy &policy)
1533{
1534 std::stringstream str;
1535 str << policy;
1536 return str.str();
1537}
1538
Alex Gildayc357c472018-03-21 13:54:09 +00001539/** Formatted output of the ConvertPolicy type.
1540 *
1541 * @param[out] os Output stream.
1542 * @param[in] policy Type to output.
1543 *
1544 * @return Modified output stream.
1545 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001546inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy)
1547{
1548 switch(policy)
1549 {
1550 case ConvertPolicy::WRAP:
1551 os << "WRAP";
1552 break;
1553 case ConvertPolicy::SATURATE:
1554 os << "SATURATE";
1555 break;
1556 default:
1557 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1558 }
1559
1560 return os;
1561}
1562
1563inline std::string to_string(const ConvertPolicy &policy)
1564{
1565 std::stringstream str;
1566 str << policy;
1567 return str.str();
1568}
1569
giuros01164a2722018-11-20 18:34:46 +00001570/** Formatted output of the ArithmeticOperation type.
1571 *
1572 * @param[out] os Output stream.
1573 * @param[in] op Operation to output.
1574 *
1575 * @return Modified output stream.
1576 */
1577inline ::std::ostream &operator<<(::std::ostream &os, const ArithmeticOperation &op)
1578{
1579 switch(op)
1580 {
1581 case ArithmeticOperation::ADD:
1582 os << "ADD";
1583 break;
1584 case ArithmeticOperation::SUB:
1585 os << "SUB";
1586 break;
1587 case ArithmeticOperation::DIV:
1588 os << "DIV";
1589 break;
1590 case ArithmeticOperation::MAX:
1591 os << "MAX";
1592 break;
1593 case ArithmeticOperation::MIN:
1594 os << "MIN";
1595 break;
1596 case ArithmeticOperation::SQUARED_DIFF:
1597 os << "SQUARED_DIFF";
1598 break;
Usama Arif52c54f62019-05-14 10:22:36 +01001599 case ArithmeticOperation::POWER:
1600 os << "POWER";
1601 break;
giuros01164a2722018-11-20 18:34:46 +00001602 default:
1603 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1604 }
1605
1606 return os;
1607}
1608
1609/** Formatted output of the Arithmetic Operation
1610 *
1611 * @param[in] op Type to output.
1612 *
1613 * @return Formatted string.
1614 */
1615inline std::string to_string(const ArithmeticOperation &op)
1616{
1617 std::stringstream str;
1618 str << op;
1619 return str.str();
1620}
1621
Alex Gildayc357c472018-03-21 13:54:09 +00001622/** Formatted output of the Reduction Operations.
1623 *
1624 * @param[out] os Output stream.
1625 * @param[in] op Type to output.
1626 *
1627 * @return Modified output stream.
1628 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001629inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op)
1630{
1631 switch(op)
1632 {
Michalis Spyrou7e9391b2018-10-05 14:49:28 +01001633 case ReductionOperation::SUM:
1634 os << "SUM";
1635 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +01001636 case ReductionOperation::SUM_SQUARE:
1637 os << "SUM_SQUARE";
1638 break;
Michalis Spyrou7e9391b2018-10-05 14:49:28 +01001639 case ReductionOperation::MEAN_SUM:
1640 os << "MEAN_SUM";
1641 break;
Michalis Spyrou7930db42018-11-22 17:36:28 +00001642 case ReductionOperation::ARG_IDX_MAX:
1643 os << "ARG_IDX_MAX";
1644 break;
1645 case ReductionOperation::ARG_IDX_MIN:
1646 os << "ARG_IDX_MIN";
1647 break;
Manuel Bottinib412fab2018-12-10 17:40:23 +00001648 case ReductionOperation::PROD:
1649 os << "PROD";
1650 break;
Usama Arifa4a08ad2019-05-20 12:38:33 +01001651 case ReductionOperation::MIN:
1652 os << "MIN";
1653 break;
Usama Arif28f0dd92019-05-20 13:44:34 +01001654 case ReductionOperation::MAX:
1655 os << "MAX";
1656 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +01001657 default:
1658 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1659 }
1660
1661 return os;
1662}
1663
Alex Gildayc357c472018-03-21 13:54:09 +00001664/** Formatted output of the Reduction Operations.
1665 *
1666 * @param[in] op Type to output.
1667 *
1668 * @return Formatted string.
1669 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001670inline std::string to_string(const ReductionOperation &op)
1671{
1672 std::stringstream str;
1673 str << op;
1674 return str.str();
1675}
1676
Georgios Pinitas7900a9e2018-11-23 11:44:58 +00001677/** Formatted output of the Comparison Operations.
1678 *
1679 * @param[out] os Output stream.
1680 * @param[in] op Type to output.
1681 *
1682 * @return Modified output stream.
1683 */
1684inline ::std::ostream &operator<<(::std::ostream &os, const ComparisonOperation &op)
1685{
1686 switch(op)
1687 {
1688 case ComparisonOperation::Equal:
1689 os << "Equal";
1690 break;
1691 case ComparisonOperation::NotEqual:
1692 os << "NotEqual";
1693 break;
1694 case ComparisonOperation::Greater:
1695 os << "Greater";
1696 break;
1697 case ComparisonOperation::GreaterEqual:
1698 os << "GreaterEqual";
1699 break;
1700 case ComparisonOperation::Less:
1701 os << "Less";
1702 break;
1703 case ComparisonOperation::LessEqual:
1704 os << "LessEqual";
1705 break;
1706 default:
1707 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1708 }
1709
1710 return os;
1711}
1712
Michalis Spyroue9362622018-11-23 17:41:37 +00001713/** Formatted output of the Elementwise unary Operations.
1714 *
1715 * @param[out] os Output stream.
1716 * @param[in] op Type to output.
1717 *
1718 * @return Modified output stream.
1719 */
1720inline ::std::ostream &operator<<(::std::ostream &os, const ElementWiseUnary &op)
1721{
1722 switch(op)
1723 {
1724 case ElementWiseUnary::RSQRT:
1725 os << "RSQRT";
1726 break;
1727 case ElementWiseUnary::EXP:
1728 os << "EXP";
1729 break;
Usama Arifeb312ef2019-05-13 17:45:54 +01001730 case ElementWiseUnary::NEG:
1731 os << "NEG";
1732 break;
Usama Arifac33d7e2019-05-20 14:21:40 +01001733 case ElementWiseUnary::LOG:
1734 os << "LOG";
1735 break;
Usama Arif6a4d5422019-05-24 14:53:59 +01001736 case ElementWiseUnary::ROUND:
1737 os << "ROUND";
1738 break;
Michalis Spyroue9362622018-11-23 17:41:37 +00001739 default:
1740 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1741 }
1742
1743 return os;
1744}
1745
Georgios Pinitas7900a9e2018-11-23 11:44:58 +00001746/** Formatted output of the Comparison Operations.
1747 *
1748 * @param[in] op Type to output.
1749 *
1750 * @return Formatted string.
1751 */
1752inline std::string to_string(const ComparisonOperation &op)
1753{
1754 std::stringstream str;
1755 str << op;
1756 return str.str();
1757}
1758
Michalis Spyroue9362622018-11-23 17:41:37 +00001759/** Formatted output of the Elementwise unary Operations.
1760 *
1761 * @param[in] op Type to output.
1762 *
1763 * @return Formatted string.
1764 */
1765inline std::string to_string(const ElementWiseUnary &op)
1766{
1767 std::stringstream str;
1768 str << op;
1769 return str.str();
1770}
1771
Alex Gildayc357c472018-03-21 13:54:09 +00001772/** Formatted output of the Norm Type.
1773 *
1774 * @param[in] type Type to output.
1775 *
1776 * @return Formatted string.
1777 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001778inline std::string to_string(const NormType &type)
1779{
1780 std::stringstream str;
1781 str << type;
1782 return str.str();
1783}
1784
Alex Gildayc357c472018-03-21 13:54:09 +00001785/** Formatted output of the Pooling Type.
1786 *
1787 * @param[in] type Type to output.
1788 *
1789 * @return Formatted string.
1790 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001791inline std::string to_string(const PoolingType &type)
1792{
1793 std::stringstream str;
1794 str << type;
1795 return str.str();
1796}
1797
Alex Gildayc357c472018-03-21 13:54:09 +00001798/** Formatted output of the Pooling Layer Info.
1799 *
1800 * @param[in] info Type to output.
1801 *
1802 * @return Formatted string.
1803 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001804inline std::string to_string(const PoolingLayerInfo &info)
1805{
1806 std::stringstream str;
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +00001807 str << "{Type=" << info.pool_type << ","
Sang-Hoon Park11fedda2020-01-15 14:44:04 +00001808 << "DataLayout=" << info.data_layout << ","
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +00001809 << "IsGlobalPooling=" << info.is_global_pooling;
1810 if(!info.is_global_pooling)
Georgios Pinitas4c2dd542017-11-13 12:58:41 +00001811 {
1812 str << ","
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +00001813 << "PoolSize=" << info.pool_size.width << "," << info.pool_size.height << ","
1814 << "PadStride=" << info.pad_stride_info;
Georgios Pinitas4c2dd542017-11-13 12:58:41 +00001815 }
1816 str << "}";
Anthony Barbier2a07e182017-08-04 18:20:27 +01001817 return str.str();
1818}
1819
Michalis Spyrou6c7c38e2018-08-29 16:28:11 +01001820/** Formatted output of the PriorBoxLayerInfo.
1821 *
1822 * @param[in] info Type to output.
1823 *
1824 * @return Formatted string.
1825 */
1826inline std::string to_string(const PriorBoxLayerInfo &info)
1827{
1828 std::stringstream str;
1829 str << "{";
1830 str << "Clip:" << info.clip()
1831 << "Flip:" << info.flip()
1832 << "StepX:" << info.steps()[0]
1833 << "StepY:" << info.steps()[1]
1834 << "MinSizes:" << info.min_sizes().size()
1835 << "MaxSizes:" << info.max_sizes().size()
1836 << "ImgSizeX:" << info.img_size().x
1837 << "ImgSizeY:" << info.img_size().y
1838 << "Offset:" << info.offset()
1839 << "Variances:" << info.variances().size();
1840 str << "}";
1841 return str.str();
1842}
1843
Alex Gildayc357c472018-03-21 13:54:09 +00001844/** Formatted output of the Size2D type.
1845 *
1846 * @param[out] os Output stream
1847 * @param[in] size Type to output
1848 *
1849 * @return Modified output stream.
1850 */
John Richardson25f23682017-11-27 14:35:09 +00001851inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size)
1852{
1853 os << size.width << "x" << size.height;
1854
1855 return os;
1856}
1857
Alex Gildayc357c472018-03-21 13:54:09 +00001858/** Formatted output of the Size2D type.
1859 *
1860 * @param[in] type Type to output
1861 *
1862 * @return Formatted string.
1863 */
John Richardson25f23682017-11-27 14:35:09 +00001864inline std::string to_string(const Size2D &type)
1865{
1866 std::stringstream str;
1867 str << type;
1868 return str.str();
1869}
1870
Alex Gildayc357c472018-03-21 13:54:09 +00001871/** Formatted output of the ConvolutionMethod type.
1872 *
1873 * @param[out] os Output stream
1874 * @param[in] conv_method Type to output
1875 *
1876 * @return Modified output stream.
1877 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001878inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method)
1879{
1880 switch(conv_method)
1881 {
1882 case ConvolutionMethod::GEMM:
1883 os << "GEMM";
1884 break;
1885 case ConvolutionMethod::DIRECT:
1886 os << "DIRECT";
1887 break;
1888 case ConvolutionMethod::WINOGRAD:
1889 os << "WINOGRAD";
1890 break;
1891 default:
1892 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1893 }
1894
1895 return os;
1896}
1897
Alex Gildayc357c472018-03-21 13:54:09 +00001898/** Formatted output of the ConvolutionMethod type.
1899 *
1900 * @param[in] conv_method Type to output
1901 *
1902 * @return Formatted string.
1903 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001904inline std::string to_string(const ConvolutionMethod &conv_method)
1905{
1906 std::stringstream str;
1907 str << conv_method;
1908 return str.str();
1909}
1910
Alex Gildayc357c472018-03-21 13:54:09 +00001911/** Formatted output of the GPUTarget type.
1912 *
1913 * @param[out] os Output stream
1914 * @param[in] gpu_target Type to output
1915 *
1916 * @return Modified output stream.
1917 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001918inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target)
1919{
1920 switch(gpu_target)
1921 {
1922 case GPUTarget::GPU_ARCH_MASK:
1923 os << "GPU_ARCH_MASK";
1924 break;
1925 case GPUTarget::MIDGARD:
1926 os << "MIDGARD";
1927 break;
1928 case GPUTarget::BIFROST:
1929 os << "BIFROST";
1930 break;
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01001931 case GPUTarget::VALHALL:
1932 os << "VALHALL";
1933 break;
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001934 case GPUTarget::T600:
1935 os << "T600";
1936 break;
1937 case GPUTarget::T700:
1938 os << "T700";
1939 break;
1940 case GPUTarget::T800:
1941 os << "T800";
1942 break;
Michalis Spyroua9676112018-02-22 18:07:43 +00001943 case GPUTarget::G71:
1944 os << "G71";
1945 break;
1946 case GPUTarget::G72:
1947 os << "G72";
1948 break;
1949 case GPUTarget::G51:
1950 os << "G51";
1951 break;
1952 case GPUTarget::G51BIG:
1953 os << "G51BIG";
1954 break;
1955 case GPUTarget::G51LIT:
1956 os << "G51LIT";
1957 break;
Georgios Pinitasb03f7c52018-07-12 10:49:53 +01001958 case GPUTarget::G76:
1959 os << "G76";
Michalis Spyroua9676112018-02-22 18:07:43 +00001960 break;
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01001961 case GPUTarget::G77:
1962 os << "G77";
Michalis Spyroua9676112018-02-22 18:07:43 +00001963 break;
Georgios Pinitas4ffc42a2020-12-01 16:28:24 +00001964 case GPUTarget::G78:
1965 os << "G78";
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001966 break;
Pablo Marquez Tellob1496e62021-06-25 14:49:37 +01001967 case GPUTarget::G31:
1968 os << "G31";
1969 break;
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01001970 case GPUTarget::TODX:
1971 os << "TODX";
1972 break;
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001973 default:
1974 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1975 }
1976
1977 return os;
1978}
1979
Alex Gildayc357c472018-03-21 13:54:09 +00001980/** Formatted output of the GPUTarget type.
1981 *
1982 * @param[in] gpu_target Type to output
1983 *
1984 * @return Formatted string.
1985 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00001986inline std::string to_string(const GPUTarget &gpu_target)
1987{
1988 std::stringstream str;
1989 str << gpu_target;
1990 return str.str();
1991}
Gian Marco Iodice247f52c2018-03-22 11:24:56 +00001992
John Richardson8de92612018-02-22 14:09:31 +00001993/** Formatted output of the DetectionWindow type.
1994 *
1995 * @param[out] os Output stream
1996 * @param[in] detection_window Type to output
1997 *
1998 * @return Modified output stream.
1999 */
John Richardson684cb0f2018-01-09 11:17:00 +00002000inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window)
2001{
2002 os << "{x=" << detection_window.x << ","
2003 << "y=" << detection_window.y << ","
2004 << "width=" << detection_window.width << ","
2005 << "height=" << detection_window.height << ","
2006 << "idx_class=" << detection_window.idx_class << ","
2007 << "score=" << detection_window.score << "}";
2008
2009 return os;
2010}
2011
Isabella Gottardi05e56442018-11-16 11:26:52 +00002012/** Formatted output of the DetectionOutputLayerCodeType type.
2013 *
2014 * @param[out] os Output stream
2015 * @param[in] detection_code Type to output
2016 *
2017 * @return Modified output stream.
2018 */
2019inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerCodeType &detection_code)
2020{
2021 switch(detection_code)
2022 {
2023 case DetectionOutputLayerCodeType::CENTER_SIZE:
2024 os << "CENTER_SIZE";
2025 break;
2026 case DetectionOutputLayerCodeType::CORNER:
2027 os << "CORNER";
2028 break;
2029 case DetectionOutputLayerCodeType::CORNER_SIZE:
2030 os << "CORNER_SIZE";
2031 break;
2032 case DetectionOutputLayerCodeType::TF_CENTER:
2033 os << "TF_CENTER";
2034 break;
2035 default:
2036 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2037 }
2038
2039 return os;
2040}
2041/** Formatted output of the DetectionOutputLayerCodeType type.
2042 *
2043 * @param[in] detection_code Type to output
2044 *
2045 * @return Formatted string.
2046 */
2047inline std::string to_string(const DetectionOutputLayerCodeType &detection_code)
2048{
2049 std::stringstream str;
2050 str << detection_code;
2051 return str.str();
2052}
2053
2054/** Formatted output of the DetectionOutputLayerInfo type.
2055 *
2056 * @param[out] os Output stream
2057 * @param[in] detection_info Type to output
2058 *
2059 * @return Modified output stream.
2060 */
2061inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerInfo &detection_info)
2062{
2063 os << "{Classes=" << detection_info.num_classes() << ","
2064 << "ShareLocation=" << detection_info.share_location() << ","
2065 << "CodeType=" << detection_info.code_type() << ","
2066 << "VarianceEncodedInTarget=" << detection_info.variance_encoded_in_target() << ","
2067 << "KeepTopK=" << detection_info.keep_top_k() << ","
2068 << "NMSThreshold=" << detection_info.nms_threshold() << ","
2069 << "Eta=" << detection_info.eta() << ","
2070 << "BackgroundLabelId=" << detection_info.background_label_id() << ","
2071 << "ConfidenceThreshold=" << detection_info.confidence_threshold() << ","
2072 << "TopK=" << detection_info.top_k() << ","
2073 << "NumLocClasses=" << detection_info.num_loc_classes()
2074 << "}";
2075
2076 return os;
2077}
2078
2079/** Formatted output of the DetectionOutputLayerInfo type.
2080 *
2081 * @param[in] detection_info Type to output
2082 *
2083 * @return Formatted string.
2084 */
2085inline std::string to_string(const DetectionOutputLayerInfo &detection_info)
2086{
2087 std::stringstream str;
2088 str << detection_info;
2089 return str.str();
2090}
Isabella Gottardia7acb3c2019-01-08 13:48:44 +00002091/** Formatted output of the DetectionPostProcessLayerInfo type.
2092 *
2093 * @param[out] os Output stream
2094 * @param[in] detection_info Type to output
2095 *
2096 * @return Modified output stream.
2097 */
2098inline ::std::ostream &operator<<(::std::ostream &os, const DetectionPostProcessLayerInfo &detection_info)
2099{
2100 os << "{MaxDetections=" << detection_info.max_detections() << ","
2101 << "MaxClassesPerDetection=" << detection_info.max_classes_per_detection() << ","
2102 << "NmsScoreThreshold=" << detection_info.nms_score_threshold() << ","
2103 << "NmsIouThreshold=" << detection_info.iou_threshold() << ","
2104 << "NumClasses=" << detection_info.num_classes() << ","
2105 << "ScaleValue_y=" << detection_info.scale_value_y() << ","
2106 << "ScaleValue_x=" << detection_info.scale_value_x() << ","
2107 << "ScaleValue_h=" << detection_info.scale_value_h() << ","
2108 << "ScaleValue_w=" << detection_info.scale_value_w() << ","
2109 << "UseRegularNms=" << detection_info.use_regular_nms() << ","
2110 << "DetectionPerClass=" << detection_info.detection_per_class()
2111 << "}";
2112
2113 return os;
2114}
2115
2116/** Formatted output of the DetectionPostProcessLayerInfo type.
2117 *
2118 * @param[in] detection_info Type to output
2119 *
2120 * @return Formatted string.
2121 */
2122inline std::string to_string(const DetectionPostProcessLayerInfo &detection_info)
2123{
2124 std::stringstream str;
2125 str << detection_info;
2126 return str.str();
2127}
Georgios Pinitasc6f95102021-03-30 10:03:01 +01002128
John Richardson8de92612018-02-22 14:09:31 +00002129/** Formatted output of the DetectionWindow type.
2130 *
2131 * @param[in] detection_window Type to output
2132 *
2133 * @return Formatted string.
2134 */
2135inline std::string to_string(const DetectionWindow &detection_window)
2136{
2137 std::stringstream str;
2138 str << detection_window;
2139 return str.str();
2140}
2141
Anthony Barbier671a11e2018-07-06 15:11:36 +01002142/** Formatted output of a vector of objects.
2143 *
2144 * @param[out] os Output stream
2145 * @param[in] args Vector of objects to print
2146 *
2147 * @return Modified output stream.
2148 */
2149template <typename T>
2150inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
2151{
2152 os << "[";
2153 bool first = true;
2154 for(auto &arg : args)
2155 {
2156 if(first)
2157 {
2158 first = false;
2159 }
2160 else
2161 {
2162 os << ", ";
2163 }
2164 os << arg;
2165 }
2166 os << "]";
2167 return os;
2168}
2169
Michalis Spyrou6c7c38e2018-08-29 16:28:11 +01002170/** Formatted output of @ref PriorBoxLayerInfo.
2171 *
2172 * @param[out] os Output stream.
2173 * @param[in] info Type to output.
2174 *
2175 * @return Modified output stream.
2176 */
2177inline ::std::ostream &operator<<(::std::ostream &os, const PriorBoxLayerInfo &info)
2178{
2179 os << "Clip:" << info.clip()
2180 << "Flip:" << info.flip()
2181 << "StepX:" << info.steps()[0]
2182 << "StepY:" << info.steps()[1]
2183 << "MinSizes:" << info.min_sizes()
2184 << "MaxSizes:" << info.max_sizes()
2185 << "ImgSizeX:" << info.img_size().x
2186 << "ImgSizeY:" << info.img_size().y
2187 << "Offset:" << info.offset()
2188 << "Variances:" << info.variances();
2189
2190 return os;
2191}
2192
Anthony Barbier671a11e2018-07-06 15:11:36 +01002193/** Formatted output of a vector of objects.
2194 *
2195 * @param[in] args Vector of objects to print
2196 *
2197 * @return String representing args.
2198 */
2199template <typename T>
2200std::string to_string(const std::vector<T> &args)
2201{
2202 std::stringstream str;
2203 str << args;
2204 return str.str();
2205}
2206
Gian Marco Iodice247f52c2018-03-22 11:24:56 +00002207/** Formatted output of the WinogradInfo type. */
2208inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info)
2209{
2210 os << "{OutputTileSize=" << info.output_tile_size << ","
2211 << "KernelSize=" << info.kernel_size << ","
2212 << "PadStride=" << info.convolution_info << ","
2213 << "OutputDataLayout=" << info.output_data_layout << "}";
2214
2215 return os;
2216}
2217
Gian Marco Iodice247f52c2018-03-22 11:24:56 +00002218inline std::string to_string(const WinogradInfo &type)
2219{
2220 std::stringstream str;
2221 str << type;
2222 return str.str();
2223}
Anthony Barbier671a11e2018-07-06 15:11:36 +01002224
2225/** Fallback method: try to use std::to_string:
2226 *
2227 * @param[in] val Value to convert to string
2228 *
2229 * @return String representing val.
2230 */
2231template <typename T>
2232inline std::string to_string(const T &val)
2233{
2234 return support::cpp11::to_string(val);
2235}
2236
Vidhya Sudhan Loganathan050471e2019-04-25 09:27:24 +01002237/** Convert a CLTunerMode value to a string
2238 *
2239 * @param val CLTunerMode value to be converted
2240 *
2241 * @return String representing the corresponding CLTunerMode.
2242 */
2243inline std::string to_string(const CLTunerMode val)
2244{
2245 switch(val)
2246 {
2247 case CLTunerMode::EXHAUSTIVE:
2248 {
2249 return std::string("Exhaustive");
2250 }
2251 case CLTunerMode::NORMAL:
2252 {
2253 return std::string("Normal");
2254 }
2255 case CLTunerMode::RAPID:
2256 {
2257 return std::string("Rapid");
2258 }
2259 default:
2260 {
2261 ARM_COMPUTE_ERROR("Invalid tuner mode.");
2262 return std::string("UNDEFINED");
2263 }
2264 }
2265}
SiCong Lidb4a6c12021-02-05 09:30:57 +00002266/** Converts a @ref CLGEMMKernelType to string
2267 *
2268 * @param[in] val CLGEMMKernelType value to be converted
2269 *
2270 * @return String representing the corresponding CLGEMMKernelType
2271 */
2272inline std::string to_string(CLGEMMKernelType val)
2273{
2274 switch(val)
2275 {
2276 case CLGEMMKernelType::NATIVE_V1:
2277 {
2278 return "Native_V1";
2279 }
2280 case CLGEMMKernelType::RESHAPED_V1:
2281 {
2282 return "Reshaped_V1";
2283 }
2284 case CLGEMMKernelType::NATIVE:
2285 {
2286 return "Native";
2287 }
2288 case CLGEMMKernelType::RESHAPED_ONLY_RHS:
2289 {
2290 return "Reshaped_Only_RHS";
2291 }
2292 case CLGEMMKernelType::RESHAPED:
2293 {
2294 return "Reshaped";
2295 }
2296 default:
2297 {
2298 return "Unknown";
2299 }
2300 }
2301}
Vidhya Sudhan Loganathan050471e2019-04-25 09:27:24 +01002302/** [Print CLTunerMode type] **/
2303/** Formatted output of the CLTunerMode type.
2304 *
2305 * @param[out] os Output stream.
2306 * @param[in] val CLTunerMode to output.
2307 *
2308 * @return Modified output stream.
2309 */
2310inline ::std::ostream &operator<<(::std::ostream &os, const CLTunerMode &val)
2311{
2312 os << to_string(val);
2313 return os;
2314}
2315
ramelg013ae3d882021-09-12 23:07:47 +01002316/** Formatted output of the ConvolutionInfo type.
2317 *
2318 * @param[out] os Output stream.
2319 * @param[in] conv_info ConvolutionInfo to output.
2320 *
2321 * @return Modified output stream.
2322 */
2323inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionInfo &conv_info)
2324{
2325 os << "PadStrideInfo = " << conv_info.pad_stride_info << ", "
2326 << "depth_multiplier = " << conv_info.depth_multiplier << ", "
2327 << "act_info = " << to_string(conv_info.act_info) << ", "
2328 << "dilation = " << conv_info.dilation;
2329 return os;
2330}
2331
2332/** Converts a @ref ConvolutionInfo to string
2333 *
2334 * @param[in] info ConvolutionInfo value to be converted
2335 *
2336 * @return String representing the corresponding ConvolutionInfo
2337 */
2338inline std::string to_string(const ConvolutionInfo &info)
2339{
2340 std::stringstream str;
2341 str << info;
2342 return str.str();
2343}
2344
2345/** Formatted output of the FullyConnectedLayerInfo type.
2346 *
2347 * @param[out] os Output stream.
2348 * @param[in] layer_info FullyConnectedLayerInfo to output.
2349 *
2350 * @return Modified output stream.
2351 */
2352inline ::std::ostream &operator<<(::std::ostream &os, const FullyConnectedLayerInfo &layer_info)
2353{
2354 os << "activation_info = " << to_string(layer_info.activation_info) << ", "
2355 << "weights_trained_layout = " << layer_info.weights_trained_layout << ", "
2356 << "transpose_weights = " << layer_info.transpose_weights << ", "
2357 << "are_weights_reshaped = " << layer_info.are_weights_reshaped << ", "
2358 << "retain_internal_weights = " << layer_info.retain_internal_weights << ", "
2359 << "constant_weights = " << layer_info.transpose_weights << ", "
2360 << "fp_mixed_precision = " << layer_info.fp_mixed_precision;
2361 return os;
2362}
2363
2364/** Converts a @ref FullyConnectedLayerInfo to string
2365 *
2366 * @param[in] info FullyConnectedLayerInfo value to be converted
2367 *
2368 * @return String representing the corresponding FullyConnectedLayerInfo
2369 */
2370inline std::string to_string(const FullyConnectedLayerInfo &info)
2371{
2372 std::stringstream str;
2373 str << info;
2374 return str.str();
2375}
2376
2377/** Formatted output of the GEMMLowpOutputStageType type.
2378 *
2379 * @param[out] os Output stream.
2380 * @param[in] gemm_type GEMMLowpOutputStageType to output.
2381 *
2382 * @return Modified output stream.
2383 */
2384inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageType &gemm_type)
2385{
2386 switch(gemm_type)
2387 {
2388 case GEMMLowpOutputStageType::NONE:
2389 os << "NONE";
2390 break;
2391 case GEMMLowpOutputStageType::QUANTIZE_DOWN:
2392 os << "QUANTIZE_DOWN";
2393 break;
2394 case GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT:
2395 os << "QUANTIZE_DOWN_FIXEDPOINT";
2396 break;
2397 case GEMMLowpOutputStageType::QUANTIZE_DOWN_FLOAT:
2398 os << "QUANTIZE_DOWN_FLOAT";
2399 break;
2400 default:
2401 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2402 }
2403 return os;
2404}
2405
2406/** Converts a @ref GEMMLowpOutputStageType to string
2407 *
2408 * @param[in] gemm_type GEMMLowpOutputStageType value to be converted
2409 *
2410 * @return String representing the corresponding GEMMLowpOutputStageType
2411 */
2412inline std::string to_string(const GEMMLowpOutputStageType &gemm_type)
2413{
2414 std::stringstream str;
2415 str << gemm_type;
2416 return str.str();
2417}
2418
2419/** Formatted output of the GEMMLowpOutputStageInfo type.
2420 *
2421 * @param[out] os Output stream.
2422 * @param[in] gemm_info GEMMLowpOutputStageInfo to output.
2423 *
2424 * @return Modified output stream.
2425 */
2426inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageInfo &gemm_info)
2427{
2428 os << "type = " << gemm_info.type << ", "
2429 << "gemlowp_offset = " << gemm_info.gemmlowp_offset << ", "
2430 << "gemmlowp_multiplier" << gemm_info.gemmlowp_multiplier << ", "
2431 << "gemmlowp_shift = " << gemm_info.gemmlowp_shift << ", "
2432 << "gemmlowp_min_bound = " << gemm_info.gemmlowp_min_bound << ", "
2433 << "gemmlowp_max_bound = " << gemm_info.gemmlowp_max_bound << ", "
2434 << "gemmlowp_multipliers = " << gemm_info.gemmlowp_multiplier << ", "
2435 << "gemmlowp_shifts = " << gemm_info.gemmlowp_shift << ", "
2436 << "gemmlowp_real_multiplier = " << gemm_info.gemmlowp_real_multiplier << ", "
2437 << "is_quantized_per_channel = " << gemm_info.is_quantized_per_channel << ", "
2438 << "output_data_type = " << gemm_info.output_data_type;
2439 return os;
2440}
2441
2442/** Converts a @ref GEMMLowpOutputStageInfo to string
2443 *
2444 * @param[in] gemm_info GEMMLowpOutputStageInfo value to be converted
2445 *
2446 * @return String representing the corresponding GEMMLowpOutputStageInfo
2447 */
2448inline std::string to_string(const GEMMLowpOutputStageInfo &gemm_info)
2449{
2450 std::stringstream str;
2451 str << gemm_info;
2452 return str.str();
2453}
2454
2455/** Formatted output of the Conv2dInfo type.
2456 *
2457 * @param[out] os Output stream.
2458 * @param[in] conv_info Conv2dInfo to output.
2459 *
2460 * @return Modified output stream.
2461 */
2462inline ::std::ostream &operator<<(::std::ostream &os, const Conv2dInfo &conv_info)
2463{
2464 os << "conv_info = " << conv_info.conv_info << ", "
2465 << "dilation = " << conv_info.dilation << ", "
2466 << "act_info = " << to_string(conv_info.act_info) << ", "
2467 << "enable_fast_math = " << conv_info.enable_fast_math << ", "
2468 << "num_groups = " << conv_info.num_groups;
2469 return os;
2470}
2471
2472/** Converts a @ref Conv2dInfo to string
2473 *
2474 * @param[in] conv_info Conv2dInfo value to be converted
2475 *
2476 * @return String representing the corresponding Conv2dInfo
2477 */
2478inline std::string to_string(const Conv2dInfo &conv_info)
2479{
2480 std::stringstream str;
2481 str << conv_info;
2482 return str.str();
2483}
2484
2485/** Formatted output of the PixelValue type.
2486 *
2487 * @param[out] os Output stream.
2488 * @param[in] pixel_value PixelValue to output.
2489 *
2490 * @return Modified output stream.
2491 */
2492inline ::std::ostream &operator<<(::std::ostream &os, const PixelValue &pixel_value)
2493{
2494 os << "value.u64= " << pixel_value.get<uint64_t>();
2495 return os;
2496}
2497
2498/** Converts a @ref PixelValue to string
2499 *
2500 * @param[in] pixel_value PixelValue value to be converted
2501 *
2502 * @return String representing the corresponding PixelValue
2503 */
2504inline std::string to_string(const PixelValue &pixel_value)
2505{
2506 std::stringstream str;
2507 str << pixel_value;
2508 return str.str();
2509}
2510
2511/** Formatted output of the ScaleKernelInfo type.
2512 *
2513 * @param[out] os Output stream.
2514 * @param[in] scale_info ScaleKernelInfo to output.
2515 *
2516 * @return Modified output stream.
2517 */
2518inline ::std::ostream &operator<<(::std::ostream &os, const ScaleKernelInfo &scale_info)
2519{
2520 os << "interpolation_policy = " << scale_info.interpolation_policy << ", "
2521 << "BorderMode = " << scale_info.border_mode << ", "
2522 << "PixelValue = " << scale_info.constant_border_value << ", "
2523 << "SamplingPolicy = " << scale_info.sampling_policy << ", "
2524 << "use_padding = " << scale_info.use_padding << ", "
2525 << "align_corners = " << scale_info.align_corners << ", "
2526 << "data_layout = " << scale_info.data_layout;
2527 return os;
2528}
2529
2530/** Converts a @ref ScaleKernelInfo to string
2531 *
2532 * @param[in] scale_info ScaleKernelInfo value to be converted
2533 *
2534 * @return String representing the corresponding ScaleKernelInfo
2535 */
2536inline std::string to_string(const ScaleKernelInfo &scale_info)
2537{
2538 std::stringstream str;
2539 str << scale_info;
2540 return str.str();
2541}
2542
2543/** Formatted output of the FFTDirection type.
2544 *
2545 * @param[out] os Output stream.
2546 * @param[in] fft_dir FFTDirection to output.
2547 *
2548 * @return Modified output stream.
2549 */
2550inline ::std::ostream &operator<<(::std::ostream &os, const FFTDirection &fft_dir)
2551{
2552 switch(fft_dir)
2553 {
2554 case FFTDirection::Forward:
2555 os << "Forward";
2556 break;
2557 case FFTDirection::Inverse:
2558 os << "Inverse";
2559 break;
2560 default:
2561 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2562 }
2563 return os;
2564}
2565
2566/** Converts a @ref FFT1DInfo to string
2567 *
2568 * @param[in] fft_dir FFT1DInfo value to be converted
2569 *
2570 * @return String representing the corresponding FFT1DInfo
2571 */
2572inline std::string to_string(const FFTDirection &fft_dir)
2573{
2574 std::stringstream str;
2575 str << fft_dir;
2576 return str.str();
2577}
2578
2579/** Formatted output of the FFT1DInfo type.
2580 *
2581 * @param[out] os Output stream.
2582 * @param[in] fft1d_info FFT1DInfo to output.
2583 *
2584 * @return Modified output stream.
2585 */
2586inline ::std::ostream &operator<<(::std::ostream &os, const FFT1DInfo &fft1d_info)
2587{
2588 os << "axis = " << fft1d_info.axis << ", "
2589 << "direction = " << fft1d_info.direction;
2590 return os;
2591}
2592
2593/** Converts a @ref FFT1DInfo to string
2594 *
2595 * @param[in] fft1d_info FFT1DInfo value to be converted
2596 *
2597 * @return String representing the corresponding FFT1DInfo
2598 */
2599inline std::string to_string(const FFT1DInfo &fft1d_info)
2600{
2601 std::stringstream str;
2602 str << fft1d_info;
2603 return str.str();
2604}
2605
2606/** Formatted output of the FFT2DInfo type.
2607 *
2608 * @param[out] os Output stream.
2609 * @param[in] fft2d_info FFT2DInfo to output.
2610 *
2611 * @return Modified output stream.
2612 */
2613inline ::std::ostream &operator<<(::std::ostream &os, const FFT2DInfo &fft2d_info)
2614{
2615 os << "axis = " << fft2d_info.axis0 << ", "
2616 << "axis = " << fft2d_info.axis1 << ", "
2617 << "direction = " << fft2d_info.direction;
2618 return os;
2619}
2620
2621/** Converts a @ref FFT2DInfo to string
2622 *
2623 * @param[in] fft2d_info FFT2DInfo value to be converted
2624 *
2625 * @return String representing the corresponding FFT2DInfo
2626 */
2627inline std::string to_string(const FFT2DInfo &fft2d_info)
2628{
2629 std::stringstream str;
2630 str << fft2d_info;
2631 return str.str();
2632}
2633
2634/** Formatted output of the Coordinates2D type.
2635 *
2636 * @param[out] os Output stream.
2637 * @param[in] coord_2d Coordinates2D to output.
2638 *
2639 * @return Modified output stream.
2640 */
2641inline ::std::ostream &operator<<(::std::ostream &os, const Coordinates2D &coord_2d)
2642{
2643 os << "x = " << coord_2d.x << ", "
2644 << "y = " << coord_2d.y;
2645 return os;
2646}
2647
2648/** Converts a @ref Coordinates2D to string
2649 *
2650 * @param[in] coord_2d Coordinates2D value to be converted
2651 *
2652 * @return String representing the corresponding Coordinates2D
2653 */
2654inline std::string to_string(const Coordinates2D &coord_2d)
2655{
2656 std::stringstream str;
2657 str << coord_2d;
2658 return str.str();
2659}
2660
2661/** Formatted output of the FuseBatchNormalizationType type.
2662 *
2663 * @param[out] os Output stream.
2664 * @param[in] fuse_type FuseBatchNormalizationType to output.
2665 *
2666 * @return Modified output stream.
2667 */
2668inline ::std::ostream &operator<<(::std::ostream &os, const FuseBatchNormalizationType &fuse_type)
2669{
2670 switch(fuse_type)
2671 {
2672 case FuseBatchNormalizationType::CONVOLUTION:
2673 os << "CONVOLUTION";
2674 break;
2675 case FuseBatchNormalizationType::DEPTHWISECONVOLUTION:
2676 os << "DEPTHWISECONVOLUTION";
2677 break;
2678 default:
2679 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2680 }
2681 return os;
2682}
2683
2684/** Converts a @ref FuseBatchNormalizationType to string
2685 *
2686 * @param[in] fuse_type FuseBatchNormalizationType value to be converted
2687 *
2688 * @return String representing the corresponding FuseBatchNormalizationType
2689 */
2690inline std::string to_string(const FuseBatchNormalizationType &fuse_type)
2691{
2692 std::stringstream str;
2693 str << fuse_type;
2694 return str.str();
2695}
2696
Anthony Barbier6ff3b192017-09-04 18:44:23 +01002697} // namespace arm_compute
Anthony Barbier4dbc0a92018-08-27 13:39:47 +01002698
2699#endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */