aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2020-08-09 20:05:52 +0100
committerSiCong Li <sicong.li@arm.com>2020-08-18 08:59:05 +0000
commite357a254a830bf4d66f235813fac021d61cf225d (patch)
tree29d2d0f836a3efb3bae11bf0a8e35237b8a0ffa7 /tests
parenta45abfd9ac805c8452c56172583dcf0dcf41f9db (diff)
downloadComputeLibrary-e357a254a830bf4d66f235813fac021d61cf225d.tar.gz
COMPMID-3454 Patch1: Relocate data_type_from_name to core/Utils
Change-Id: I33436dab77a47868fbd9872e0b4cf54b3a173e65 Signed-off-by: SiCong Li <sicong.li@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3694 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Manuel Bottini <manuel.bottini@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/validate_examples/cl_gemm.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/tests/validate_examples/cl_gemm.cpp b/tests/validate_examples/cl_gemm.cpp
index 34895840e1..0e71f9d5bf 100644
--- a/tests/validate_examples/cl_gemm.cpp
+++ b/tests/validate_examples/cl_gemm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited.
+ * Copyright (c) 2017-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -26,6 +26,7 @@
#endif /* ARM_COMPUTE_CL */
#include "arm_compute/core/Types.h"
+#include "arm_compute/core/Utils.h"
#include "arm_compute/core/utils/quantization/AsymmHelpers.h"
#include "arm_compute/runtime/CL/CLFunctions.h"
#include "arm_compute/runtime/CL/CLScheduler.h"
@@ -59,40 +60,6 @@ RelativeTolerance<float> tolerance_f32(0.001f); /**< F32 Toleran
RelativeTolerance<half_float::half> tolerance_f16(half(0.2)); /**< F16 Tolerance value for comparing reference's output against implementation's output for floating point data types */
constexpr float tolerance_num_f16 = 0.02f; /**< F16 Tolerance number */
-namespace arm_compute
-{
-DataType data_type_from_name(const std::string &name)
-{
- static const std::map<std::string, DataType> data_types =
- {
- { "f16", DataType::F16 },
- { "f32", DataType::F32 },
- { "qasymm8", DataType::QASYMM8 },
- };
-
-#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
- try
- {
-#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
- return data_types.at(utility::tolower(name));
-
-#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
- }
- catch(const std::out_of_range &)
- {
- throw std::invalid_argument(name);
- }
-#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
-}
-
-inline ::std::istream &operator>>(::std::istream &stream, DataType &data_type)
-{
- std::string value;
- stream >> value;
- data_type = data_type_from_name(value);
- return stream;
-}
-} // namespace arm_compute
namespace
{
class GEMMCommandLineOptions final