Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 ARM Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | * |
| 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 | */ |
| 24 | #ifndef __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ |
| 25 | #define __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ |
| 26 | |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 27 | #include "arm_compute/core/CL/CLTypes.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 28 | #include "arm_compute/core/Dimensions.h" |
| 29 | #include "arm_compute/core/Error.h" |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 30 | #include "arm_compute/core/HOGInfo.h" |
| 31 | #include "arm_compute/core/Size2D.h" |
John Richardson | a36eae1 | 2017-09-26 16:55:59 +0100 | [diff] [blame] | 32 | #include "arm_compute/core/Strides.h" |
Georgios Pinitas | 3faea25 | 2017-10-30 14:13:50 +0000 | [diff] [blame] | 33 | #include "arm_compute/core/TensorInfo.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 34 | #include "arm_compute/core/Types.h" |
| 35 | |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 36 | #include "tests/Types.h" |
| 37 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 38 | #include <ostream> |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 39 | #include <sstream> |
| 40 | #include <string> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 41 | |
| 42 | namespace arm_compute |
| 43 | { |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 44 | /** Formatted output of the Dimensions type. |
| 45 | * |
| 46 | * @param[out] os Output stream. |
| 47 | * @param[in] dimensions Type to output. |
| 48 | * |
| 49 | * @return Modified output stream. |
| 50 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 51 | template <typename T> |
| 52 | inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions) |
| 53 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 54 | if(dimensions.num_dimensions() > 0) |
| 55 | { |
| 56 | os << dimensions[0]; |
| 57 | |
| 58 | for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d) |
| 59 | { |
Moritz Pflanzer | c87fbf8 | 2017-07-18 14:02:10 +0100 | [diff] [blame] | 60 | os << "x" << dimensions[d]; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 61 | } |
| 62 | } |
| 63 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 64 | return os; |
| 65 | } |
| 66 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 67 | /** Formatted output of the NonLinearFilterFunction type. |
| 68 | * |
| 69 | * @param[out] os Output stream. |
| 70 | * @param[in] function Type to output. |
| 71 | * |
| 72 | * @return Modified output stream. |
| 73 | */ |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 74 | inline ::std::ostream &operator<<(::std::ostream &os, const NonLinearFilterFunction &function) |
| 75 | { |
| 76 | switch(function) |
| 77 | { |
| 78 | case NonLinearFilterFunction::MAX: |
| 79 | os << "MAX"; |
| 80 | break; |
| 81 | case NonLinearFilterFunction::MEDIAN: |
| 82 | os << "MEDIAN"; |
| 83 | break; |
| 84 | case NonLinearFilterFunction::MIN: |
| 85 | os << "MIN"; |
| 86 | break; |
| 87 | default: |
| 88 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 89 | } |
| 90 | |
| 91 | return os; |
| 92 | } |
| 93 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 94 | /** Formatted output of the NonLinearFilterFunction type. |
| 95 | * |
| 96 | * @param[in] function Type to output. |
| 97 | * |
| 98 | * @return Formatted string. |
| 99 | */ |
John Richardson | 6f4d49f | 2017-09-07 11:21:10 +0100 | [diff] [blame] | 100 | inline std::string to_string(const NonLinearFilterFunction &function) |
| 101 | { |
| 102 | std::stringstream str; |
| 103 | str << function; |
| 104 | return str.str(); |
| 105 | } |
| 106 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 107 | /** Formatted output of the MatrixPattern type. |
| 108 | * |
| 109 | * @param[out] os Output stream. |
| 110 | * @param[in] pattern Type to output. |
| 111 | * |
| 112 | * @return Modified output stream. |
| 113 | */ |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 114 | inline ::std::ostream &operator<<(::std::ostream &os, const MatrixPattern &pattern) |
| 115 | { |
| 116 | switch(pattern) |
| 117 | { |
| 118 | case MatrixPattern::BOX: |
| 119 | os << "BOX"; |
| 120 | break; |
| 121 | case MatrixPattern::CROSS: |
| 122 | os << "CROSS"; |
| 123 | break; |
| 124 | case MatrixPattern::DISK: |
| 125 | os << "DISK"; |
| 126 | break; |
| 127 | case MatrixPattern::OTHER: |
| 128 | os << "OTHER"; |
| 129 | break; |
| 130 | default: |
| 131 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 132 | } |
| 133 | |
| 134 | return os; |
| 135 | } |
| 136 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 137 | /** Formatted output of the MatrixPattern type. |
| 138 | * |
| 139 | * @param[in] pattern Type to output. |
| 140 | * |
| 141 | * @return Formatted string. |
| 142 | */ |
John Richardson | 6f4d49f | 2017-09-07 11:21:10 +0100 | [diff] [blame] | 143 | inline std::string to_string(const MatrixPattern &pattern) |
| 144 | { |
| 145 | std::stringstream str; |
| 146 | str << pattern; |
| 147 | return str.str(); |
| 148 | } |
| 149 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 150 | /** Formatted output of the RoundingPolicy type. |
| 151 | * |
| 152 | * @param[out] os Output stream. |
| 153 | * @param[in] rounding_policy Type to output. |
| 154 | * |
| 155 | * @return Modified output stream. |
| 156 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 157 | inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 158 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 159 | switch(rounding_policy) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 160 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 161 | case RoundingPolicy::TO_ZERO: |
| 162 | os << "TO_ZERO"; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 163 | break; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 164 | case RoundingPolicy::TO_NEAREST_UP: |
| 165 | os << "TO_NEAREST_UP"; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 166 | break; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 167 | case RoundingPolicy::TO_NEAREST_EVEN: |
| 168 | os << "TO_NEAREST_EVEN"; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 169 | break; |
| 170 | default: |
| 171 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 172 | } |
| 173 | |
| 174 | return os; |
| 175 | } |
| 176 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 177 | /** Formatted output of the WeightsInfo type. |
| 178 | * |
| 179 | * @param[out] os Output stream. |
| 180 | * @param[in] weights_info Type to output. |
| 181 | * |
| 182 | * @return Modified output stream. |
| 183 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 184 | inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info) |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 185 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 186 | os << weights_info.are_reshaped() << ";"; |
| 187 | os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 188 | |
| 189 | return os; |
| 190 | } |
| 191 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 192 | /** Formatted output of the ROIPoolingInfo type. |
| 193 | * |
| 194 | * @param[out] os Output stream. |
| 195 | * @param[in] pool_info Type to output. |
| 196 | * |
| 197 | * @return Modified output stream. |
| 198 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 199 | inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info) |
Sanghoon Lee | 70f8291 | 2017-08-24 14:21:24 +0100 | [diff] [blame] | 200 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 201 | os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale(); |
Georgios Pinitas | d976958 | 2017-08-03 10:19:40 +0100 | [diff] [blame] | 202 | return os; |
| 203 | } |
| 204 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 205 | /** Formatted output of the QuantizationInfo type. |
| 206 | * |
| 207 | * @param[out] os Output stream. |
| 208 | * @param[in] quantization_info Type to output. |
| 209 | * |
| 210 | * @return Modified output stream. |
| 211 | */ |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 212 | inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &quantization_info) |
| 213 | { |
| 214 | os << "Scale:" << quantization_info.scale << "~" |
| 215 | << "Offset:" << quantization_info.offset; |
| 216 | return os; |
| 217 | } |
| 218 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 219 | /** Formatted output of the QuantizationInfo type. |
| 220 | * |
| 221 | * @param[in] quantization_info Type to output. |
| 222 | * |
| 223 | * @return Formatted string. |
| 224 | */ |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 225 | inline std::string to_string(const QuantizationInfo &quantization_info) |
| 226 | { |
| 227 | std::stringstream str; |
| 228 | str << quantization_info; |
| 229 | return str.str(); |
| 230 | } |
| 231 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 232 | /** Formatted output of the FixedPointOp type. |
| 233 | * |
| 234 | * @param[out] os Output stream. |
| 235 | * @param[in] op Type to output. |
| 236 | * |
| 237 | * @return Modified output stream. |
| 238 | */ |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 239 | inline ::std::ostream &operator<<(::std::ostream &os, const FixedPointOp &op) |
| 240 | { |
| 241 | switch(op) |
| 242 | { |
John Richardson | 70f946b | 2017-10-02 16:52:16 +0100 | [diff] [blame] | 243 | case FixedPointOp::ADD: |
| 244 | os << "ADD"; |
| 245 | break; |
| 246 | case FixedPointOp::SUB: |
| 247 | os << "SUB"; |
| 248 | break; |
| 249 | case FixedPointOp::MUL: |
| 250 | os << "MUL"; |
| 251 | break; |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 252 | case FixedPointOp::EXP: |
| 253 | os << "EXP"; |
| 254 | break; |
| 255 | case FixedPointOp::LOG: |
| 256 | os << "LOG"; |
| 257 | break; |
| 258 | case FixedPointOp::INV_SQRT: |
| 259 | os << "INV_SQRT"; |
| 260 | break; |
| 261 | case FixedPointOp::RECIPROCAL: |
| 262 | os << "RECIPROCAL"; |
| 263 | break; |
| 264 | default: |
| 265 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 266 | } |
| 267 | |
| 268 | return os; |
| 269 | } |
John Richardson | 70f946b | 2017-10-02 16:52:16 +0100 | [diff] [blame] | 270 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 271 | /** Formatted output of the FixedPointOp type. |
| 272 | * |
| 273 | * @param[in] op Type to output. |
| 274 | * |
| 275 | * @return Formatted string. |
| 276 | */ |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 277 | inline std::string to_string(const FixedPointOp &op) |
| 278 | { |
| 279 | std::stringstream str; |
| 280 | str << op; |
| 281 | return str.str(); |
| 282 | } |
| 283 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 284 | /** Formatted output of the activation function type. |
| 285 | * |
| 286 | * @param[out] os Output stream. |
| 287 | * @param[in] act_function Type to output. |
| 288 | * |
| 289 | * @return Modified output stream. |
| 290 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 291 | inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function) |
| 292 | { |
| 293 | switch(act_function) |
| 294 | { |
| 295 | case ActivationLayerInfo::ActivationFunction::ABS: |
| 296 | os << "ABS"; |
| 297 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 298 | case ActivationLayerInfo::ActivationFunction::LINEAR: |
| 299 | os << "LINEAR"; |
| 300 | break; |
| 301 | case ActivationLayerInfo::ActivationFunction::LOGISTIC: |
| 302 | os << "LOGISTIC"; |
| 303 | break; |
| 304 | case ActivationLayerInfo::ActivationFunction::RELU: |
| 305 | os << "RELU"; |
| 306 | break; |
Georgios Pinitas | 579c049 | 2017-07-12 16:12:12 +0100 | [diff] [blame] | 307 | case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU: |
| 308 | os << "BOUNDED_RELU"; |
| 309 | break; |
| 310 | case ActivationLayerInfo::ActivationFunction::LEAKY_RELU: |
| 311 | os << "LEAKY_RELU"; |
| 312 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 313 | case ActivationLayerInfo::ActivationFunction::SOFT_RELU: |
| 314 | os << "SOFT_RELU"; |
| 315 | break; |
| 316 | case ActivationLayerInfo::ActivationFunction::SQRT: |
| 317 | os << "SQRT"; |
| 318 | break; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 319 | case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU: |
| 320 | os << "LU_BOUNDED_RELU"; |
Kevin Petit | d9f8071 | 2017-12-06 12:18:48 +0000 | [diff] [blame] | 321 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 322 | case ActivationLayerInfo::ActivationFunction::SQUARE: |
| 323 | os << "SQUARE"; |
| 324 | break; |
| 325 | case ActivationLayerInfo::ActivationFunction::TANH: |
| 326 | os << "TANH"; |
| 327 | break; |
| 328 | default: |
| 329 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 330 | } |
| 331 | |
| 332 | return os; |
| 333 | } |
| 334 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 335 | /** Formatted output of the activation function info type. |
| 336 | * |
| 337 | * @param[in] info Type to output. |
| 338 | * |
| 339 | * @return Formatted string. |
| 340 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 341 | inline std::string to_string(const arm_compute::ActivationLayerInfo &info) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 342 | { |
| 343 | std::stringstream str; |
| 344 | str << info.activation(); |
| 345 | return str.str(); |
| 346 | } |
| 347 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 348 | /** Formatted output of the activation function type. |
| 349 | * |
| 350 | * @param[in] function Type to output. |
| 351 | * |
| 352 | * @return Formatted string. |
| 353 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 354 | inline std::string to_string(const arm_compute::ActivationLayerInfo::ActivationFunction &function) |
| 355 | { |
| 356 | std::stringstream str; |
| 357 | str << function; |
| 358 | return str.str(); |
| 359 | } |
| 360 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 361 | /** Formatted output of the NormType type. |
| 362 | * |
| 363 | * @param[out] os Output stream. |
| 364 | * @param[in] norm_type Type to output. |
| 365 | * |
| 366 | * @return Modified output stream. |
| 367 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 368 | inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type) |
| 369 | { |
| 370 | switch(norm_type) |
| 371 | { |
| 372 | case NormType::CROSS_MAP: |
| 373 | os << "CROSS_MAP"; |
| 374 | break; |
| 375 | case NormType::IN_MAP_1D: |
| 376 | os << "IN_MAP_1D"; |
| 377 | break; |
| 378 | case NormType::IN_MAP_2D: |
| 379 | os << "IN_MAP_2D"; |
| 380 | break; |
| 381 | default: |
| 382 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 383 | } |
| 384 | |
| 385 | return os; |
| 386 | } |
| 387 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 388 | /** Formatted output of @ref NormalizationLayerInfo. |
| 389 | * |
| 390 | * @param[in] info Type to output. |
| 391 | * |
| 392 | * @return Formatted string. |
| 393 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 394 | inline std::string to_string(const arm_compute::NormalizationLayerInfo &info) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 395 | { |
| 396 | std::stringstream str; |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 397 | str << info.type() << ":NormSize=" << info.norm_size(); |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 398 | return str.str(); |
| 399 | } |
| 400 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 401 | /** Formatted output of @ref NormalizationLayerInfo. |
| 402 | * |
| 403 | * @param[out] os Output stream. |
| 404 | * @param[in] info Type to output. |
| 405 | * |
| 406 | * @return Modified output stream. |
| 407 | */ |
Georgios Pinitas | 6f669f0 | 2017-09-26 12:32:57 +0100 | [diff] [blame] | 408 | inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info) |
| 409 | { |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 410 | os << info.type() << ":NormSize=" << info.norm_size(); |
Georgios Pinitas | 6f669f0 | 2017-09-26 12:32:57 +0100 | [diff] [blame] | 411 | return os; |
| 412 | } |
| 413 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 414 | /** Formatted output of the PoolingType type. |
| 415 | * |
| 416 | * @param[out] os Output stream. |
| 417 | * @param[in] pool_type Type to output. |
| 418 | * |
| 419 | * @return Modified output stream. |
| 420 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 421 | inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type) |
| 422 | { |
| 423 | switch(pool_type) |
| 424 | { |
| 425 | case PoolingType::AVG: |
| 426 | os << "AVG"; |
| 427 | break; |
| 428 | case PoolingType::MAX: |
| 429 | os << "MAX"; |
| 430 | break; |
Georgios Pinitas | cdf5145 | 2017-08-31 14:21:36 +0100 | [diff] [blame] | 431 | case PoolingType::L2: |
| 432 | os << "L2"; |
| 433 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 434 | default: |
| 435 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 436 | } |
| 437 | |
| 438 | return os; |
| 439 | } |
| 440 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 441 | /** Formatted output of @ref PoolingLayerInfo. |
| 442 | * |
| 443 | * @param[out] os Output stream. |
| 444 | * @param[in] info Type to output. |
| 445 | * |
| 446 | * @return Modified output stream. |
| 447 | */ |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 448 | inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info) |
| 449 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 450 | os << info.pool_type(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 451 | |
| 452 | return os; |
| 453 | } |
| 454 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 455 | /** Formatted output of @ref RoundingPolicy. |
| 456 | * |
| 457 | * @param[in] rounding_policy Type to output. |
| 458 | * |
| 459 | * @return Formatted string. |
| 460 | */ |
John Richardson | dd715f2 | 2017-09-18 16:10:48 +0100 | [diff] [blame] | 461 | inline std::string to_string(const RoundingPolicy &rounding_policy) |
| 462 | { |
| 463 | std::stringstream str; |
| 464 | str << rounding_policy; |
| 465 | return str.str(); |
| 466 | } |
| 467 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 468 | /** Formatted output of the DataLayout type. |
| 469 | * |
| 470 | * @param[out] os Output stream. |
| 471 | * @param[in] data_layout Type to output. |
| 472 | * |
| 473 | * @return Modified output stream. |
| 474 | */ |
Michele Di Giorgio | 4a65b98 | 2018-03-02 11:21:38 +0000 | [diff] [blame] | 475 | inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout) |
| 476 | { |
| 477 | switch(data_layout) |
| 478 | { |
| 479 | case DataLayout::UNKNOWN: |
| 480 | os << "UNKNOWN"; |
| 481 | break; |
| 482 | case DataLayout::NHWC: |
| 483 | os << "NHWC"; |
| 484 | break; |
| 485 | case DataLayout::NCHW: |
| 486 | os << "NCHW"; |
| 487 | break; |
| 488 | default: |
| 489 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 490 | } |
| 491 | |
| 492 | return os; |
| 493 | } |
| 494 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 495 | /** Formatted output of the DataLayout type. |
| 496 | * |
| 497 | * @param[in] data_layout Type to output. |
| 498 | * |
| 499 | * @return Formatted string. |
| 500 | */ |
Michele Di Giorgio | 4a65b98 | 2018-03-02 11:21:38 +0000 | [diff] [blame] | 501 | inline std::string to_string(const arm_compute::DataLayout &data_layout) |
| 502 | { |
| 503 | std::stringstream str; |
| 504 | str << data_layout; |
| 505 | return str.str(); |
| 506 | } |
| 507 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 508 | /** Formatted output of the DataType type. |
| 509 | * |
| 510 | * @param[out] os Output stream. |
| 511 | * @param[in] data_type Type to output. |
| 512 | * |
| 513 | * @return Modified output stream. |
| 514 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 515 | inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type) |
| 516 | { |
| 517 | switch(data_type) |
| 518 | { |
| 519 | case DataType::UNKNOWN: |
| 520 | os << "UNKNOWN"; |
| 521 | break; |
| 522 | case DataType::U8: |
| 523 | os << "U8"; |
| 524 | break; |
| 525 | case DataType::QS8: |
| 526 | os << "QS8"; |
| 527 | break; |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 528 | case DataType::QASYMM8: |
| 529 | os << "QASYMM8"; |
| 530 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 531 | case DataType::S8: |
| 532 | os << "S8"; |
| 533 | break; |
| 534 | case DataType::U16: |
| 535 | os << "U16"; |
| 536 | break; |
| 537 | case DataType::S16: |
| 538 | os << "S16"; |
| 539 | break; |
Gian Marco Iodice | bdb6b0b | 2017-06-30 12:21:00 +0100 | [diff] [blame] | 540 | case DataType::QS16: |
| 541 | os << "QS16"; |
| 542 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 543 | case DataType::U32: |
| 544 | os << "U32"; |
| 545 | break; |
| 546 | case DataType::S32: |
| 547 | os << "S32"; |
| 548 | break; |
| 549 | case DataType::U64: |
| 550 | os << "U64"; |
| 551 | break; |
| 552 | case DataType::S64: |
| 553 | os << "S64"; |
| 554 | break; |
| 555 | case DataType::F16: |
| 556 | os << "F16"; |
| 557 | break; |
| 558 | case DataType::F32: |
| 559 | os << "F32"; |
| 560 | break; |
| 561 | case DataType::F64: |
| 562 | os << "F64"; |
| 563 | break; |
| 564 | case DataType::SIZET: |
| 565 | os << "SIZET"; |
| 566 | break; |
| 567 | default: |
| 568 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 569 | } |
| 570 | |
| 571 | return os; |
| 572 | } |
| 573 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 574 | /** Formatted output of the DataType type. |
| 575 | * |
| 576 | * @param[in] data_type Type to output. |
| 577 | * |
| 578 | * @return Formatted string. |
| 579 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 580 | inline std::string to_string(const arm_compute::DataType &data_type) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 581 | { |
| 582 | std::stringstream str; |
| 583 | str << data_type; |
| 584 | return str.str(); |
| 585 | } |
| 586 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 587 | /** Formatted output of the Format type. |
| 588 | * |
| 589 | * @param[out] os Output stream. |
| 590 | * @param[in] format Type to output. |
| 591 | * |
| 592 | * @return Modified output stream. |
| 593 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 594 | inline ::std::ostream &operator<<(::std::ostream &os, const Format &format) |
| 595 | { |
| 596 | switch(format) |
| 597 | { |
| 598 | case Format::UNKNOWN: |
| 599 | os << "UNKNOWN"; |
| 600 | break; |
| 601 | case Format::U8: |
| 602 | os << "U8"; |
| 603 | break; |
| 604 | case Format::S16: |
| 605 | os << "S16"; |
| 606 | break; |
| 607 | case Format::U16: |
| 608 | os << "U16"; |
| 609 | break; |
| 610 | case Format::S32: |
| 611 | os << "S32"; |
| 612 | break; |
| 613 | case Format::U32: |
| 614 | os << "U32"; |
| 615 | break; |
| 616 | case Format::F16: |
| 617 | os << "F16"; |
| 618 | break; |
| 619 | case Format::F32: |
| 620 | os << "F32"; |
| 621 | break; |
| 622 | case Format::UV88: |
| 623 | os << "UV88"; |
| 624 | break; |
| 625 | case Format::RGB888: |
| 626 | os << "RGB888"; |
| 627 | break; |
| 628 | case Format::RGBA8888: |
| 629 | os << "RGBA8888"; |
| 630 | break; |
| 631 | case Format::YUV444: |
| 632 | os << "YUV444"; |
| 633 | break; |
| 634 | case Format::YUYV422: |
| 635 | os << "YUYV422"; |
| 636 | break; |
| 637 | case Format::NV12: |
| 638 | os << "NV12"; |
| 639 | break; |
| 640 | case Format::NV21: |
| 641 | os << "NV21"; |
| 642 | break; |
| 643 | case Format::IYUV: |
| 644 | os << "IYUV"; |
| 645 | break; |
| 646 | case Format::UYVY422: |
| 647 | os << "UYVY422"; |
| 648 | break; |
| 649 | default: |
| 650 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 651 | } |
| 652 | |
| 653 | return os; |
| 654 | } |
| 655 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 656 | /** Formatted output of the Format type. |
| 657 | * |
| 658 | * @param[in] format Type to output. |
| 659 | * |
| 660 | * @return Formatted string. |
| 661 | */ |
Moritz Pflanzer | 7655a67 | 2017-09-23 11:57:33 +0100 | [diff] [blame] | 662 | inline std::string to_string(const Format &format) |
| 663 | { |
| 664 | std::stringstream str; |
| 665 | str << format; |
| 666 | return str.str(); |
| 667 | } |
| 668 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 669 | /** Formatted output of the Channel type. |
| 670 | * |
| 671 | * @param[out] os Output stream. |
| 672 | * @param[in] channel Type to output. |
| 673 | * |
| 674 | * @return Modified output stream. |
| 675 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 676 | inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel) |
| 677 | { |
| 678 | switch(channel) |
| 679 | { |
| 680 | case Channel::UNKNOWN: |
| 681 | os << "UNKNOWN"; |
| 682 | break; |
| 683 | case Channel::C0: |
| 684 | os << "C0"; |
| 685 | break; |
| 686 | case Channel::C1: |
| 687 | os << "C1"; |
| 688 | break; |
| 689 | case Channel::C2: |
| 690 | os << "C2"; |
| 691 | break; |
| 692 | case Channel::C3: |
| 693 | os << "C3"; |
| 694 | break; |
| 695 | case Channel::R: |
| 696 | os << "R"; |
| 697 | break; |
| 698 | case Channel::G: |
| 699 | os << "G"; |
| 700 | break; |
| 701 | case Channel::B: |
| 702 | os << "B"; |
| 703 | break; |
| 704 | case Channel::A: |
| 705 | os << "A"; |
| 706 | break; |
| 707 | case Channel::Y: |
| 708 | os << "Y"; |
| 709 | break; |
| 710 | case Channel::U: |
| 711 | os << "U"; |
| 712 | break; |
| 713 | case Channel::V: |
| 714 | os << "V"; |
| 715 | break; |
| 716 | default: |
| 717 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 718 | } |
| 719 | |
| 720 | return os; |
| 721 | } |
| 722 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 723 | /** Formatted output of the Channel type. |
| 724 | * |
| 725 | * @param[in] channel Type to output. |
| 726 | * |
| 727 | * @return Formatted string. |
| 728 | */ |
Ioan-Cristian Szabo | 9414f64 | 2017-10-27 17:35:40 +0100 | [diff] [blame] | 729 | inline std::string to_string(const Channel &channel) |
| 730 | { |
| 731 | std::stringstream str; |
| 732 | str << channel; |
| 733 | return str.str(); |
| 734 | } |
| 735 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 736 | /** Formatted output of the BorderMode type. |
| 737 | * |
| 738 | * @param[out] os Output stream. |
| 739 | * @param[in] mode Type to output. |
| 740 | * |
| 741 | * @return Modified output stream. |
| 742 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 743 | inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode) |
| 744 | { |
| 745 | switch(mode) |
| 746 | { |
| 747 | case BorderMode::UNDEFINED: |
| 748 | os << "UNDEFINED"; |
| 749 | break; |
| 750 | case BorderMode::CONSTANT: |
| 751 | os << "CONSTANT"; |
| 752 | break; |
| 753 | case BorderMode::REPLICATE: |
| 754 | os << "REPLICATE"; |
| 755 | break; |
| 756 | default: |
| 757 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 758 | } |
| 759 | |
| 760 | return os; |
| 761 | } |
| 762 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 763 | /** Formatted output of the BorderSize type. |
| 764 | * |
| 765 | * @param[out] os Output stream. |
| 766 | * @param[in] border Type to output. |
| 767 | * |
| 768 | * @return Modified output stream. |
| 769 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 770 | inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border) |
| 771 | { |
Moritz Pflanzer | c87fbf8 | 2017-07-18 14:02:10 +0100 | [diff] [blame] | 772 | os << border.top << "," |
| 773 | << border.right << "," |
| 774 | << border.bottom << "," |
| 775 | << border.left; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 776 | |
| 777 | return os; |
| 778 | } |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 779 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 780 | /** Formatted output of the InterpolationPolicy type. |
| 781 | * |
| 782 | * @param[out] os Output stream. |
| 783 | * @param[in] policy Type to output. |
| 784 | * |
| 785 | * @return Modified output stream. |
| 786 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 787 | inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy) |
| 788 | { |
| 789 | switch(policy) |
| 790 | { |
| 791 | case InterpolationPolicy::NEAREST_NEIGHBOR: |
| 792 | os << "NEAREST_NEIGHBOR"; |
| 793 | break; |
| 794 | case InterpolationPolicy::BILINEAR: |
| 795 | os << "BILINEAR"; |
| 796 | break; |
| 797 | case InterpolationPolicy::AREA: |
| 798 | os << "AREA"; |
| 799 | break; |
| 800 | default: |
| 801 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 802 | } |
| 803 | |
| 804 | return os; |
| 805 | } |
| 806 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 807 | /** Formatted output of the SamplingPolicy type. |
| 808 | * |
| 809 | * @param[out] os Output stream. |
| 810 | * @param[in] policy Type to output. |
| 811 | * |
| 812 | * @return Modified output stream. |
| 813 | */ |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 814 | inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy) |
| 815 | { |
| 816 | switch(policy) |
| 817 | { |
| 818 | case SamplingPolicy::CENTER: |
| 819 | os << "CENTER"; |
| 820 | break; |
| 821 | case SamplingPolicy::TOP_LEFT: |
| 822 | os << "TOP_LEFT"; |
| 823 | break; |
| 824 | default: |
| 825 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 826 | } |
| 827 | |
| 828 | return os; |
| 829 | } |
| 830 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 831 | /** Formatted output of the TensorInfo type. |
| 832 | * |
| 833 | * @param[in] info Type to output. |
| 834 | * |
| 835 | * @return Formatted string. |
| 836 | */ |
Georgios Pinitas | 3faea25 | 2017-10-30 14:13:50 +0000 | [diff] [blame] | 837 | inline std::string to_string(const TensorInfo &info) |
| 838 | { |
| 839 | std::stringstream str; |
| 840 | str << "{Shape=" << info.tensor_shape() << "," |
| 841 | << "Type=" << info.data_type() << "," |
| 842 | << "Channels=" << info.num_channels() << "," |
| 843 | << "FixedPointPos=" << info.fixed_point_position() << "}"; |
| 844 | return str.str(); |
| 845 | } |
| 846 | |
Abe Mbise | 925ca0f | 2017-10-02 19:16:33 +0100 | [diff] [blame] | 847 | //FIXME: Check why this doesn't work and the TensorShape and Coordinates overload are needed |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 848 | /** Formatted output of the Dimensions type. |
| 849 | * |
| 850 | * @param[in] dimensions Type to output. |
| 851 | * |
| 852 | * @return Formatted string. |
| 853 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 854 | template <typename T> |
| 855 | inline std::string to_string(const Dimensions<T> &dimensions) |
| 856 | { |
| 857 | std::stringstream str; |
| 858 | str << dimensions; |
| 859 | return str.str(); |
| 860 | } |
| 861 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 862 | /** Formatted output of the Strides type. |
| 863 | * |
| 864 | * @param[in] stride Type to output. |
| 865 | * |
| 866 | * @return Formatted string. |
| 867 | */ |
John Richardson | a36eae1 | 2017-09-26 16:55:59 +0100 | [diff] [blame] | 868 | inline std::string to_string(const Strides &stride) |
| 869 | { |
| 870 | std::stringstream str; |
| 871 | str << stride; |
| 872 | return str.str(); |
| 873 | } |
| 874 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 875 | /** Formatted output of the TensorShape type. |
| 876 | * |
| 877 | * @param[in] shape Type to output. |
| 878 | * |
| 879 | * @return Formatted string. |
| 880 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 881 | inline std::string to_string(const TensorShape &shape) |
| 882 | { |
| 883 | std::stringstream str; |
| 884 | str << shape; |
| 885 | return str.str(); |
| 886 | } |
| 887 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 888 | /** Formatted output of the Coordinates type. |
| 889 | * |
| 890 | * @param[in] coord Type to output. |
| 891 | * |
| 892 | * @return Formatted string. |
| 893 | */ |
Abe Mbise | 925ca0f | 2017-10-02 19:16:33 +0100 | [diff] [blame] | 894 | inline std::string to_string(const Coordinates &coord) |
| 895 | { |
| 896 | std::stringstream str; |
| 897 | str << coord; |
| 898 | return str.str(); |
| 899 | } |
| 900 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 901 | /** Formatted output of the Rectangle type. |
| 902 | * |
| 903 | * @param[out] os Output stream. |
| 904 | * @param[in] rect Type to output. |
| 905 | * |
| 906 | * @return Modified output stream. |
| 907 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 908 | inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect) |
| 909 | { |
| 910 | os << rect.width << "x" << rect.height; |
| 911 | os << "+" << rect.x << "+" << rect.y; |
| 912 | |
| 913 | return os; |
| 914 | } |
| 915 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 916 | /** Formatted output of the PadStrideInfo type. |
| 917 | * |
| 918 | * @param[out] os Output stream. |
| 919 | * @param[in] pad_stride_info Type to output. |
| 920 | * |
| 921 | * @return Modified output stream. |
| 922 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 923 | inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info) |
| 924 | { |
| 925 | os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second; |
| 926 | os << ";"; |
Jaroslaw Rzepecki | a1ed41f | 2017-10-13 11:13:58 +0100 | [diff] [blame] | 927 | os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << "," |
| 928 | << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom(); |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 929 | |
| 930 | return os; |
| 931 | } |
| 932 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 933 | /** Formatted output of the PadStrideInfo type. |
| 934 | * |
| 935 | * @param[in] pad_stride_info Type to output. |
| 936 | * |
| 937 | * @return Formatted string. |
| 938 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 939 | inline std::string to_string(const PadStrideInfo &pad_stride_info) |
| 940 | { |
| 941 | std::stringstream str; |
| 942 | str << pad_stride_info; |
| 943 | return str.str(); |
| 944 | } |
| 945 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 946 | /** Formatted output of the BorderMode type. |
| 947 | * |
| 948 | * @param[in] mode Type to output. |
| 949 | * |
| 950 | * @return Formatted string. |
| 951 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 952 | inline std::string to_string(const BorderMode &mode) |
| 953 | { |
| 954 | std::stringstream str; |
| 955 | str << mode; |
| 956 | return str.str(); |
| 957 | } |
| 958 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 959 | /** Formatted output of the BorderSize type. |
| 960 | * |
| 961 | * @param[in] border Type to output. |
| 962 | * |
| 963 | * @return Formatted string. |
| 964 | */ |
John Richardson | b482ce1 | 2017-09-18 12:44:01 +0100 | [diff] [blame] | 965 | inline std::string to_string(const BorderSize &border) |
| 966 | { |
| 967 | std::stringstream str; |
| 968 | str << border; |
| 969 | return str.str(); |
| 970 | } |
| 971 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 972 | /** Formatted output of the InterpolationPolicy type. |
| 973 | * |
| 974 | * @param[in] policy Type to output. |
| 975 | * |
| 976 | * @return Formatted string. |
| 977 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 978 | inline std::string to_string(const InterpolationPolicy &policy) |
| 979 | { |
| 980 | std::stringstream str; |
| 981 | str << policy; |
| 982 | return str.str(); |
| 983 | } |
| 984 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 985 | /** Formatted output of the SamplingPolicy type. |
| 986 | * |
| 987 | * @param[in] policy Type to output. |
| 988 | * |
| 989 | * @return Formatted string. |
| 990 | */ |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 991 | inline std::string to_string(const SamplingPolicy &policy) |
| 992 | { |
| 993 | std::stringstream str; |
| 994 | str << policy; |
| 995 | return str.str(); |
| 996 | } |
| 997 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 998 | /** Formatted output of the ConvertPolicy type. |
| 999 | * |
| 1000 | * @param[out] os Output stream. |
| 1001 | * @param[in] policy Type to output. |
| 1002 | * |
| 1003 | * @return Modified output stream. |
| 1004 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1005 | inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy) |
| 1006 | { |
| 1007 | switch(policy) |
| 1008 | { |
| 1009 | case ConvertPolicy::WRAP: |
| 1010 | os << "WRAP"; |
| 1011 | break; |
| 1012 | case ConvertPolicy::SATURATE: |
| 1013 | os << "SATURATE"; |
| 1014 | break; |
| 1015 | default: |
| 1016 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1017 | } |
| 1018 | |
| 1019 | return os; |
| 1020 | } |
| 1021 | |
| 1022 | inline std::string to_string(const ConvertPolicy &policy) |
| 1023 | { |
| 1024 | std::stringstream str; |
| 1025 | str << policy; |
| 1026 | return str.str(); |
| 1027 | } |
| 1028 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1029 | /** Formatted output of the Reduction Operations. |
| 1030 | * |
| 1031 | * @param[out] os Output stream. |
| 1032 | * @param[in] op Type to output. |
| 1033 | * |
| 1034 | * @return Modified output stream. |
| 1035 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1036 | inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op) |
| 1037 | { |
| 1038 | switch(op) |
| 1039 | { |
| 1040 | case ReductionOperation::SUM_SQUARE: |
| 1041 | os << "SUM_SQUARE"; |
| 1042 | break; |
| 1043 | default: |
| 1044 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1045 | } |
| 1046 | |
| 1047 | return os; |
| 1048 | } |
| 1049 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1050 | /** Formatted output of the Reduction Operations. |
| 1051 | * |
| 1052 | * @param[in] op Type to output. |
| 1053 | * |
| 1054 | * @return Formatted string. |
| 1055 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1056 | inline std::string to_string(const ReductionOperation &op) |
| 1057 | { |
| 1058 | std::stringstream str; |
| 1059 | str << op; |
| 1060 | return str.str(); |
| 1061 | } |
| 1062 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1063 | /** Formatted output of the Norm Type. |
| 1064 | * |
| 1065 | * @param[in] type Type to output. |
| 1066 | * |
| 1067 | * @return Formatted string. |
| 1068 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1069 | inline std::string to_string(const NormType &type) |
| 1070 | { |
| 1071 | std::stringstream str; |
| 1072 | str << type; |
| 1073 | return str.str(); |
| 1074 | } |
| 1075 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1076 | /** Formatted output of the Pooling Type. |
| 1077 | * |
| 1078 | * @param[in] type Type to output. |
| 1079 | * |
| 1080 | * @return Formatted string. |
| 1081 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1082 | inline std::string to_string(const PoolingType &type) |
| 1083 | { |
| 1084 | std::stringstream str; |
| 1085 | str << type; |
| 1086 | return str.str(); |
| 1087 | } |
| 1088 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1089 | /** Formatted output of the Pooling Layer Info. |
| 1090 | * |
| 1091 | * @param[in] info Type to output. |
| 1092 | * |
| 1093 | * @return Formatted string. |
| 1094 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1095 | inline std::string to_string(const PoolingLayerInfo &info) |
| 1096 | { |
| 1097 | std::stringstream str; |
Georgios Pinitas | 4c2dd54 | 2017-11-13 12:58:41 +0000 | [diff] [blame] | 1098 | str << "{Type=" << info.pool_type() << "," |
| 1099 | << "IsGlobalPooling=" << info.is_global_pooling(); |
| 1100 | if(!info.is_global_pooling()) |
| 1101 | { |
| 1102 | str << "," |
Isabella Gottardi | 6e464c3 | 2018-01-26 12:32:45 +0000 | [diff] [blame] | 1103 | << "PoolSize=" << info.pool_size().width << "," << info.pool_size().height << "," |
Georgios Pinitas | 4c2dd54 | 2017-11-13 12:58:41 +0000 | [diff] [blame] | 1104 | << "PadStride=" << info.pad_stride_info(); |
| 1105 | } |
| 1106 | str << "}"; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1107 | return str.str(); |
| 1108 | } |
| 1109 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1110 | /** Formatted output of the KeyPoint type. |
| 1111 | * |
| 1112 | * @param[out] os Output stream |
| 1113 | * @param[in] point Type to output. |
| 1114 | * |
| 1115 | * @return Modified output stream. |
| 1116 | */ |
Moritz Pflanzer | 6c6597c | 2017-09-24 12:09:41 +0100 | [diff] [blame] | 1117 | inline ::std::ostream &operator<<(::std::ostream &os, const KeyPoint &point) |
| 1118 | { |
| 1119 | os << "{x=" << point.x << "," |
| 1120 | << "y=" << point.y << "," |
| 1121 | << "strength=" << point.strength << "," |
| 1122 | << "scale=" << point.scale << "," |
| 1123 | << "orientation=" << point.orientation << "," |
| 1124 | << "tracking_status=" << point.tracking_status << "," |
| 1125 | << "error=" << point.error << "}"; |
| 1126 | |
| 1127 | return os; |
| 1128 | } |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 1129 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1130 | /** Formatted output of the PhaseType type. |
| 1131 | * |
| 1132 | * @param[out] os Output stream |
| 1133 | * @param[in] phase_type Type to output. |
| 1134 | * |
| 1135 | * @return Modified output stream. |
| 1136 | */ |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 1137 | inline ::std::ostream &operator<<(::std::ostream &os, const PhaseType &phase_type) |
| 1138 | { |
| 1139 | switch(phase_type) |
| 1140 | { |
| 1141 | case PhaseType::SIGNED: |
| 1142 | os << "SIGNED"; |
| 1143 | break; |
| 1144 | case PhaseType::UNSIGNED: |
| 1145 | os << "UNSIGNED"; |
| 1146 | break; |
| 1147 | default: |
| 1148 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1149 | } |
| 1150 | |
| 1151 | return os; |
| 1152 | } |
| 1153 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1154 | /** Formatted output of the PhaseType type. |
| 1155 | * |
| 1156 | * @param[in] type Type to output. |
| 1157 | * |
| 1158 | * @return Formatted string. |
| 1159 | */ |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 1160 | inline std::string to_string(const arm_compute::PhaseType &type) |
| 1161 | { |
| 1162 | std::stringstream str; |
| 1163 | str << type; |
| 1164 | return str.str(); |
| 1165 | } |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 1166 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1167 | /** Formatted output of the MagnitudeType type. |
| 1168 | * |
| 1169 | * @param[out] os Output stream |
| 1170 | * @param[in] magnitude_type Type to output. |
| 1171 | * |
| 1172 | * @return Modified output stream. |
| 1173 | */ |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 1174 | inline ::std::ostream &operator<<(::std::ostream &os, const MagnitudeType &magnitude_type) |
| 1175 | { |
| 1176 | switch(magnitude_type) |
| 1177 | { |
| 1178 | case MagnitudeType::L1NORM: |
| 1179 | os << "L1NORM"; |
| 1180 | break; |
| 1181 | case MagnitudeType::L2NORM: |
| 1182 | os << "L2NORM"; |
| 1183 | break; |
| 1184 | default: |
| 1185 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1186 | } |
| 1187 | |
| 1188 | return os; |
| 1189 | } |
| 1190 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1191 | /** Formatted output of the MagnitudeType type. |
| 1192 | * |
| 1193 | * @param[in] type Type to output. |
| 1194 | * |
| 1195 | * @return Formatted string. |
| 1196 | */ |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 1197 | inline std::string to_string(const arm_compute::MagnitudeType &type) |
| 1198 | { |
| 1199 | std::stringstream str; |
| 1200 | str << type; |
| 1201 | return str.str(); |
| 1202 | } |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 1203 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1204 | /** Formatted output of the GradientDimension type. |
| 1205 | * |
| 1206 | * @param[out] os Output stream |
| 1207 | * @param[in] dim Type to output |
| 1208 | * |
| 1209 | * @return Modified output stream. |
| 1210 | */ |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 1211 | inline ::std::ostream &operator<<(::std::ostream &os, const GradientDimension &dim) |
| 1212 | { |
| 1213 | switch(dim) |
| 1214 | { |
| 1215 | case GradientDimension::GRAD_X: |
| 1216 | os << "GRAD_X"; |
| 1217 | break; |
| 1218 | case GradientDimension::GRAD_Y: |
| 1219 | os << "GRAD_Y"; |
| 1220 | break; |
| 1221 | case GradientDimension::GRAD_XY: |
| 1222 | os << "GRAD_XY"; |
| 1223 | break; |
| 1224 | default: |
| 1225 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1226 | } |
| 1227 | |
| 1228 | return os; |
| 1229 | } |
| 1230 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1231 | /** Formatted output of the GradientDimension type. |
| 1232 | * |
| 1233 | * @param[in] type Type to output |
| 1234 | * |
| 1235 | * @return Formatted string. |
| 1236 | */ |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 1237 | inline std::string to_string(const arm_compute::GradientDimension &type) |
| 1238 | { |
| 1239 | std::stringstream str; |
| 1240 | str << type; |
| 1241 | return str.str(); |
| 1242 | } |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1243 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1244 | /** Formatted output of the HOGNormType type. |
| 1245 | * |
| 1246 | * @param[out] os Output stream |
| 1247 | * @param[in] norm_type Type to output |
| 1248 | * |
| 1249 | * @return Modified output stream. |
| 1250 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1251 | inline ::std::ostream &operator<<(::std::ostream &os, const HOGNormType &norm_type) |
| 1252 | { |
| 1253 | switch(norm_type) |
| 1254 | { |
| 1255 | case HOGNormType::L1_NORM: |
| 1256 | os << "L1_NORM"; |
| 1257 | break; |
| 1258 | case HOGNormType::L2_NORM: |
| 1259 | os << "L2_NORM"; |
| 1260 | break; |
| 1261 | case HOGNormType::L2HYS_NORM: |
| 1262 | os << "L2HYS_NORM"; |
| 1263 | break; |
| 1264 | default: |
| 1265 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1266 | } |
| 1267 | |
| 1268 | return os; |
| 1269 | } |
| 1270 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1271 | /** Formatted output of the HOGNormType type. |
| 1272 | * |
| 1273 | * @param[in] type Type to output |
| 1274 | * |
| 1275 | * @return Formatted string. |
| 1276 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1277 | inline std::string to_string(const HOGNormType &type) |
| 1278 | { |
| 1279 | std::stringstream str; |
| 1280 | str << type; |
| 1281 | return str.str(); |
| 1282 | } |
| 1283 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1284 | /** Formatted output of the Size2D type. |
| 1285 | * |
| 1286 | * @param[out] os Output stream |
| 1287 | * @param[in] size Type to output |
| 1288 | * |
| 1289 | * @return Modified output stream. |
| 1290 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1291 | inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size) |
| 1292 | { |
| 1293 | os << size.width << "x" << size.height; |
| 1294 | |
| 1295 | return os; |
| 1296 | } |
| 1297 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1298 | /** Formatted output of the Size2D type. |
| 1299 | * |
| 1300 | * @param[in] type Type to output |
| 1301 | * |
| 1302 | * @return Formatted string. |
| 1303 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1304 | inline std::string to_string(const Size2D &type) |
| 1305 | { |
| 1306 | std::stringstream str; |
| 1307 | str << type; |
| 1308 | return str.str(); |
| 1309 | } |
| 1310 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1311 | /** Formatted output of the HOGInfo type. |
| 1312 | * |
| 1313 | * @param[out] os Output stream |
| 1314 | * @param[in] hog_info Type to output |
| 1315 | * |
| 1316 | * @return Modified output stream. |
| 1317 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1318 | inline ::std::ostream &operator<<(::std::ostream &os, const HOGInfo &hog_info) |
| 1319 | { |
| 1320 | os << "{CellSize=" << hog_info.cell_size() << "," |
| 1321 | << "BlockSize=" << hog_info.block_size() << "," |
| 1322 | << "DetectionWindowSize=" << hog_info.detection_window_size() << "," |
| 1323 | << "BlockStride=" << hog_info.block_stride() << "," |
| 1324 | << "NumBins=" << hog_info.num_bins() << "," |
| 1325 | << "NormType=" << hog_info.normalization_type() << "," |
| 1326 | << "L2HystThreshold=" << hog_info.l2_hyst_threshold() << "," |
| 1327 | << "PhaseType=" << hog_info.phase_type() << "}"; |
| 1328 | |
| 1329 | return os; |
| 1330 | } |
| 1331 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1332 | /** Formatted output of the HOGInfo type. |
| 1333 | * |
| 1334 | * @param[in] type Type to output |
| 1335 | * |
| 1336 | * @return Formatted string. |
| 1337 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1338 | inline std::string to_string(const HOGInfo &type) |
| 1339 | { |
| 1340 | std::stringstream str; |
| 1341 | str << type; |
| 1342 | return str.str(); |
| 1343 | } |
| 1344 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1345 | /** Formatted output of the ConvolutionMethod type. |
| 1346 | * |
| 1347 | * @param[out] os Output stream |
| 1348 | * @param[in] conv_method Type to output |
| 1349 | * |
| 1350 | * @return Modified output stream. |
| 1351 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1352 | inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method) |
| 1353 | { |
| 1354 | switch(conv_method) |
| 1355 | { |
| 1356 | case ConvolutionMethod::GEMM: |
| 1357 | os << "GEMM"; |
| 1358 | break; |
| 1359 | case ConvolutionMethod::DIRECT: |
| 1360 | os << "DIRECT"; |
| 1361 | break; |
| 1362 | case ConvolutionMethod::WINOGRAD: |
| 1363 | os << "WINOGRAD"; |
| 1364 | break; |
| 1365 | default: |
| 1366 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1367 | } |
| 1368 | |
| 1369 | return os; |
| 1370 | } |
| 1371 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1372 | /** Formatted output of the ConvolutionMethod type. |
| 1373 | * |
| 1374 | * @param[in] conv_method Type to output |
| 1375 | * |
| 1376 | * @return Formatted string. |
| 1377 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1378 | inline std::string to_string(const ConvolutionMethod &conv_method) |
| 1379 | { |
| 1380 | std::stringstream str; |
| 1381 | str << conv_method; |
| 1382 | return str.str(); |
| 1383 | } |
| 1384 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1385 | /** Formatted output of the GPUTarget type. |
| 1386 | * |
| 1387 | * @param[out] os Output stream |
| 1388 | * @param[in] gpu_target Type to output |
| 1389 | * |
| 1390 | * @return Modified output stream. |
| 1391 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1392 | inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target) |
| 1393 | { |
| 1394 | switch(gpu_target) |
| 1395 | { |
| 1396 | case GPUTarget::GPU_ARCH_MASK: |
| 1397 | os << "GPU_ARCH_MASK"; |
| 1398 | break; |
| 1399 | case GPUTarget::MIDGARD: |
| 1400 | os << "MIDGARD"; |
| 1401 | break; |
| 1402 | case GPUTarget::BIFROST: |
| 1403 | os << "BIFROST"; |
| 1404 | break; |
| 1405 | case GPUTarget::T600: |
| 1406 | os << "T600"; |
| 1407 | break; |
| 1408 | case GPUTarget::T700: |
| 1409 | os << "T700"; |
| 1410 | break; |
| 1411 | case GPUTarget::T800: |
| 1412 | os << "T800"; |
| 1413 | break; |
Michalis Spyrou | a967611 | 2018-02-22 18:07:43 +0000 | [diff] [blame] | 1414 | case GPUTarget::G71: |
| 1415 | os << "G71"; |
| 1416 | break; |
| 1417 | case GPUTarget::G72: |
| 1418 | os << "G72"; |
| 1419 | break; |
| 1420 | case GPUTarget::G51: |
| 1421 | os << "G51"; |
| 1422 | break; |
| 1423 | case GPUTarget::G51BIG: |
| 1424 | os << "G51BIG"; |
| 1425 | break; |
| 1426 | case GPUTarget::G51LIT: |
| 1427 | os << "G51LIT"; |
| 1428 | break; |
| 1429 | case GPUTarget::TNOX: |
| 1430 | os << "TNOX"; |
| 1431 | break; |
| 1432 | case GPUTarget::TTRX: |
| 1433 | os << "TTRX"; |
| 1434 | break; |
| 1435 | case GPUTarget::TBOX: |
| 1436 | os << "TBOX"; |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1437 | break; |
| 1438 | default: |
| 1439 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1440 | } |
| 1441 | |
| 1442 | return os; |
| 1443 | } |
| 1444 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1445 | /** Formatted output of the GPUTarget type. |
| 1446 | * |
| 1447 | * @param[in] gpu_target Type to output |
| 1448 | * |
| 1449 | * @return Formatted string. |
| 1450 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1451 | inline std::string to_string(const GPUTarget &gpu_target) |
| 1452 | { |
| 1453 | std::stringstream str; |
| 1454 | str << gpu_target; |
| 1455 | return str.str(); |
| 1456 | } |
John Richardson | 684cb0f | 2018-01-09 11:17:00 +0000 | [diff] [blame^] | 1457 | /** Formatted output of the DetectionWindow type. */ |
| 1458 | inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window) |
| 1459 | { |
| 1460 | os << "{x=" << detection_window.x << "," |
| 1461 | << "y=" << detection_window.y << "," |
| 1462 | << "width=" << detection_window.width << "," |
| 1463 | << "height=" << detection_window.height << "," |
| 1464 | << "idx_class=" << detection_window.idx_class << "," |
| 1465 | << "score=" << detection_window.score << "}"; |
| 1466 | |
| 1467 | return os; |
| 1468 | } |
| 1469 | |
| 1470 | inline std::string to_string(const DetectionWindow &type) |
| 1471 | { |
| 1472 | std::stringstream str; |
| 1473 | str << type; |
| 1474 | return str.str(); |
| 1475 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1476 | } // namespace arm_compute |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1477 | #endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */ |