diff options
author | Colm Donelan <colm.donelan@arm.com> | 2023-12-08 15:49:54 +0000 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2023-12-13 12:03:25 +0000 |
commit | 5ea6e3fcc6b0baa822c0b063e474b560ea192339 (patch) | |
tree | 84e617ea1d2b4dfc047f55f788f658edfc86a58b /tests | |
parent | 6f98074958b9dcdf8dfde50c0aa868755d6815ac (diff) | |
download | armnn-5ea6e3fcc6b0baa822c0b063e474b560ea192339.tar.gz |
Removing unnecessary schema dependency from delegate unit tests.
* All of the unit tests were including the TfL schema even though it
is not used. This prevented building with delegate and not TfL parser.
* Fixing some template compile errors that were introduced when
FileComparisonExecutorTests.cpp was compiled without TfL parser.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: I86742d57a6520ab6bd8336a683fee29de326fff5
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ExecuteNetwork/FileComparisonExecutor.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/ExecuteNetwork/FileComparisonExecutor.cpp b/tests/ExecuteNetwork/FileComparisonExecutor.cpp index e4699acd2e..844004bf71 100644 --- a/tests/ExecuteNetwork/FileComparisonExecutor.cpp +++ b/tests/ExecuteNetwork/FileComparisonExecutor.cpp @@ -87,7 +87,10 @@ unsigned int ExtractHeader(const std::vector<char>& buffer, std::string& tensorN throw ParseException("Invalid data type in header."); } // Remember to move the iterator past the colon. - return (++endOfHeader - buffer.begin()); + endOfHeader++; + // Breaking this into two parts to avoid an awkward gcc compiler problem. + auto dataStart = endOfHeader - buffer.begin(); + return static_cast<unsigned int>(dataStart); } /** @@ -118,21 +121,21 @@ void ReadData(const std::vector<char>& buffer, switch (tensorType) { case DataType::Float32: { - results.push_back(std::stof(elementString)); + results.push_back(static_cast<T>(std::stof(elementString))); break; } case DataType::Signed32: { - results.push_back(std::stoi(elementString)); + results.push_back(static_cast<T>(std::stoi(elementString))); break; } case DataType::QSymmS8: case DataType::QAsymmS8: { - results.push_back(elementString[0]); + results.push_back(static_cast<T>(elementString[0])); break; } case DataType::QAsymmU8: { - results.push_back(elementString[0]); + results.push_back(static_cast<T>(elementString[0])); break; } case DataType::Float16: @@ -182,7 +185,7 @@ Tensor ReadTensorFromFile(const std::string fileName) // We'll read the entire file into one buffer. std::ifstream file(fileName, std::ios::binary); std::vector<char> buffer(fileSize); - if (file.read(buffer.data(), fileSize)) + if (file.read(buffer.data(), static_cast<std::streamsize>(fileSize))) { std::string tensorName; DataType tensorType; |