From e357a254a830bf4d66f235813fac021d61cf225d Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Sun, 9 Aug 2020 20:05:52 +0100 Subject: COMPMID-3454 Patch1: Relocate data_type_from_name to core/Utils Change-Id: I33436dab77a47868fbd9872e0b4cf54b3a173e65 Signed-off-by: SiCong Li Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3694 Tested-by: Arm Jenkins Reviewed-by: Manuel Bottini Comments-Addressed: Arm Jenkins --- arm_compute/core/Utils.h | 21 +++++++++++++++++++++ arm_compute/graph/TypeLoader.h | 25 +------------------------ 2 files changed, 22 insertions(+), 24 deletions(-) (limited to 'arm_compute') diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index 7a1cc99127..13c2971930 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -1084,6 +1084,27 @@ const std::string &string_from_gemmlowp_output_stage(GEMMLowpOutputStageType out * @return String representation of the PixelValue through the given data type. */ std::string string_from_pixel_value(const PixelValue &value, const DataType data_type); +/** Convert a string to DataType + * + * @param[in] name The name of the data type + * + * @return DataType + */ +DataType data_type_from_name(const std::string &name); +/** Input Stream operator for @ref DataType + * + * @param[in] stream Stream to parse + * @param[out] data_type Output data type + * + * @return Updated stream + */ +inline ::std::istream &operator>>(::std::istream &stream, DataType &data_type) +{ + std::string value; + stream >> value; + data_type = data_type_from_name(value); + return stream; +} /** Lower a given string. * * @param[in] val Given string to lower. diff --git a/arm_compute/graph/TypeLoader.h b/arm_compute/graph/TypeLoader.h index a53af40f77..286bfebeb5 100644 --- a/arm_compute/graph/TypeLoader.h +++ b/arm_compute/graph/TypeLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -30,29 +30,6 @@ namespace arm_compute { -/** Converts a string to a strong types enumeration @ref DataType - * - * @param[in] name String to convert - * - * @return Converted DataType enumeration - */ -arm_compute::DataType data_type_from_name(const std::string &name); - -/** Input Stream operator for @ref DataType - * - * @param[in] stream Stream to parse - * @param[out] data_type Output data type - * - * @return Updated stream - */ -inline ::std::istream &operator>>(::std::istream &stream, arm_compute::DataType &data_type) -{ - std::string value; - stream >> value; - data_type = data_type_from_name(value); - return stream; -} - /** Converts a string to a strong types enumeration @ref DataLayout * * @param[in] name String to convert -- cgit v1.2.1