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; |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 344 | if(info.enabled()) |
| 345 | { |
| 346 | str << info.activation(); |
| 347 | } |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 348 | return str.str(); |
| 349 | } |
| 350 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 351 | /** Formatted output of the activation function type. |
| 352 | * |
| 353 | * @param[in] function Type to output. |
| 354 | * |
| 355 | * @return Formatted string. |
| 356 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 357 | inline std::string to_string(const arm_compute::ActivationLayerInfo::ActivationFunction &function) |
| 358 | { |
| 359 | std::stringstream str; |
| 360 | str << function; |
| 361 | return str.str(); |
| 362 | } |
| 363 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 364 | /** Formatted output of the NormType type. |
| 365 | * |
| 366 | * @param[out] os Output stream. |
| 367 | * @param[in] norm_type Type to output. |
| 368 | * |
| 369 | * @return Modified output stream. |
| 370 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 371 | inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type) |
| 372 | { |
| 373 | switch(norm_type) |
| 374 | { |
| 375 | case NormType::CROSS_MAP: |
| 376 | os << "CROSS_MAP"; |
| 377 | break; |
| 378 | case NormType::IN_MAP_1D: |
| 379 | os << "IN_MAP_1D"; |
| 380 | break; |
| 381 | case NormType::IN_MAP_2D: |
| 382 | os << "IN_MAP_2D"; |
| 383 | break; |
| 384 | default: |
| 385 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 386 | } |
| 387 | |
| 388 | return os; |
| 389 | } |
| 390 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 391 | /** Formatted output of @ref NormalizationLayerInfo. |
| 392 | * |
| 393 | * @param[in] info Type to output. |
| 394 | * |
| 395 | * @return Formatted string. |
| 396 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 397 | inline std::string to_string(const arm_compute::NormalizationLayerInfo &info) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 398 | { |
| 399 | std::stringstream str; |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 400 | str << info.type() << ":NormSize=" << info.norm_size(); |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 401 | return str.str(); |
| 402 | } |
| 403 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 404 | /** Formatted output of @ref NormalizationLayerInfo. |
| 405 | * |
| 406 | * @param[out] os Output stream. |
| 407 | * @param[in] info Type to output. |
| 408 | * |
| 409 | * @return Modified output stream. |
| 410 | */ |
Georgios Pinitas | 6f669f0 | 2017-09-26 12:32:57 +0100 | [diff] [blame] | 411 | inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info) |
| 412 | { |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 413 | os << info.type() << ":NormSize=" << info.norm_size(); |
Georgios Pinitas | 6f669f0 | 2017-09-26 12:32:57 +0100 | [diff] [blame] | 414 | return os; |
| 415 | } |
| 416 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 417 | /** Formatted output of the PoolingType type. |
| 418 | * |
| 419 | * @param[out] os Output stream. |
| 420 | * @param[in] pool_type Type to output. |
| 421 | * |
| 422 | * @return Modified output stream. |
| 423 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 424 | inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type) |
| 425 | { |
| 426 | switch(pool_type) |
| 427 | { |
| 428 | case PoolingType::AVG: |
| 429 | os << "AVG"; |
| 430 | break; |
| 431 | case PoolingType::MAX: |
| 432 | os << "MAX"; |
| 433 | break; |
Georgios Pinitas | cdf5145 | 2017-08-31 14:21:36 +0100 | [diff] [blame] | 434 | case PoolingType::L2: |
| 435 | os << "L2"; |
| 436 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 437 | default: |
| 438 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 439 | } |
| 440 | |
| 441 | return os; |
| 442 | } |
| 443 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 444 | /** Formatted output of @ref PoolingLayerInfo. |
| 445 | * |
| 446 | * @param[out] os Output stream. |
| 447 | * @param[in] info Type to output. |
| 448 | * |
| 449 | * @return Modified output stream. |
| 450 | */ |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 451 | inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info) |
| 452 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 453 | os << info.pool_type(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 454 | |
| 455 | return os; |
| 456 | } |
| 457 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 458 | /** Formatted output of @ref RoundingPolicy. |
| 459 | * |
| 460 | * @param[in] rounding_policy Type to output. |
| 461 | * |
| 462 | * @return Formatted string. |
| 463 | */ |
John Richardson | dd715f2 | 2017-09-18 16:10:48 +0100 | [diff] [blame] | 464 | inline std::string to_string(const RoundingPolicy &rounding_policy) |
| 465 | { |
| 466 | std::stringstream str; |
| 467 | str << rounding_policy; |
| 468 | return str.str(); |
| 469 | } |
| 470 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 471 | /** Formatted output of the DataLayout type. |
| 472 | * |
| 473 | * @param[out] os Output stream. |
| 474 | * @param[in] data_layout Type to output. |
| 475 | * |
| 476 | * @return Modified output stream. |
| 477 | */ |
Michele Di Giorgio | 4a65b98 | 2018-03-02 11:21:38 +0000 | [diff] [blame] | 478 | inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout) |
| 479 | { |
| 480 | switch(data_layout) |
| 481 | { |
| 482 | case DataLayout::UNKNOWN: |
| 483 | os << "UNKNOWN"; |
| 484 | break; |
| 485 | case DataLayout::NHWC: |
| 486 | os << "NHWC"; |
| 487 | break; |
| 488 | case DataLayout::NCHW: |
| 489 | os << "NCHW"; |
| 490 | break; |
| 491 | default: |
| 492 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 493 | } |
| 494 | |
| 495 | return os; |
| 496 | } |
| 497 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 498 | /** Formatted output of the DataLayout type. |
| 499 | * |
| 500 | * @param[in] data_layout Type to output. |
| 501 | * |
| 502 | * @return Formatted string. |
| 503 | */ |
Michele Di Giorgio | 4a65b98 | 2018-03-02 11:21:38 +0000 | [diff] [blame] | 504 | inline std::string to_string(const arm_compute::DataLayout &data_layout) |
| 505 | { |
| 506 | std::stringstream str; |
| 507 | str << data_layout; |
| 508 | return str.str(); |
| 509 | } |
| 510 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 511 | /** Formatted output of the DataType type. |
| 512 | * |
| 513 | * @param[out] os Output stream. |
| 514 | * @param[in] data_type Type to output. |
| 515 | * |
| 516 | * @return Modified output stream. |
| 517 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 518 | inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type) |
| 519 | { |
| 520 | switch(data_type) |
| 521 | { |
| 522 | case DataType::UNKNOWN: |
| 523 | os << "UNKNOWN"; |
| 524 | break; |
| 525 | case DataType::U8: |
| 526 | os << "U8"; |
| 527 | break; |
| 528 | case DataType::QS8: |
| 529 | os << "QS8"; |
| 530 | break; |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 531 | case DataType::QASYMM8: |
| 532 | os << "QASYMM8"; |
| 533 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 534 | case DataType::S8: |
| 535 | os << "S8"; |
| 536 | break; |
| 537 | case DataType::U16: |
| 538 | os << "U16"; |
| 539 | break; |
| 540 | case DataType::S16: |
| 541 | os << "S16"; |
| 542 | break; |
Gian Marco Iodice | bdb6b0b | 2017-06-30 12:21:00 +0100 | [diff] [blame] | 543 | case DataType::QS16: |
| 544 | os << "QS16"; |
| 545 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 546 | case DataType::U32: |
| 547 | os << "U32"; |
| 548 | break; |
| 549 | case DataType::S32: |
| 550 | os << "S32"; |
| 551 | break; |
| 552 | case DataType::U64: |
| 553 | os << "U64"; |
| 554 | break; |
| 555 | case DataType::S64: |
| 556 | os << "S64"; |
| 557 | break; |
| 558 | case DataType::F16: |
| 559 | os << "F16"; |
| 560 | break; |
| 561 | case DataType::F32: |
| 562 | os << "F32"; |
| 563 | break; |
| 564 | case DataType::F64: |
| 565 | os << "F64"; |
| 566 | break; |
| 567 | case DataType::SIZET: |
| 568 | os << "SIZET"; |
| 569 | break; |
| 570 | default: |
| 571 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 572 | } |
| 573 | |
| 574 | return os; |
| 575 | } |
| 576 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 577 | /** Formatted output of the DataType type. |
| 578 | * |
| 579 | * @param[in] data_type Type to output. |
| 580 | * |
| 581 | * @return Formatted string. |
| 582 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 583 | inline std::string to_string(const arm_compute::DataType &data_type) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 584 | { |
| 585 | std::stringstream str; |
| 586 | str << data_type; |
| 587 | return str.str(); |
| 588 | } |
| 589 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 590 | /** Formatted output of the Format type. |
| 591 | * |
| 592 | * @param[out] os Output stream. |
| 593 | * @param[in] format Type to output. |
| 594 | * |
| 595 | * @return Modified output stream. |
| 596 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 597 | inline ::std::ostream &operator<<(::std::ostream &os, const Format &format) |
| 598 | { |
| 599 | switch(format) |
| 600 | { |
| 601 | case Format::UNKNOWN: |
| 602 | os << "UNKNOWN"; |
| 603 | break; |
| 604 | case Format::U8: |
| 605 | os << "U8"; |
| 606 | break; |
| 607 | case Format::S16: |
| 608 | os << "S16"; |
| 609 | break; |
| 610 | case Format::U16: |
| 611 | os << "U16"; |
| 612 | break; |
| 613 | case Format::S32: |
| 614 | os << "S32"; |
| 615 | break; |
| 616 | case Format::U32: |
| 617 | os << "U32"; |
| 618 | break; |
| 619 | case Format::F16: |
| 620 | os << "F16"; |
| 621 | break; |
| 622 | case Format::F32: |
| 623 | os << "F32"; |
| 624 | break; |
| 625 | case Format::UV88: |
| 626 | os << "UV88"; |
| 627 | break; |
| 628 | case Format::RGB888: |
| 629 | os << "RGB888"; |
| 630 | break; |
| 631 | case Format::RGBA8888: |
| 632 | os << "RGBA8888"; |
| 633 | break; |
| 634 | case Format::YUV444: |
| 635 | os << "YUV444"; |
| 636 | break; |
| 637 | case Format::YUYV422: |
| 638 | os << "YUYV422"; |
| 639 | break; |
| 640 | case Format::NV12: |
| 641 | os << "NV12"; |
| 642 | break; |
| 643 | case Format::NV21: |
| 644 | os << "NV21"; |
| 645 | break; |
| 646 | case Format::IYUV: |
| 647 | os << "IYUV"; |
| 648 | break; |
| 649 | case Format::UYVY422: |
| 650 | os << "UYVY422"; |
| 651 | break; |
| 652 | default: |
| 653 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 654 | } |
| 655 | |
| 656 | return os; |
| 657 | } |
| 658 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 659 | /** Formatted output of the Format type. |
| 660 | * |
| 661 | * @param[in] format Type to output. |
| 662 | * |
| 663 | * @return Formatted string. |
| 664 | */ |
Moritz Pflanzer | 7655a67 | 2017-09-23 11:57:33 +0100 | [diff] [blame] | 665 | inline std::string to_string(const Format &format) |
| 666 | { |
| 667 | std::stringstream str; |
| 668 | str << format; |
| 669 | return str.str(); |
| 670 | } |
| 671 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 672 | /** Formatted output of the Channel type. |
| 673 | * |
| 674 | * @param[out] os Output stream. |
| 675 | * @param[in] channel Type to output. |
| 676 | * |
| 677 | * @return Modified output stream. |
| 678 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 679 | inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel) |
| 680 | { |
| 681 | switch(channel) |
| 682 | { |
| 683 | case Channel::UNKNOWN: |
| 684 | os << "UNKNOWN"; |
| 685 | break; |
| 686 | case Channel::C0: |
| 687 | os << "C0"; |
| 688 | break; |
| 689 | case Channel::C1: |
| 690 | os << "C1"; |
| 691 | break; |
| 692 | case Channel::C2: |
| 693 | os << "C2"; |
| 694 | break; |
| 695 | case Channel::C3: |
| 696 | os << "C3"; |
| 697 | break; |
| 698 | case Channel::R: |
| 699 | os << "R"; |
| 700 | break; |
| 701 | case Channel::G: |
| 702 | os << "G"; |
| 703 | break; |
| 704 | case Channel::B: |
| 705 | os << "B"; |
| 706 | break; |
| 707 | case Channel::A: |
| 708 | os << "A"; |
| 709 | break; |
| 710 | case Channel::Y: |
| 711 | os << "Y"; |
| 712 | break; |
| 713 | case Channel::U: |
| 714 | os << "U"; |
| 715 | break; |
| 716 | case Channel::V: |
| 717 | os << "V"; |
| 718 | break; |
| 719 | default: |
| 720 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 721 | } |
| 722 | |
| 723 | return os; |
| 724 | } |
| 725 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 726 | /** Formatted output of the Channel type. |
| 727 | * |
| 728 | * @param[in] channel Type to output. |
| 729 | * |
| 730 | * @return Formatted string. |
| 731 | */ |
Ioan-Cristian Szabo | 9414f64 | 2017-10-27 17:35:40 +0100 | [diff] [blame] | 732 | inline std::string to_string(const Channel &channel) |
| 733 | { |
| 734 | std::stringstream str; |
| 735 | str << channel; |
| 736 | return str.str(); |
| 737 | } |
| 738 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 739 | /** Formatted output of the BorderMode type. |
| 740 | * |
| 741 | * @param[out] os Output stream. |
| 742 | * @param[in] mode Type to output. |
| 743 | * |
| 744 | * @return Modified output stream. |
| 745 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 746 | inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode) |
| 747 | { |
| 748 | switch(mode) |
| 749 | { |
| 750 | case BorderMode::UNDEFINED: |
| 751 | os << "UNDEFINED"; |
| 752 | break; |
| 753 | case BorderMode::CONSTANT: |
| 754 | os << "CONSTANT"; |
| 755 | break; |
| 756 | case BorderMode::REPLICATE: |
| 757 | os << "REPLICATE"; |
| 758 | break; |
| 759 | default: |
| 760 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 761 | } |
| 762 | |
| 763 | return os; |
| 764 | } |
| 765 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 766 | /** Formatted output of the BorderSize type. |
| 767 | * |
| 768 | * @param[out] os Output stream. |
| 769 | * @param[in] border Type to output. |
| 770 | * |
| 771 | * @return Modified output stream. |
| 772 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 773 | inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border) |
| 774 | { |
Moritz Pflanzer | c87fbf8 | 2017-07-18 14:02:10 +0100 | [diff] [blame] | 775 | os << border.top << "," |
| 776 | << border.right << "," |
| 777 | << border.bottom << "," |
| 778 | << border.left; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 779 | |
| 780 | return os; |
| 781 | } |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 782 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 783 | /** Formatted output of the InterpolationPolicy type. |
| 784 | * |
| 785 | * @param[out] os Output stream. |
| 786 | * @param[in] policy Type to output. |
| 787 | * |
| 788 | * @return Modified output stream. |
| 789 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 790 | inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy) |
| 791 | { |
| 792 | switch(policy) |
| 793 | { |
| 794 | case InterpolationPolicy::NEAREST_NEIGHBOR: |
| 795 | os << "NEAREST_NEIGHBOR"; |
| 796 | break; |
| 797 | case InterpolationPolicy::BILINEAR: |
| 798 | os << "BILINEAR"; |
| 799 | break; |
| 800 | case InterpolationPolicy::AREA: |
| 801 | os << "AREA"; |
| 802 | break; |
| 803 | default: |
| 804 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 805 | } |
| 806 | |
| 807 | return os; |
| 808 | } |
| 809 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 810 | /** Formatted output of the SamplingPolicy type. |
| 811 | * |
| 812 | * @param[out] os Output stream. |
| 813 | * @param[in] policy Type to output. |
| 814 | * |
| 815 | * @return Modified output stream. |
| 816 | */ |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 817 | inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy) |
| 818 | { |
| 819 | switch(policy) |
| 820 | { |
| 821 | case SamplingPolicy::CENTER: |
| 822 | os << "CENTER"; |
| 823 | break; |
| 824 | case SamplingPolicy::TOP_LEFT: |
| 825 | os << "TOP_LEFT"; |
| 826 | break; |
| 827 | default: |
| 828 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 829 | } |
| 830 | |
| 831 | return os; |
| 832 | } |
| 833 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 834 | /** Formatted output of the TensorInfo type. |
| 835 | * |
| 836 | * @param[in] info Type to output. |
| 837 | * |
| 838 | * @return Formatted string. |
| 839 | */ |
Georgios Pinitas | 3faea25 | 2017-10-30 14:13:50 +0000 | [diff] [blame] | 840 | inline std::string to_string(const TensorInfo &info) |
| 841 | { |
| 842 | std::stringstream str; |
| 843 | str << "{Shape=" << info.tensor_shape() << "," |
| 844 | << "Type=" << info.data_type() << "," |
| 845 | << "Channels=" << info.num_channels() << "," |
| 846 | << "FixedPointPos=" << info.fixed_point_position() << "}"; |
| 847 | return str.str(); |
| 848 | } |
| 849 | |
Abe Mbise | 925ca0f | 2017-10-02 19:16:33 +0100 | [diff] [blame] | 850 | //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] | 851 | /** Formatted output of the Dimensions type. |
| 852 | * |
| 853 | * @param[in] dimensions Type to output. |
| 854 | * |
| 855 | * @return Formatted string. |
| 856 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 857 | template <typename T> |
| 858 | inline std::string to_string(const Dimensions<T> &dimensions) |
| 859 | { |
| 860 | std::stringstream str; |
| 861 | str << dimensions; |
| 862 | return str.str(); |
| 863 | } |
| 864 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 865 | /** Formatted output of the Strides type. |
| 866 | * |
| 867 | * @param[in] stride Type to output. |
| 868 | * |
| 869 | * @return Formatted string. |
| 870 | */ |
John Richardson | a36eae1 | 2017-09-26 16:55:59 +0100 | [diff] [blame] | 871 | inline std::string to_string(const Strides &stride) |
| 872 | { |
| 873 | std::stringstream str; |
| 874 | str << stride; |
| 875 | return str.str(); |
| 876 | } |
| 877 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 878 | /** Formatted output of the TensorShape type. |
| 879 | * |
| 880 | * @param[in] shape Type to output. |
| 881 | * |
| 882 | * @return Formatted string. |
| 883 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 884 | inline std::string to_string(const TensorShape &shape) |
| 885 | { |
| 886 | std::stringstream str; |
| 887 | str << shape; |
| 888 | return str.str(); |
| 889 | } |
| 890 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 891 | /** Formatted output of the Coordinates type. |
| 892 | * |
| 893 | * @param[in] coord Type to output. |
| 894 | * |
| 895 | * @return Formatted string. |
| 896 | */ |
Abe Mbise | 925ca0f | 2017-10-02 19:16:33 +0100 | [diff] [blame] | 897 | inline std::string to_string(const Coordinates &coord) |
| 898 | { |
| 899 | std::stringstream str; |
| 900 | str << coord; |
| 901 | return str.str(); |
| 902 | } |
| 903 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 904 | /** Formatted output of the Rectangle type. |
| 905 | * |
| 906 | * @param[out] os Output stream. |
| 907 | * @param[in] rect Type to output. |
| 908 | * |
| 909 | * @return Modified output stream. |
| 910 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 911 | inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect) |
| 912 | { |
| 913 | os << rect.width << "x" << rect.height; |
| 914 | os << "+" << rect.x << "+" << rect.y; |
| 915 | |
| 916 | return os; |
| 917 | } |
| 918 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 919 | /** Formatted output of the PadStrideInfo type. |
| 920 | * |
| 921 | * @param[out] os Output stream. |
| 922 | * @param[in] pad_stride_info Type to output. |
| 923 | * |
| 924 | * @return Modified output stream. |
| 925 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 926 | inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info) |
| 927 | { |
| 928 | os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second; |
| 929 | os << ";"; |
Jaroslaw Rzepecki | a1ed41f | 2017-10-13 11:13:58 +0100 | [diff] [blame] | 930 | os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << "," |
| 931 | << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom(); |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 932 | |
| 933 | return os; |
| 934 | } |
| 935 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 936 | /** Formatted output of the PadStrideInfo type. |
| 937 | * |
| 938 | * @param[in] pad_stride_info Type to output. |
| 939 | * |
| 940 | * @return Formatted string. |
| 941 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 942 | inline std::string to_string(const PadStrideInfo &pad_stride_info) |
| 943 | { |
| 944 | std::stringstream str; |
| 945 | str << pad_stride_info; |
| 946 | return str.str(); |
| 947 | } |
| 948 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 949 | /** Formatted output of the BorderMode type. |
| 950 | * |
| 951 | * @param[in] mode Type to output. |
| 952 | * |
| 953 | * @return Formatted string. |
| 954 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 955 | inline std::string to_string(const BorderMode &mode) |
| 956 | { |
| 957 | std::stringstream str; |
| 958 | str << mode; |
| 959 | return str.str(); |
| 960 | } |
| 961 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 962 | /** Formatted output of the BorderSize type. |
| 963 | * |
| 964 | * @param[in] border Type to output. |
| 965 | * |
| 966 | * @return Formatted string. |
| 967 | */ |
John Richardson | b482ce1 | 2017-09-18 12:44:01 +0100 | [diff] [blame] | 968 | inline std::string to_string(const BorderSize &border) |
| 969 | { |
| 970 | std::stringstream str; |
| 971 | str << border; |
| 972 | return str.str(); |
| 973 | } |
| 974 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 975 | /** Formatted output of the InterpolationPolicy type. |
| 976 | * |
| 977 | * @param[in] policy Type to output. |
| 978 | * |
| 979 | * @return Formatted string. |
| 980 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 981 | inline std::string to_string(const InterpolationPolicy &policy) |
| 982 | { |
| 983 | std::stringstream str; |
| 984 | str << policy; |
| 985 | return str.str(); |
| 986 | } |
| 987 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 988 | /** Formatted output of the SamplingPolicy type. |
| 989 | * |
| 990 | * @param[in] policy Type to output. |
| 991 | * |
| 992 | * @return Formatted string. |
| 993 | */ |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 994 | inline std::string to_string(const SamplingPolicy &policy) |
| 995 | { |
| 996 | std::stringstream str; |
| 997 | str << policy; |
| 998 | return str.str(); |
| 999 | } |
| 1000 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1001 | /** Formatted output of the ConvertPolicy type. |
| 1002 | * |
| 1003 | * @param[out] os Output stream. |
| 1004 | * @param[in] policy Type to output. |
| 1005 | * |
| 1006 | * @return Modified output stream. |
| 1007 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1008 | inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy) |
| 1009 | { |
| 1010 | switch(policy) |
| 1011 | { |
| 1012 | case ConvertPolicy::WRAP: |
| 1013 | os << "WRAP"; |
| 1014 | break; |
| 1015 | case ConvertPolicy::SATURATE: |
| 1016 | os << "SATURATE"; |
| 1017 | break; |
| 1018 | default: |
| 1019 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1020 | } |
| 1021 | |
| 1022 | return os; |
| 1023 | } |
| 1024 | |
| 1025 | inline std::string to_string(const ConvertPolicy &policy) |
| 1026 | { |
| 1027 | std::stringstream str; |
| 1028 | str << policy; |
| 1029 | return str.str(); |
| 1030 | } |
| 1031 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1032 | /** Formatted output of the Reduction Operations. |
| 1033 | * |
| 1034 | * @param[out] os Output stream. |
| 1035 | * @param[in] op Type to output. |
| 1036 | * |
| 1037 | * @return Modified output stream. |
| 1038 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1039 | inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op) |
| 1040 | { |
| 1041 | switch(op) |
| 1042 | { |
| 1043 | case ReductionOperation::SUM_SQUARE: |
| 1044 | os << "SUM_SQUARE"; |
| 1045 | break; |
| 1046 | default: |
| 1047 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1048 | } |
| 1049 | |
| 1050 | return os; |
| 1051 | } |
| 1052 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1053 | /** Formatted output of the Reduction Operations. |
| 1054 | * |
| 1055 | * @param[in] op Type to output. |
| 1056 | * |
| 1057 | * @return Formatted string. |
| 1058 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1059 | inline std::string to_string(const ReductionOperation &op) |
| 1060 | { |
| 1061 | std::stringstream str; |
| 1062 | str << op; |
| 1063 | return str.str(); |
| 1064 | } |
| 1065 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1066 | /** Formatted output of the Norm Type. |
| 1067 | * |
| 1068 | * @param[in] type Type to output. |
| 1069 | * |
| 1070 | * @return Formatted string. |
| 1071 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1072 | inline std::string to_string(const NormType &type) |
| 1073 | { |
| 1074 | std::stringstream str; |
| 1075 | str << type; |
| 1076 | return str.str(); |
| 1077 | } |
| 1078 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1079 | /** Formatted output of the Pooling Type. |
| 1080 | * |
| 1081 | * @param[in] type Type to output. |
| 1082 | * |
| 1083 | * @return Formatted string. |
| 1084 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1085 | inline std::string to_string(const PoolingType &type) |
| 1086 | { |
| 1087 | std::stringstream str; |
| 1088 | str << type; |
| 1089 | return str.str(); |
| 1090 | } |
| 1091 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1092 | /** Formatted output of the Pooling Layer Info. |
| 1093 | * |
| 1094 | * @param[in] info Type to output. |
| 1095 | * |
| 1096 | * @return Formatted string. |
| 1097 | */ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1098 | inline std::string to_string(const PoolingLayerInfo &info) |
| 1099 | { |
| 1100 | std::stringstream str; |
Georgios Pinitas | 4c2dd54 | 2017-11-13 12:58:41 +0000 | [diff] [blame] | 1101 | str << "{Type=" << info.pool_type() << "," |
| 1102 | << "IsGlobalPooling=" << info.is_global_pooling(); |
| 1103 | if(!info.is_global_pooling()) |
| 1104 | { |
| 1105 | str << "," |
Isabella Gottardi | 6e464c3 | 2018-01-26 12:32:45 +0000 | [diff] [blame] | 1106 | << "PoolSize=" << info.pool_size().width << "," << info.pool_size().height << "," |
Georgios Pinitas | 4c2dd54 | 2017-11-13 12:58:41 +0000 | [diff] [blame] | 1107 | << "PadStride=" << info.pad_stride_info(); |
| 1108 | } |
| 1109 | str << "}"; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1110 | return str.str(); |
| 1111 | } |
| 1112 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1113 | /** Formatted output of the KeyPoint type. |
| 1114 | * |
| 1115 | * @param[out] os Output stream |
| 1116 | * @param[in] point Type to output. |
| 1117 | * |
| 1118 | * @return Modified output stream. |
| 1119 | */ |
Moritz Pflanzer | 6c6597c | 2017-09-24 12:09:41 +0100 | [diff] [blame] | 1120 | inline ::std::ostream &operator<<(::std::ostream &os, const KeyPoint &point) |
| 1121 | { |
| 1122 | os << "{x=" << point.x << "," |
| 1123 | << "y=" << point.y << "," |
| 1124 | << "strength=" << point.strength << "," |
| 1125 | << "scale=" << point.scale << "," |
| 1126 | << "orientation=" << point.orientation << "," |
| 1127 | << "tracking_status=" << point.tracking_status << "," |
| 1128 | << "error=" << point.error << "}"; |
| 1129 | |
| 1130 | return os; |
| 1131 | } |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 1132 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1133 | /** Formatted output of the PhaseType type. |
| 1134 | * |
| 1135 | * @param[out] os Output stream |
| 1136 | * @param[in] phase_type Type to output. |
| 1137 | * |
| 1138 | * @return Modified output stream. |
| 1139 | */ |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 1140 | inline ::std::ostream &operator<<(::std::ostream &os, const PhaseType &phase_type) |
| 1141 | { |
| 1142 | switch(phase_type) |
| 1143 | { |
| 1144 | case PhaseType::SIGNED: |
| 1145 | os << "SIGNED"; |
| 1146 | break; |
| 1147 | case PhaseType::UNSIGNED: |
| 1148 | os << "UNSIGNED"; |
| 1149 | break; |
| 1150 | default: |
| 1151 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1152 | } |
| 1153 | |
| 1154 | return os; |
| 1155 | } |
| 1156 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1157 | /** Formatted output of the PhaseType type. |
| 1158 | * |
| 1159 | * @param[in] type Type to output. |
| 1160 | * |
| 1161 | * @return Formatted string. |
| 1162 | */ |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 1163 | inline std::string to_string(const arm_compute::PhaseType &type) |
| 1164 | { |
| 1165 | std::stringstream str; |
| 1166 | str << type; |
| 1167 | return str.str(); |
| 1168 | } |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 1169 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1170 | /** Formatted output of the MagnitudeType type. |
| 1171 | * |
| 1172 | * @param[out] os Output stream |
| 1173 | * @param[in] magnitude_type Type to output. |
| 1174 | * |
| 1175 | * @return Modified output stream. |
| 1176 | */ |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 1177 | inline ::std::ostream &operator<<(::std::ostream &os, const MagnitudeType &magnitude_type) |
| 1178 | { |
| 1179 | switch(magnitude_type) |
| 1180 | { |
| 1181 | case MagnitudeType::L1NORM: |
| 1182 | os << "L1NORM"; |
| 1183 | break; |
| 1184 | case MagnitudeType::L2NORM: |
| 1185 | os << "L2NORM"; |
| 1186 | break; |
| 1187 | default: |
| 1188 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1189 | } |
| 1190 | |
| 1191 | return os; |
| 1192 | } |
| 1193 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1194 | /** Formatted output of the MagnitudeType type. |
| 1195 | * |
| 1196 | * @param[in] type Type to output. |
| 1197 | * |
| 1198 | * @return Formatted string. |
| 1199 | */ |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 1200 | inline std::string to_string(const arm_compute::MagnitudeType &type) |
| 1201 | { |
| 1202 | std::stringstream str; |
| 1203 | str << type; |
| 1204 | return str.str(); |
| 1205 | } |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 1206 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1207 | /** Formatted output of the GradientDimension type. |
| 1208 | * |
| 1209 | * @param[out] os Output stream |
| 1210 | * @param[in] dim Type to output |
| 1211 | * |
| 1212 | * @return Modified output stream. |
| 1213 | */ |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 1214 | inline ::std::ostream &operator<<(::std::ostream &os, const GradientDimension &dim) |
| 1215 | { |
| 1216 | switch(dim) |
| 1217 | { |
| 1218 | case GradientDimension::GRAD_X: |
| 1219 | os << "GRAD_X"; |
| 1220 | break; |
| 1221 | case GradientDimension::GRAD_Y: |
| 1222 | os << "GRAD_Y"; |
| 1223 | break; |
| 1224 | case GradientDimension::GRAD_XY: |
| 1225 | os << "GRAD_XY"; |
| 1226 | break; |
| 1227 | default: |
| 1228 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1229 | } |
| 1230 | |
| 1231 | return os; |
| 1232 | } |
| 1233 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1234 | /** Formatted output of the GradientDimension type. |
| 1235 | * |
| 1236 | * @param[in] type Type to output |
| 1237 | * |
| 1238 | * @return Formatted string. |
| 1239 | */ |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 1240 | inline std::string to_string(const arm_compute::GradientDimension &type) |
| 1241 | { |
| 1242 | std::stringstream str; |
| 1243 | str << type; |
| 1244 | return str.str(); |
| 1245 | } |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1246 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1247 | /** Formatted output of the HOGNormType type. |
| 1248 | * |
| 1249 | * @param[out] os Output stream |
| 1250 | * @param[in] norm_type Type to output |
| 1251 | * |
| 1252 | * @return Modified output stream. |
| 1253 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1254 | inline ::std::ostream &operator<<(::std::ostream &os, const HOGNormType &norm_type) |
| 1255 | { |
| 1256 | switch(norm_type) |
| 1257 | { |
| 1258 | case HOGNormType::L1_NORM: |
| 1259 | os << "L1_NORM"; |
| 1260 | break; |
| 1261 | case HOGNormType::L2_NORM: |
| 1262 | os << "L2_NORM"; |
| 1263 | break; |
| 1264 | case HOGNormType::L2HYS_NORM: |
| 1265 | os << "L2HYS_NORM"; |
| 1266 | break; |
| 1267 | default: |
| 1268 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1269 | } |
| 1270 | |
| 1271 | return os; |
| 1272 | } |
| 1273 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1274 | /** Formatted output of the HOGNormType type. |
| 1275 | * |
| 1276 | * @param[in] type Type to output |
| 1277 | * |
| 1278 | * @return Formatted string. |
| 1279 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1280 | inline std::string to_string(const HOGNormType &type) |
| 1281 | { |
| 1282 | std::stringstream str; |
| 1283 | str << type; |
| 1284 | return str.str(); |
| 1285 | } |
| 1286 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1287 | /** Formatted output of the Size2D type. |
| 1288 | * |
| 1289 | * @param[out] os Output stream |
| 1290 | * @param[in] size Type to output |
| 1291 | * |
| 1292 | * @return Modified output stream. |
| 1293 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1294 | inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size) |
| 1295 | { |
| 1296 | os << size.width << "x" << size.height; |
| 1297 | |
| 1298 | return os; |
| 1299 | } |
| 1300 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1301 | /** Formatted output of the Size2D type. |
| 1302 | * |
| 1303 | * @param[in] type Type to output |
| 1304 | * |
| 1305 | * @return Formatted string. |
| 1306 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1307 | inline std::string to_string(const Size2D &type) |
| 1308 | { |
| 1309 | std::stringstream str; |
| 1310 | str << type; |
| 1311 | return str.str(); |
| 1312 | } |
| 1313 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1314 | /** Formatted output of the HOGInfo type. |
| 1315 | * |
| 1316 | * @param[out] os Output stream |
| 1317 | * @param[in] hog_info Type to output |
| 1318 | * |
| 1319 | * @return Modified output stream. |
| 1320 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1321 | inline ::std::ostream &operator<<(::std::ostream &os, const HOGInfo &hog_info) |
| 1322 | { |
| 1323 | os << "{CellSize=" << hog_info.cell_size() << "," |
| 1324 | << "BlockSize=" << hog_info.block_size() << "," |
| 1325 | << "DetectionWindowSize=" << hog_info.detection_window_size() << "," |
| 1326 | << "BlockStride=" << hog_info.block_stride() << "," |
| 1327 | << "NumBins=" << hog_info.num_bins() << "," |
| 1328 | << "NormType=" << hog_info.normalization_type() << "," |
| 1329 | << "L2HystThreshold=" << hog_info.l2_hyst_threshold() << "," |
| 1330 | << "PhaseType=" << hog_info.phase_type() << "}"; |
| 1331 | |
| 1332 | return os; |
| 1333 | } |
| 1334 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1335 | /** Formatted output of the HOGInfo type. |
| 1336 | * |
| 1337 | * @param[in] type Type to output |
| 1338 | * |
| 1339 | * @return Formatted string. |
| 1340 | */ |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 1341 | inline std::string to_string(const HOGInfo &type) |
| 1342 | { |
| 1343 | std::stringstream str; |
| 1344 | str << type; |
| 1345 | return str.str(); |
| 1346 | } |
| 1347 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1348 | /** Formatted output of the ConvolutionMethod type. |
| 1349 | * |
| 1350 | * @param[out] os Output stream |
| 1351 | * @param[in] conv_method Type to output |
| 1352 | * |
| 1353 | * @return Modified output stream. |
| 1354 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1355 | inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method) |
| 1356 | { |
| 1357 | switch(conv_method) |
| 1358 | { |
| 1359 | case ConvolutionMethod::GEMM: |
| 1360 | os << "GEMM"; |
| 1361 | break; |
| 1362 | case ConvolutionMethod::DIRECT: |
| 1363 | os << "DIRECT"; |
| 1364 | break; |
| 1365 | case ConvolutionMethod::WINOGRAD: |
| 1366 | os << "WINOGRAD"; |
| 1367 | break; |
| 1368 | default: |
| 1369 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1370 | } |
| 1371 | |
| 1372 | return os; |
| 1373 | } |
| 1374 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1375 | /** Formatted output of the ConvolutionMethod type. |
| 1376 | * |
| 1377 | * @param[in] conv_method Type to output |
| 1378 | * |
| 1379 | * @return Formatted string. |
| 1380 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1381 | inline std::string to_string(const ConvolutionMethod &conv_method) |
| 1382 | { |
| 1383 | std::stringstream str; |
| 1384 | str << conv_method; |
| 1385 | return str.str(); |
| 1386 | } |
| 1387 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1388 | /** Formatted output of the GPUTarget type. |
| 1389 | * |
| 1390 | * @param[out] os Output stream |
| 1391 | * @param[in] gpu_target Type to output |
| 1392 | * |
| 1393 | * @return Modified output stream. |
| 1394 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1395 | inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target) |
| 1396 | { |
| 1397 | switch(gpu_target) |
| 1398 | { |
| 1399 | case GPUTarget::GPU_ARCH_MASK: |
| 1400 | os << "GPU_ARCH_MASK"; |
| 1401 | break; |
| 1402 | case GPUTarget::MIDGARD: |
| 1403 | os << "MIDGARD"; |
| 1404 | break; |
| 1405 | case GPUTarget::BIFROST: |
| 1406 | os << "BIFROST"; |
| 1407 | break; |
| 1408 | case GPUTarget::T600: |
| 1409 | os << "T600"; |
| 1410 | break; |
| 1411 | case GPUTarget::T700: |
| 1412 | os << "T700"; |
| 1413 | break; |
| 1414 | case GPUTarget::T800: |
| 1415 | os << "T800"; |
| 1416 | break; |
Michalis Spyrou | a967611 | 2018-02-22 18:07:43 +0000 | [diff] [blame] | 1417 | case GPUTarget::G71: |
| 1418 | os << "G71"; |
| 1419 | break; |
| 1420 | case GPUTarget::G72: |
| 1421 | os << "G72"; |
| 1422 | break; |
| 1423 | case GPUTarget::G51: |
| 1424 | os << "G51"; |
| 1425 | break; |
| 1426 | case GPUTarget::G51BIG: |
| 1427 | os << "G51BIG"; |
| 1428 | break; |
| 1429 | case GPUTarget::G51LIT: |
| 1430 | os << "G51LIT"; |
| 1431 | break; |
| 1432 | case GPUTarget::TNOX: |
| 1433 | os << "TNOX"; |
| 1434 | break; |
| 1435 | case GPUTarget::TTRX: |
| 1436 | os << "TTRX"; |
| 1437 | break; |
| 1438 | case GPUTarget::TBOX: |
| 1439 | os << "TBOX"; |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1440 | break; |
| 1441 | default: |
| 1442 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 1443 | } |
| 1444 | |
| 1445 | return os; |
| 1446 | } |
| 1447 | |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1448 | /** Formatted output of the GPUTarget type. |
| 1449 | * |
| 1450 | * @param[in] gpu_target Type to output |
| 1451 | * |
| 1452 | * @return Formatted string. |
| 1453 | */ |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 1454 | inline std::string to_string(const GPUTarget &gpu_target) |
| 1455 | { |
| 1456 | std::stringstream str; |
| 1457 | str << gpu_target; |
| 1458 | return str.str(); |
| 1459 | } |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame^] | 1460 | |
John Richardson | 684cb0f | 2018-01-09 11:17:00 +0000 | [diff] [blame] | 1461 | /** Formatted output of the DetectionWindow type. */ |
| 1462 | inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window) |
| 1463 | { |
| 1464 | os << "{x=" << detection_window.x << "," |
| 1465 | << "y=" << detection_window.y << "," |
| 1466 | << "width=" << detection_window.width << "," |
| 1467 | << "height=" << detection_window.height << "," |
| 1468 | << "idx_class=" << detection_window.idx_class << "," |
| 1469 | << "score=" << detection_window.score << "}"; |
| 1470 | |
| 1471 | return os; |
| 1472 | } |
| 1473 | |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame^] | 1474 | /** Formatted output of the WinogradInfo type. */ |
| 1475 | inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info) |
| 1476 | { |
| 1477 | os << "{OutputTileSize=" << info.output_tile_size << "," |
| 1478 | << "KernelSize=" << info.kernel_size << "," |
| 1479 | << "PadStride=" << info.convolution_info << "," |
| 1480 | << "OutputDataLayout=" << info.output_data_layout << "}"; |
| 1481 | |
| 1482 | return os; |
| 1483 | } |
| 1484 | |
John Richardson | 684cb0f | 2018-01-09 11:17:00 +0000 | [diff] [blame] | 1485 | inline std::string to_string(const DetectionWindow &type) |
| 1486 | { |
| 1487 | std::stringstream str; |
| 1488 | str << type; |
| 1489 | return str.str(); |
| 1490 | } |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame^] | 1491 | |
| 1492 | inline std::string to_string(const WinogradInfo &type) |
| 1493 | { |
| 1494 | std::stringstream str; |
| 1495 | str << type; |
| 1496 | return str.str(); |
| 1497 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1498 | } // namespace arm_compute |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 1499 | #endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */ |