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 | { |
| 44 | /** Formatted output of the Dimensions type. */ |
| 45 | template <typename T> |
| 46 | inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions) |
| 47 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 48 | if(dimensions.num_dimensions() > 0) |
| 49 | { |
| 50 | os << dimensions[0]; |
| 51 | |
| 52 | for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d) |
| 53 | { |
Moritz Pflanzer | c87fbf8 | 2017-07-18 14:02:10 +0100 | [diff] [blame] | 54 | os << "x" << dimensions[d]; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 55 | } |
| 56 | } |
| 57 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 58 | return os; |
| 59 | } |
| 60 | |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 61 | /** Formatted output of the NonLinearFilterFunction type. */ |
| 62 | inline ::std::ostream &operator<<(::std::ostream &os, const NonLinearFilterFunction &function) |
| 63 | { |
| 64 | switch(function) |
| 65 | { |
| 66 | case NonLinearFilterFunction::MAX: |
| 67 | os << "MAX"; |
| 68 | break; |
| 69 | case NonLinearFilterFunction::MEDIAN: |
| 70 | os << "MEDIAN"; |
| 71 | break; |
| 72 | case NonLinearFilterFunction::MIN: |
| 73 | os << "MIN"; |
| 74 | break; |
| 75 | default: |
| 76 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 77 | } |
| 78 | |
| 79 | return os; |
| 80 | } |
| 81 | |
John Richardson | 6f4d49f | 2017-09-07 11:21:10 +0100 | [diff] [blame] | 82 | inline std::string to_string(const NonLinearFilterFunction &function) |
| 83 | { |
| 84 | std::stringstream str; |
| 85 | str << function; |
| 86 | return str.str(); |
| 87 | } |
| 88 | |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 89 | /** Formatted output of the MatrixPattern type. */ |
| 90 | inline ::std::ostream &operator<<(::std::ostream &os, const MatrixPattern &pattern) |
| 91 | { |
| 92 | switch(pattern) |
| 93 | { |
| 94 | case MatrixPattern::BOX: |
| 95 | os << "BOX"; |
| 96 | break; |
| 97 | case MatrixPattern::CROSS: |
| 98 | os << "CROSS"; |
| 99 | break; |
| 100 | case MatrixPattern::DISK: |
| 101 | os << "DISK"; |
| 102 | break; |
| 103 | case MatrixPattern::OTHER: |
| 104 | os << "OTHER"; |
| 105 | break; |
| 106 | default: |
| 107 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 108 | } |
| 109 | |
| 110 | return os; |
| 111 | } |
| 112 | |
John Richardson | 6f4d49f | 2017-09-07 11:21:10 +0100 | [diff] [blame] | 113 | inline std::string to_string(const MatrixPattern &pattern) |
| 114 | { |
| 115 | std::stringstream str; |
| 116 | str << pattern; |
| 117 | return str.str(); |
| 118 | } |
| 119 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 120 | /** Formatted output of the RoundingPolicy type. */ |
| 121 | inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 122 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 123 | switch(rounding_policy) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 124 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 125 | case RoundingPolicy::TO_ZERO: |
| 126 | os << "TO_ZERO"; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 127 | break; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 128 | case RoundingPolicy::TO_NEAREST_UP: |
| 129 | os << "TO_NEAREST_UP"; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 130 | break; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 131 | case RoundingPolicy::TO_NEAREST_EVEN: |
| 132 | os << "TO_NEAREST_EVEN"; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 133 | break; |
| 134 | default: |
| 135 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 136 | } |
| 137 | |
| 138 | return os; |
| 139 | } |
| 140 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 141 | /** Formatted output of the WeightsInfo type. */ |
| 142 | inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info) |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 143 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 144 | os << weights_info.are_reshaped() << ";"; |
| 145 | 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] | 146 | |
| 147 | return os; |
| 148 | } |
| 149 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 150 | /** Formatted output of the ROIPoolingInfo type. */ |
| 151 | inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info) |
Sanghoon Lee | 70f8291 | 2017-08-24 14:21:24 +0100 | [diff] [blame] | 152 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 153 | 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] | 154 | return os; |
| 155 | } |
| 156 | |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 157 | /** Formatted output of the QuantizationInfo type. */ |
| 158 | inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &quantization_info) |
| 159 | { |
| 160 | os << "Scale:" << quantization_info.scale << "~" |
| 161 | << "Offset:" << quantization_info.offset; |
| 162 | return os; |
| 163 | } |
| 164 | |
| 165 | inline std::string to_string(const QuantizationInfo &quantization_info) |
| 166 | { |
| 167 | std::stringstream str; |
| 168 | str << quantization_info; |
| 169 | return str.str(); |
| 170 | } |
| 171 | |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 172 | inline ::std::ostream &operator<<(::std::ostream &os, const FixedPointOp &op) |
| 173 | { |
| 174 | switch(op) |
| 175 | { |
John Richardson | 70f946b | 2017-10-02 16:52:16 +0100 | [diff] [blame] | 176 | case FixedPointOp::ADD: |
| 177 | os << "ADD"; |
| 178 | break; |
| 179 | case FixedPointOp::SUB: |
| 180 | os << "SUB"; |
| 181 | break; |
| 182 | case FixedPointOp::MUL: |
| 183 | os << "MUL"; |
| 184 | break; |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 185 | case FixedPointOp::EXP: |
| 186 | os << "EXP"; |
| 187 | break; |
| 188 | case FixedPointOp::LOG: |
| 189 | os << "LOG"; |
| 190 | break; |
| 191 | case FixedPointOp::INV_SQRT: |
| 192 | os << "INV_SQRT"; |
| 193 | break; |
| 194 | case FixedPointOp::RECIPROCAL: |
| 195 | os << "RECIPROCAL"; |
| 196 | break; |
| 197 | default: |
| 198 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 199 | } |
| 200 | |
| 201 | return os; |
| 202 | } |
John Richardson | 70f946b | 2017-10-02 16:52:16 +0100 | [diff] [blame] | 203 | |
Abe Mbise | 4bd2cb8 | 2017-09-27 18:39:19 +0100 | [diff] [blame] | 204 | inline std::string to_string(const FixedPointOp &op) |
| 205 | { |
| 206 | std::stringstream str; |
| 207 | str << op; |
| 208 | return str.str(); |
| 209 | } |
| 210 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 211 | /** Formatted output of the activation function type. */ |
| 212 | inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function) |
| 213 | { |
| 214 | switch(act_function) |
| 215 | { |
| 216 | case ActivationLayerInfo::ActivationFunction::ABS: |
| 217 | os << "ABS"; |
| 218 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 219 | case ActivationLayerInfo::ActivationFunction::LINEAR: |
| 220 | os << "LINEAR"; |
| 221 | break; |
| 222 | case ActivationLayerInfo::ActivationFunction::LOGISTIC: |
| 223 | os << "LOGISTIC"; |
| 224 | break; |
| 225 | case ActivationLayerInfo::ActivationFunction::RELU: |
| 226 | os << "RELU"; |
| 227 | break; |
Georgios Pinitas | 579c049 | 2017-07-12 16:12:12 +0100 | [diff] [blame] | 228 | case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU: |
| 229 | os << "BOUNDED_RELU"; |
| 230 | break; |
| 231 | case ActivationLayerInfo::ActivationFunction::LEAKY_RELU: |
| 232 | os << "LEAKY_RELU"; |
| 233 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 234 | case ActivationLayerInfo::ActivationFunction::SOFT_RELU: |
| 235 | os << "SOFT_RELU"; |
| 236 | break; |
| 237 | case ActivationLayerInfo::ActivationFunction::SQRT: |
| 238 | os << "SQRT"; |
| 239 | break; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 240 | case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU: |
| 241 | os << "LU_BOUNDED_RELU"; |
Kevin Petit | d9f8071 | 2017-12-06 12:18:48 +0000 | [diff] [blame] | 242 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 243 | case ActivationLayerInfo::ActivationFunction::SQUARE: |
| 244 | os << "SQUARE"; |
| 245 | break; |
| 246 | case ActivationLayerInfo::ActivationFunction::TANH: |
| 247 | os << "TANH"; |
| 248 | break; |
| 249 | default: |
| 250 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 251 | } |
| 252 | |
| 253 | return os; |
| 254 | } |
| 255 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 256 | inline std::string to_string(const arm_compute::ActivationLayerInfo &info) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 257 | { |
| 258 | std::stringstream str; |
| 259 | str << info.activation(); |
| 260 | return str.str(); |
| 261 | } |
| 262 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 263 | inline std::string to_string(const arm_compute::ActivationLayerInfo::ActivationFunction &function) |
| 264 | { |
| 265 | std::stringstream str; |
| 266 | str << function; |
| 267 | return str.str(); |
| 268 | } |
| 269 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 270 | /** Formatted output of the NormType type. */ |
| 271 | inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type) |
| 272 | { |
| 273 | switch(norm_type) |
| 274 | { |
| 275 | case NormType::CROSS_MAP: |
| 276 | os << "CROSS_MAP"; |
| 277 | break; |
| 278 | case NormType::IN_MAP_1D: |
| 279 | os << "IN_MAP_1D"; |
| 280 | break; |
| 281 | case NormType::IN_MAP_2D: |
| 282 | os << "IN_MAP_2D"; |
| 283 | break; |
| 284 | default: |
| 285 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 286 | } |
| 287 | |
| 288 | return os; |
| 289 | } |
| 290 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 291 | inline std::string to_string(const arm_compute::NormalizationLayerInfo &info) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 292 | { |
| 293 | std::stringstream str; |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 294 | str << info.type() << ":NormSize=" << info.norm_size(); |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 295 | return str.str(); |
| 296 | } |
| 297 | |
Georgios Pinitas | 6f669f0 | 2017-09-26 12:32:57 +0100 | [diff] [blame] | 298 | /** Formatted output of @ref NormalizationLayerInfo. */ |
| 299 | inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info) |
| 300 | { |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 301 | os << info.type() << ":NormSize=" << info.norm_size(); |
Georgios Pinitas | 6f669f0 | 2017-09-26 12:32:57 +0100 | [diff] [blame] | 302 | return os; |
| 303 | } |
| 304 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 305 | /** Formatted output of the PoolingType type. */ |
| 306 | inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type) |
| 307 | { |
| 308 | switch(pool_type) |
| 309 | { |
| 310 | case PoolingType::AVG: |
| 311 | os << "AVG"; |
| 312 | break; |
| 313 | case PoolingType::MAX: |
| 314 | os << "MAX"; |
| 315 | break; |
Georgios Pinitas | cdf5145 | 2017-08-31 14:21:36 +0100 | [diff] [blame] | 316 | case PoolingType::L2: |
| 317 | os << "L2"; |
| 318 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 319 | default: |
| 320 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 321 | } |
| 322 | |
| 323 | return os; |
| 324 | } |
| 325 | |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 326 | /** Formatted output of @ref PoolingLayerInfo. */ |
| 327 | inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info) |
| 328 | { |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 329 | os << info.pool_type(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 330 | |
| 331 | return os; |
| 332 | } |
| 333 | |
John Richardson | dd715f2 | 2017-09-18 16:10:48 +0100 | [diff] [blame] | 334 | inline std::string to_string(const RoundingPolicy &rounding_policy) |
| 335 | { |
| 336 | std::stringstream str; |
| 337 | str << rounding_policy; |
| 338 | return str.str(); |
| 339 | } |
| 340 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 341 | /** Formatted output of the DataType type. */ |
| 342 | inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type) |
| 343 | { |
| 344 | switch(data_type) |
| 345 | { |
| 346 | case DataType::UNKNOWN: |
| 347 | os << "UNKNOWN"; |
| 348 | break; |
| 349 | case DataType::U8: |
| 350 | os << "U8"; |
| 351 | break; |
| 352 | case DataType::QS8: |
| 353 | os << "QS8"; |
| 354 | break; |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 355 | case DataType::QASYMM8: |
| 356 | os << "QASYMM8"; |
| 357 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 358 | case DataType::S8: |
| 359 | os << "S8"; |
| 360 | break; |
| 361 | case DataType::U16: |
| 362 | os << "U16"; |
| 363 | break; |
| 364 | case DataType::S16: |
| 365 | os << "S16"; |
| 366 | break; |
Gian Marco Iodice | bdb6b0b | 2017-06-30 12:21:00 +0100 | [diff] [blame] | 367 | case DataType::QS16: |
| 368 | os << "QS16"; |
| 369 | break; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 370 | case DataType::U32: |
| 371 | os << "U32"; |
| 372 | break; |
| 373 | case DataType::S32: |
| 374 | os << "S32"; |
| 375 | break; |
| 376 | case DataType::U64: |
| 377 | os << "U64"; |
| 378 | break; |
| 379 | case DataType::S64: |
| 380 | os << "S64"; |
| 381 | break; |
| 382 | case DataType::F16: |
| 383 | os << "F16"; |
| 384 | break; |
| 385 | case DataType::F32: |
| 386 | os << "F32"; |
| 387 | break; |
| 388 | case DataType::F64: |
| 389 | os << "F64"; |
| 390 | break; |
| 391 | case DataType::SIZET: |
| 392 | os << "SIZET"; |
| 393 | break; |
| 394 | default: |
| 395 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 396 | } |
| 397 | |
| 398 | return os; |
| 399 | } |
| 400 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 401 | inline std::string to_string(const arm_compute::DataType &data_type) |
Moritz Pflanzer | ee493ae | 2017-07-05 10:52:21 +0100 | [diff] [blame] | 402 | { |
| 403 | std::stringstream str; |
| 404 | str << data_type; |
| 405 | return str.str(); |
| 406 | } |
| 407 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 408 | /** Formatted output of the Format type. */ |
| 409 | inline ::std::ostream &operator<<(::std::ostream &os, const Format &format) |
| 410 | { |
| 411 | switch(format) |
| 412 | { |
| 413 | case Format::UNKNOWN: |
| 414 | os << "UNKNOWN"; |
| 415 | break; |
| 416 | case Format::U8: |
| 417 | os << "U8"; |
| 418 | break; |
| 419 | case Format::S16: |
| 420 | os << "S16"; |
| 421 | break; |
| 422 | case Format::U16: |
| 423 | os << "U16"; |
| 424 | break; |
| 425 | case Format::S32: |
| 426 | os << "S32"; |
| 427 | break; |
| 428 | case Format::U32: |
| 429 | os << "U32"; |
| 430 | break; |
| 431 | case Format::F16: |
| 432 | os << "F16"; |
| 433 | break; |
| 434 | case Format::F32: |
| 435 | os << "F32"; |
| 436 | break; |
| 437 | case Format::UV88: |
| 438 | os << "UV88"; |
| 439 | break; |
| 440 | case Format::RGB888: |
| 441 | os << "RGB888"; |
| 442 | break; |
| 443 | case Format::RGBA8888: |
| 444 | os << "RGBA8888"; |
| 445 | break; |
| 446 | case Format::YUV444: |
| 447 | os << "YUV444"; |
| 448 | break; |
| 449 | case Format::YUYV422: |
| 450 | os << "YUYV422"; |
| 451 | break; |
| 452 | case Format::NV12: |
| 453 | os << "NV12"; |
| 454 | break; |
| 455 | case Format::NV21: |
| 456 | os << "NV21"; |
| 457 | break; |
| 458 | case Format::IYUV: |
| 459 | os << "IYUV"; |
| 460 | break; |
| 461 | case Format::UYVY422: |
| 462 | os << "UYVY422"; |
| 463 | break; |
| 464 | default: |
| 465 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 466 | } |
| 467 | |
| 468 | return os; |
| 469 | } |
| 470 | |
Moritz Pflanzer | 7655a67 | 2017-09-23 11:57:33 +0100 | [diff] [blame] | 471 | inline std::string to_string(const Format &format) |
| 472 | { |
| 473 | std::stringstream str; |
| 474 | str << format; |
| 475 | return str.str(); |
| 476 | } |
| 477 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 478 | /** Formatted output of the Channel type. */ |
| 479 | inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel) |
| 480 | { |
| 481 | switch(channel) |
| 482 | { |
| 483 | case Channel::UNKNOWN: |
| 484 | os << "UNKNOWN"; |
| 485 | break; |
| 486 | case Channel::C0: |
| 487 | os << "C0"; |
| 488 | break; |
| 489 | case Channel::C1: |
| 490 | os << "C1"; |
| 491 | break; |
| 492 | case Channel::C2: |
| 493 | os << "C2"; |
| 494 | break; |
| 495 | case Channel::C3: |
| 496 | os << "C3"; |
| 497 | break; |
| 498 | case Channel::R: |
| 499 | os << "R"; |
| 500 | break; |
| 501 | case Channel::G: |
| 502 | os << "G"; |
| 503 | break; |
| 504 | case Channel::B: |
| 505 | os << "B"; |
| 506 | break; |
| 507 | case Channel::A: |
| 508 | os << "A"; |
| 509 | break; |
| 510 | case Channel::Y: |
| 511 | os << "Y"; |
| 512 | break; |
| 513 | case Channel::U: |
| 514 | os << "U"; |
| 515 | break; |
| 516 | case Channel::V: |
| 517 | os << "V"; |
| 518 | break; |
| 519 | default: |
| 520 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 521 | } |
| 522 | |
| 523 | return os; |
| 524 | } |
| 525 | |
Ioan-Cristian Szabo | 9414f64 | 2017-10-27 17:35:40 +0100 | [diff] [blame] | 526 | inline std::string to_string(const Channel &channel) |
| 527 | { |
| 528 | std::stringstream str; |
| 529 | str << channel; |
| 530 | return str.str(); |
| 531 | } |
| 532 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 533 | /** Formatted output of the BorderMode type. */ |
| 534 | inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode) |
| 535 | { |
| 536 | switch(mode) |
| 537 | { |
| 538 | case BorderMode::UNDEFINED: |
| 539 | os << "UNDEFINED"; |
| 540 | break; |
| 541 | case BorderMode::CONSTANT: |
| 542 | os << "CONSTANT"; |
| 543 | break; |
| 544 | case BorderMode::REPLICATE: |
| 545 | os << "REPLICATE"; |
| 546 | break; |
| 547 | default: |
| 548 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 549 | } |
| 550 | |
| 551 | return os; |
| 552 | } |
| 553 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 554 | /** Formatted output of the BorderSize type. */ |
| 555 | inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border) |
| 556 | { |
Moritz Pflanzer | c87fbf8 | 2017-07-18 14:02:10 +0100 | [diff] [blame] | 557 | os << border.top << "," |
| 558 | << border.right << "," |
| 559 | << border.bottom << "," |
| 560 | << border.left; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 561 | |
| 562 | return os; |
| 563 | } |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 564 | |
| 565 | /** Formatted output of the InterpolationPolicy type. */ |
| 566 | inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy) |
| 567 | { |
| 568 | switch(policy) |
| 569 | { |
| 570 | case InterpolationPolicy::NEAREST_NEIGHBOR: |
| 571 | os << "NEAREST_NEIGHBOR"; |
| 572 | break; |
| 573 | case InterpolationPolicy::BILINEAR: |
| 574 | os << "BILINEAR"; |
| 575 | break; |
| 576 | case InterpolationPolicy::AREA: |
| 577 | os << "AREA"; |
| 578 | break; |
| 579 | default: |
| 580 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 581 | } |
| 582 | |
| 583 | return os; |
| 584 | } |
| 585 | |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 586 | /** Formatted output of the SamplingPolicy type. */ |
| 587 | inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy) |
| 588 | { |
| 589 | switch(policy) |
| 590 | { |
| 591 | case SamplingPolicy::CENTER: |
| 592 | os << "CENTER"; |
| 593 | break; |
| 594 | case SamplingPolicy::TOP_LEFT: |
| 595 | os << "TOP_LEFT"; |
| 596 | break; |
| 597 | default: |
| 598 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 599 | } |
| 600 | |
| 601 | return os; |
| 602 | } |
| 603 | |
Georgios Pinitas | 3faea25 | 2017-10-30 14:13:50 +0000 | [diff] [blame] | 604 | /** Formatted output of the TensorInfo type. */ |
| 605 | inline std::string to_string(const TensorInfo &info) |
| 606 | { |
| 607 | std::stringstream str; |
| 608 | str << "{Shape=" << info.tensor_shape() << "," |
| 609 | << "Type=" << info.data_type() << "," |
| 610 | << "Channels=" << info.num_channels() << "," |
| 611 | << "FixedPointPos=" << info.fixed_point_position() << "}"; |
| 612 | return str.str(); |
| 613 | } |
| 614 | |
Abe Mbise | 925ca0f | 2017-10-02 19:16:33 +0100 | [diff] [blame] | 615 | //FIXME: Check why this doesn't work and the TensorShape and Coordinates overload are needed |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 616 | template <typename T> |
| 617 | inline std::string to_string(const Dimensions<T> &dimensions) |
| 618 | { |
| 619 | std::stringstream str; |
| 620 | str << dimensions; |
| 621 | return str.str(); |
| 622 | } |
| 623 | |
John Richardson | a36eae1 | 2017-09-26 16:55:59 +0100 | [diff] [blame] | 624 | inline std::string to_string(const Strides &stride) |
| 625 | { |
| 626 | std::stringstream str; |
| 627 | str << stride; |
| 628 | return str.str(); |
| 629 | } |
| 630 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 631 | /** Formatted output of the TensorShape type. */ |
| 632 | inline std::string to_string(const TensorShape &shape) |
| 633 | { |
| 634 | std::stringstream str; |
| 635 | str << shape; |
| 636 | return str.str(); |
| 637 | } |
| 638 | |
Abe Mbise | 925ca0f | 2017-10-02 19:16:33 +0100 | [diff] [blame] | 639 | /** Formatted output of the Coordinates type. */ |
| 640 | inline std::string to_string(const Coordinates &coord) |
| 641 | { |
| 642 | std::stringstream str; |
| 643 | str << coord; |
| 644 | return str.str(); |
| 645 | } |
| 646 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 647 | /** Formatted output of the Rectangle type. */ |
| 648 | inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect) |
| 649 | { |
| 650 | os << rect.width << "x" << rect.height; |
| 651 | os << "+" << rect.x << "+" << rect.y; |
| 652 | |
| 653 | return os; |
| 654 | } |
| 655 | |
| 656 | /** Formatted output of the PadStridInfo type. */ |
| 657 | inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info) |
| 658 | { |
| 659 | os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second; |
| 660 | os << ";"; |
Jaroslaw Rzepecki | a1ed41f | 2017-10-13 11:13:58 +0100 | [diff] [blame] | 661 | os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << "," |
| 662 | << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom(); |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 663 | |
| 664 | return os; |
| 665 | } |
| 666 | |
| 667 | inline std::string to_string(const PadStrideInfo &pad_stride_info) |
| 668 | { |
| 669 | std::stringstream str; |
| 670 | str << pad_stride_info; |
| 671 | return str.str(); |
| 672 | } |
| 673 | |
| 674 | inline std::string to_string(const BorderMode &mode) |
| 675 | { |
| 676 | std::stringstream str; |
| 677 | str << mode; |
| 678 | return str.str(); |
| 679 | } |
| 680 | |
John Richardson | b482ce1 | 2017-09-18 12:44:01 +0100 | [diff] [blame] | 681 | inline std::string to_string(const BorderSize &border) |
| 682 | { |
| 683 | std::stringstream str; |
| 684 | str << border; |
| 685 | return str.str(); |
| 686 | } |
| 687 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 688 | inline std::string to_string(const InterpolationPolicy &policy) |
| 689 | { |
| 690 | std::stringstream str; |
| 691 | str << policy; |
| 692 | return str.str(); |
| 693 | } |
| 694 | |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 695 | inline std::string to_string(const SamplingPolicy &policy) |
| 696 | { |
| 697 | std::stringstream str; |
| 698 | str << policy; |
| 699 | return str.str(); |
| 700 | } |
| 701 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 702 | /** Formatted output of the ConversionPolicy type. */ |
| 703 | inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy) |
| 704 | { |
| 705 | switch(policy) |
| 706 | { |
| 707 | case ConvertPolicy::WRAP: |
| 708 | os << "WRAP"; |
| 709 | break; |
| 710 | case ConvertPolicy::SATURATE: |
| 711 | os << "SATURATE"; |
| 712 | break; |
| 713 | default: |
| 714 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 715 | } |
| 716 | |
| 717 | return os; |
| 718 | } |
| 719 | |
| 720 | inline std::string to_string(const ConvertPolicy &policy) |
| 721 | { |
| 722 | std::stringstream str; |
| 723 | str << policy; |
| 724 | return str.str(); |
| 725 | } |
| 726 | |
| 727 | /** Formatted output of the Reduction Operations. */ |
| 728 | inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op) |
| 729 | { |
| 730 | switch(op) |
| 731 | { |
| 732 | case ReductionOperation::SUM_SQUARE: |
| 733 | os << "SUM_SQUARE"; |
| 734 | break; |
| 735 | default: |
| 736 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 737 | } |
| 738 | |
| 739 | return os; |
| 740 | } |
| 741 | |
| 742 | inline std::string to_string(const ReductionOperation &op) |
| 743 | { |
| 744 | std::stringstream str; |
| 745 | str << op; |
| 746 | return str.str(); |
| 747 | } |
| 748 | |
| 749 | inline std::string to_string(const NormType &type) |
| 750 | { |
| 751 | std::stringstream str; |
| 752 | str << type; |
| 753 | return str.str(); |
| 754 | } |
| 755 | |
| 756 | inline std::string to_string(const PoolingType &type) |
| 757 | { |
| 758 | std::stringstream str; |
| 759 | str << type; |
| 760 | return str.str(); |
| 761 | } |
| 762 | |
| 763 | inline std::string to_string(const PoolingLayerInfo &info) |
| 764 | { |
| 765 | std::stringstream str; |
Georgios Pinitas | 4c2dd54 | 2017-11-13 12:58:41 +0000 | [diff] [blame] | 766 | str << "{Type=" << info.pool_type() << "," |
| 767 | << "IsGlobalPooling=" << info.is_global_pooling(); |
| 768 | if(!info.is_global_pooling()) |
| 769 | { |
| 770 | str << "," |
Isabella Gottardi | 6e464c3 | 2018-01-26 12:32:45 +0000 | [diff] [blame] | 771 | << "PoolSize=" << info.pool_size().width << "," << info.pool_size().height << "," |
Georgios Pinitas | 4c2dd54 | 2017-11-13 12:58:41 +0000 | [diff] [blame] | 772 | << "PadStride=" << info.pad_stride_info(); |
| 773 | } |
| 774 | str << "}"; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 775 | return str.str(); |
| 776 | } |
| 777 | |
Moritz Pflanzer | 6c6597c | 2017-09-24 12:09:41 +0100 | [diff] [blame] | 778 | /** Formatted output of the KeyPoint type. */ |
| 779 | inline ::std::ostream &operator<<(::std::ostream &os, const KeyPoint &point) |
| 780 | { |
| 781 | os << "{x=" << point.x << "," |
| 782 | << "y=" << point.y << "," |
| 783 | << "strength=" << point.strength << "," |
| 784 | << "scale=" << point.scale << "," |
| 785 | << "orientation=" << point.orientation << "," |
| 786 | << "tracking_status=" << point.tracking_status << "," |
| 787 | << "error=" << point.error << "}"; |
| 788 | |
| 789 | return os; |
| 790 | } |
John Richardson | 63e5041 | 2017-10-13 20:51:42 +0100 | [diff] [blame] | 791 | |
| 792 | /** Formatted output of the PhaseType type. */ |
| 793 | inline ::std::ostream &operator<<(::std::ostream &os, const PhaseType &phase_type) |
| 794 | { |
| 795 | switch(phase_type) |
| 796 | { |
| 797 | case PhaseType::SIGNED: |
| 798 | os << "SIGNED"; |
| 799 | break; |
| 800 | case PhaseType::UNSIGNED: |
| 801 | os << "UNSIGNED"; |
| 802 | break; |
| 803 | default: |
| 804 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 805 | } |
| 806 | |
| 807 | return os; |
| 808 | } |
| 809 | |
| 810 | inline std::string to_string(const arm_compute::PhaseType &type) |
| 811 | { |
| 812 | std::stringstream str; |
| 813 | str << type; |
| 814 | return str.str(); |
| 815 | } |
John Richardson | 3c5f949 | 2017-10-04 15:27:37 +0100 | [diff] [blame] | 816 | |
| 817 | /** Formatted output of the MagnitudeType type. */ |
| 818 | inline ::std::ostream &operator<<(::std::ostream &os, const MagnitudeType &magnitude_type) |
| 819 | { |
| 820 | switch(magnitude_type) |
| 821 | { |
| 822 | case MagnitudeType::L1NORM: |
| 823 | os << "L1NORM"; |
| 824 | break; |
| 825 | case MagnitudeType::L2NORM: |
| 826 | os << "L2NORM"; |
| 827 | break; |
| 828 | default: |
| 829 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 830 | } |
| 831 | |
| 832 | return os; |
| 833 | } |
| 834 | |
| 835 | inline std::string to_string(const arm_compute::MagnitudeType &type) |
| 836 | { |
| 837 | std::stringstream str; |
| 838 | str << type; |
| 839 | return str.str(); |
| 840 | } |
John Richardson | 1c52992 | 2017-11-01 10:57:48 +0000 | [diff] [blame] | 841 | |
| 842 | /** Formatted output of the GradientDimension type. */ |
| 843 | inline ::std::ostream &operator<<(::std::ostream &os, const GradientDimension &dim) |
| 844 | { |
| 845 | switch(dim) |
| 846 | { |
| 847 | case GradientDimension::GRAD_X: |
| 848 | os << "GRAD_X"; |
| 849 | break; |
| 850 | case GradientDimension::GRAD_Y: |
| 851 | os << "GRAD_Y"; |
| 852 | break; |
| 853 | case GradientDimension::GRAD_XY: |
| 854 | os << "GRAD_XY"; |
| 855 | break; |
| 856 | default: |
| 857 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 858 | } |
| 859 | |
| 860 | return os; |
| 861 | } |
| 862 | |
| 863 | inline std::string to_string(const arm_compute::GradientDimension &type) |
| 864 | { |
| 865 | std::stringstream str; |
| 866 | str << type; |
| 867 | return str.str(); |
| 868 | } |
John Richardson | 25f2368 | 2017-11-27 14:35:09 +0000 | [diff] [blame] | 869 | |
| 870 | /** Formatted output of the HOGNormType type. */ |
| 871 | inline ::std::ostream &operator<<(::std::ostream &os, const HOGNormType &norm_type) |
| 872 | { |
| 873 | switch(norm_type) |
| 874 | { |
| 875 | case HOGNormType::L1_NORM: |
| 876 | os << "L1_NORM"; |
| 877 | break; |
| 878 | case HOGNormType::L2_NORM: |
| 879 | os << "L2_NORM"; |
| 880 | break; |
| 881 | case HOGNormType::L2HYS_NORM: |
| 882 | os << "L2HYS_NORM"; |
| 883 | break; |
| 884 | default: |
| 885 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 886 | } |
| 887 | |
| 888 | return os; |
| 889 | } |
| 890 | |
| 891 | inline std::string to_string(const HOGNormType &type) |
| 892 | { |
| 893 | std::stringstream str; |
| 894 | str << type; |
| 895 | return str.str(); |
| 896 | } |
| 897 | |
| 898 | /** Formatted output of the Size2D type. */ |
| 899 | inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size) |
| 900 | { |
| 901 | os << size.width << "x" << size.height; |
| 902 | |
| 903 | return os; |
| 904 | } |
| 905 | |
| 906 | inline std::string to_string(const Size2D &type) |
| 907 | { |
| 908 | std::stringstream str; |
| 909 | str << type; |
| 910 | return str.str(); |
| 911 | } |
| 912 | |
| 913 | /** Formatted output of the Size2D type. */ |
| 914 | inline ::std::ostream &operator<<(::std::ostream &os, const HOGInfo &hog_info) |
| 915 | { |
| 916 | os << "{CellSize=" << hog_info.cell_size() << "," |
| 917 | << "BlockSize=" << hog_info.block_size() << "," |
| 918 | << "DetectionWindowSize=" << hog_info.detection_window_size() << "," |
| 919 | << "BlockStride=" << hog_info.block_stride() << "," |
| 920 | << "NumBins=" << hog_info.num_bins() << "," |
| 921 | << "NormType=" << hog_info.normalization_type() << "," |
| 922 | << "L2HystThreshold=" << hog_info.l2_hyst_threshold() << "," |
| 923 | << "PhaseType=" << hog_info.phase_type() << "}"; |
| 924 | |
| 925 | return os; |
| 926 | } |
| 927 | |
| 928 | /** Formatted output of the HOGInfo type. */ |
| 929 | inline std::string to_string(const HOGInfo &type) |
| 930 | { |
| 931 | std::stringstream str; |
| 932 | str << type; |
| 933 | return str.str(); |
| 934 | } |
| 935 | |
Isabella Gottardi | f07d28d | 2018-02-06 14:52:43 +0000 | [diff] [blame] | 936 | inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method) |
| 937 | { |
| 938 | switch(conv_method) |
| 939 | { |
| 940 | case ConvolutionMethod::GEMM: |
| 941 | os << "GEMM"; |
| 942 | break; |
| 943 | case ConvolutionMethod::DIRECT: |
| 944 | os << "DIRECT"; |
| 945 | break; |
| 946 | case ConvolutionMethod::WINOGRAD: |
| 947 | os << "WINOGRAD"; |
| 948 | break; |
| 949 | default: |
| 950 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 951 | } |
| 952 | |
| 953 | return os; |
| 954 | } |
| 955 | |
| 956 | inline std::string to_string(const ConvolutionMethod &conv_method) |
| 957 | { |
| 958 | std::stringstream str; |
| 959 | str << conv_method; |
| 960 | return str.str(); |
| 961 | } |
| 962 | |
| 963 | inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target) |
| 964 | { |
| 965 | switch(gpu_target) |
| 966 | { |
| 967 | case GPUTarget::GPU_ARCH_MASK: |
| 968 | os << "GPU_ARCH_MASK"; |
| 969 | break; |
| 970 | case GPUTarget::MIDGARD: |
| 971 | os << "MIDGARD"; |
| 972 | break; |
| 973 | case GPUTarget::BIFROST: |
| 974 | os << "BIFROST"; |
| 975 | break; |
| 976 | case GPUTarget::T600: |
| 977 | os << "T600"; |
| 978 | break; |
| 979 | case GPUTarget::T700: |
| 980 | os << "T700"; |
| 981 | break; |
| 982 | case GPUTarget::T800: |
| 983 | os << "T800"; |
| 984 | break; |
| 985 | case GPUTarget::G70: |
| 986 | os << "G70"; |
| 987 | break; |
| 988 | default: |
| 989 | ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); |
| 990 | } |
| 991 | |
| 992 | return os; |
| 993 | } |
| 994 | |
| 995 | inline std::string to_string(const GPUTarget &gpu_target) |
| 996 | { |
| 997 | std::stringstream str; |
| 998 | str << gpu_target; |
| 999 | return str.str(); |
| 1000 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1001 | } // namespace arm_compute |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 1002 | #endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */ |