diff options
-rw-r--r-- | framework/DatasetModes.cpp | 4 | ||||
-rw-r--r-- | framework/Exceptions.cpp | 4 | ||||
-rw-r--r-- | framework/Utils.h | 15 | ||||
-rw-r--r-- | framework/instruments/Instruments.cpp | 4 | ||||
-rw-r--r-- | framework/printers/Printers.cpp | 4 |
5 files changed, 27 insertions, 4 deletions
diff --git a/framework/DatasetModes.cpp b/framework/DatasetModes.cpp index 0a9e92a38b..3f747df747 100644 --- a/framework/DatasetModes.cpp +++ b/framework/DatasetModes.cpp @@ -23,6 +23,8 @@ */ #include "DatasetModes.h" +#include "Utils.h" + #include <map> namespace arm_compute @@ -42,7 +44,7 @@ DatasetMode dataset_mode_from_name(const std::string &name) try { - return modes.at(name); + return modes.at(tolower(name)); } catch(const std::out_of_range &) { diff --git a/framework/Exceptions.cpp b/framework/Exceptions.cpp index 46b1eac974..3d6c65c181 100644 --- a/framework/Exceptions.cpp +++ b/framework/Exceptions.cpp @@ -23,6 +23,8 @@ */ #include "Exceptions.h" +#include "Utils.h" + #include <map> #include <sstream> @@ -47,7 +49,7 @@ LogLevel log_level_from_name(const std::string &name) try { - return levels.at(name); + return levels.at(tolower(name)); } catch(const std::out_of_range &) { diff --git a/framework/Utils.h b/framework/Utils.h index e9298618e8..a9fe0dcaa3 100644 --- a/framework/Utils.h +++ b/framework/Utils.h @@ -137,6 +137,21 @@ std::string join(T && first, T && last, const std::string &separator) { return join(std::forward<T>(first), std::forward<T>(last), separator, support::cpp11::to_string); } + +/** Convert string to lower case. + * + * @param[in] string To be converted string. + * + * @return Lower case string. + */ +inline std::string tolower(std::string string) +{ + std::transform(string.begin(), string.end(), string.begin(), [](unsigned char c) + { + return std::tolower(c); + }); + return string; +} } // namespace framework } // namespace test } // namespace arm_compute diff --git a/framework/instruments/Instruments.cpp b/framework/instruments/Instruments.cpp index 7a26944d26..12ad86c70a 100644 --- a/framework/instruments/Instruments.cpp +++ b/framework/instruments/Instruments.cpp @@ -23,6 +23,8 @@ */ #include "Instruments.h" +#include "framework/Utils.h" + #include <map> #include <stdexcept> @@ -45,7 +47,7 @@ InstrumentType instrument_type_from_name(const std::string &name) try { - return types.at(name); + return types.at(tolower(name)); } catch(const std::out_of_range &) { diff --git a/framework/printers/Printers.cpp b/framework/printers/Printers.cpp index 6b53a0c33d..9ca5e317b3 100644 --- a/framework/printers/Printers.cpp +++ b/framework/printers/Printers.cpp @@ -23,6 +23,8 @@ */ #include "Printers.h" +#include "framework/Utils.h" + #include <map> #include <stdexcept> @@ -43,7 +45,7 @@ LogFormat log_format_from_name(const std::string &name) try { - return formats.at(name); + return formats.at(tolower(name)); } catch(const std::out_of_range &) { |