aboutsummaryrefslogtreecommitdiff
path: root/tests/NetworkExecutionUtils
diff options
context:
space:
mode:
authorDavid Monahan <david.monahan@arm.com>2020-04-16 10:01:56 +0100
committerDavid Monahan <david.monahan@arm.com>2020-04-20 12:20:18 +0100
commita8837bfcf45136f178a9884b7c6f6449b3e6ed41 (patch)
tree0fa2c4de3646d27f1029d5ebd2cf966c3005522c /tests/NetworkExecutionUtils
parent9b89e0a5e4398672c3b9423b02b3a9257e0ea95f (diff)
downloadarmnn-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/NetworkExecutionUtils')
-rw-r--r--tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp22
1 files changed, 5 insertions, 17 deletions
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(