diff options
author | David Monahan <david.monahan@arm.com> | 2020-04-16 10:01:56 +0100 |
---|---|---|
committer | David Monahan <david.monahan@arm.com> | 2020-04-20 12:20:18 +0100 |
commit | a8837bfcf45136f178a9884b7c6f6449b3e6ed41 (patch) | |
tree | 0fa2c4de3646d27f1029d5ebd2cf966c3005522c /tests | |
parent | 9b89e0a5e4398672c3b9423b02b3a9257e0ea95f (diff) | |
download | armnn-a8837bfcf45136f178a9884b7c6f6449b3e6ed41.tar.gz |
IVGCVSW-4513 Remove boost/algorithm/string *
* Removed split, classification, trim, string, join, contains
* Added StringUtils.hpp to replace the removed Boost String functionality
Signed-off-by: David Monahan <david.monahan@arm.com>
Change-Id: I8aa938dc3942cb65c512cccb2c069da66aa24668
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DeepSpeechV1Database.hpp | 12 | ||||
-rw-r--r-- | tests/InferenceModel.hpp | 4 | ||||
-rw-r--r-- | tests/InferenceTest.cpp | 1 | ||||
-rw-r--r-- | tests/InferenceTest.inl | 1 | ||||
-rw-r--r-- | tests/ModelAccuracyTool-Armnn/ModelAccuracyTool-Armnn.cpp | 1 | ||||
-rw-r--r-- | tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp | 22 |
6 files changed, 8 insertions, 33 deletions
diff --git a/tests/DeepSpeechV1Database.hpp b/tests/DeepSpeechV1Database.hpp index 81523775db..85654b6beb 100644 --- a/tests/DeepSpeechV1Database.hpp +++ b/tests/DeepSpeechV1Database.hpp @@ -30,17 +30,7 @@ std::vector<T> ParseArrayImpl(std::istream& stream, TParseElementFunc parseEleme std::string line; while (std::getline(stream, line)) { - std::vector<std::string> tokens; - try - { - // Coverity fix: boost::split() may throw an exception of type boost::bad_function_call. - boost::split(tokens, line, boost::algorithm::is_any_of(chars), boost::token_compress_on); - } - catch (const std::exception& e) - { - ARMNN_LOG(error) << "An error occurred when splitting tokens: " << e.what(); - continue; - } + std::vector<std::string> tokens = armnn::stringUtils::StringTokenizer(line, chars); for (const std::string& token : tokens) { if (!token.empty()) // See https://stackoverflow.com/questions/10437406/ diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp index af931f99f8..410bc7c04e 100644 --- a/tests/InferenceModel.hpp +++ b/tests/InferenceModel.hpp @@ -22,7 +22,7 @@ #include <HeapProfiling.hpp> #include <TensorIOUtils.hpp> -#include <boost/algorithm/string/join.hpp> +#include "armnn/utility/StringUtils.hpp" #include <boost/exception/exception.hpp> #include <boost/exception/diagnostic_information.hpp> #include <boost/format.hpp> @@ -354,7 +354,7 @@ public: ("model-dir,m", po::value<std::string>(&options.m_ModelDir)->required(), "Path to directory containing model files (.caffemodel/.prototxt/.tflite)") ("compute,c", po::value<std::vector<std::string>>(&options.m_ComputeDevices)-> - default_value(defaultComputes, boost::algorithm::join(defaultComputes, ", "))-> + default_value(defaultComputes, armnn::stringUtils::StringConcat(defaultComputes, ", "))-> multitoken(), backendsMessage.c_str()) ("dynamic-backends-path,b", po::value(&options.m_DynamicBackendsPath), "Path where to load any available dynamic backend from. " diff --git a/tests/InferenceTest.cpp b/tests/InferenceTest.cpp index 7e165b5137..1df399b6a4 100644 --- a/tests/InferenceTest.cpp +++ b/tests/InferenceTest.cpp @@ -7,7 +7,6 @@ #include <armnn/utility/Assert.hpp> #include "../src/armnn/Profiling.hpp" -#include <boost/algorithm/string.hpp> #include <boost/numeric/conversion/cast.hpp> #include <boost/filesystem/path.hpp> #include <boost/format.hpp> diff --git a/tests/InferenceTest.inl b/tests/InferenceTest.inl index ed16464787..32a164dc43 100644 --- a/tests/InferenceTest.inl +++ b/tests/InferenceTest.inl @@ -5,7 +5,6 @@ #include "InferenceTest.hpp" #include <armnn/utility/Assert.hpp> -#include <boost/algorithm/string.hpp> #include <boost/numeric/conversion/cast.hpp> #include <boost/filesystem/path.hpp> #include <boost/format.hpp> diff --git a/tests/ModelAccuracyTool-Armnn/ModelAccuracyTool-Armnn.cpp b/tests/ModelAccuracyTool-Armnn/ModelAccuracyTool-Armnn.cpp index dd1c295d37..20f6180700 100644 --- a/tests/ModelAccuracyTool-Armnn/ModelAccuracyTool-Armnn.cpp +++ b/tests/ModelAccuracyTool-Armnn/ModelAccuracyTool-Armnn.cpp @@ -8,7 +8,6 @@ #include "ModelAccuracyChecker.hpp" #include "armnnDeserializer/IDeserializer.hpp" -#include <boost/algorithm/string.hpp> #include <boost/filesystem.hpp> #include <boost/program_options/variables_map.hpp> #include <boost/range/iterator_range.hpp> diff --git a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp index 278ba1b46a..a922228689 100644 --- a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp +++ b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp @@ -26,9 +26,6 @@ #include <Profiling.hpp> #include <ResolveType.hpp> -#include <boost/algorithm/string/trim.hpp> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> #include <boost/program_options.hpp> #include <boost/variant.hpp> @@ -53,17 +50,7 @@ std::vector<T> ParseArrayImpl(std::istream& stream, TParseElementFunc parseEleme std::string line; while (std::getline(stream, line)) { - std::vector<std::string> tokens; - try - { - // Coverity fix: boost::split() may throw an exception of type boost::bad_function_call. - boost::split(tokens, line, boost::algorithm::is_any_of(chars), boost::token_compress_on); - } - catch (const std::exception& e) - { - ARMNN_LOG(error) << "An error occurred when splitting tokens: " << e.what(); - continue; - } + std::vector<std::string> tokens = armnn::stringUtils::StringTokenizer(line, chars); for (const std::string& token : tokens) { if (!token.empty()) // See https://stackoverflow.com/questions/10437406/ @@ -174,7 +161,8 @@ std::vector<unsigned int> ParseArray(std::istream& stream) std::vector<std::string> ParseStringList(const std::string & inputString, const char * delimiter) { std::stringstream stream(inputString); - return ParseArrayImpl<std::string>(stream, [](const std::string& s) { return boost::trim_copy(s); }, delimiter); + return ParseArrayImpl<std::string>(stream, [](const std::string& s) { + return armnn::stringUtils::StringTrimCopy(s); }, delimiter); } void RemoveDuplicateDevices(std::vector<armnn::BackendId>& computeDevices) @@ -559,8 +547,8 @@ int RunTest(const std::string& format, bool parseUnsupported = false, const std::shared_ptr<armnn::IRuntime>& runtime = nullptr) { - std::string modelFormat = boost::trim_copy(format); - std::string modelPath = boost::trim_copy(path); + std::string modelFormat = armnn::stringUtils::StringTrimCopy(format); + std::string modelPath = armnn::stringUtils::StringTrimCopy(path); std::vector<std::string> inputNamesVector = ParseStringList(inputNames, ","); std::vector<std::string> inputTensorShapesVector = ParseStringList(inputTensorShapesStr, ":"); std::vector<std::string> inputTensorDataFilePathsVector = ParseStringList( |