aboutsummaryrefslogtreecommitdiff
path: root/tests/InferenceTestImage.cpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2020-09-08 12:00:32 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2020-09-11 18:24:18 +0100
commit80c6b146046252af153af27025a28fb59d33c5e6 (patch)
tree82cc16369d0a163fc4f97a25af13c4d792faecf8 /tests/InferenceTestImage.cpp
parent77062ca6f288830a21e4ff4237059623eba25fa2 (diff)
downloadarmnn-80c6b146046252af153af27025a28fb59d33c5e6.tar.gz
IVGCVSW-5299 Remove some boost::numeric_cast from armnn/tests
* Replaced with armnn/utility/NumericCast.hpp * Removed combinations without float implementation in NumericCast.hpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Ia4ec605f063cdb0071fff302ef48c610f9f9505e
Diffstat (limited to 'tests/InferenceTestImage.cpp')
-rw-r--r--tests/InferenceTestImage.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/InferenceTestImage.cpp b/tests/InferenceTestImage.cpp
index f76c958f4e..a1b6cf4bdb 100644
--- a/tests/InferenceTestImage.cpp
+++ b/tests/InferenceTestImage.cpp
@@ -6,6 +6,7 @@
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
+#include <armnn/utility/NumericCast.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <fmt/format.h>
@@ -146,9 +147,9 @@ InferenceTestImage::InferenceTestImage(char const* filePath)
throw InferenceTestImageLoadFailed(fmt::format("Could not load empty image at {}", filePath));
}
- m_Width = boost::numeric_cast<unsigned int>(width);
- m_Height = boost::numeric_cast<unsigned int>(height);
- m_NumChannels = boost::numeric_cast<unsigned int>(channels);
+ m_Width = armnn::numeric_cast<unsigned int>(width);
+ m_Height = armnn::numeric_cast<unsigned int>(height);
+ m_NumChannels = armnn::numeric_cast<unsigned int>(channels);
const unsigned int sizeInBytes = GetSizeInBytes();
m_Data.resize(sizeInBytes);
@@ -185,11 +186,11 @@ void InferenceTestImage::StbResize(InferenceTestImage& im, const unsigned int ne
std::vector<uint8_t> newData;
newData.resize(newWidth * newHeight * im.GetNumChannels() * im.GetSingleElementSizeInBytes());
- // boost::numeric_cast<>() is used for user-provided data (protecting about overflows).
+ // armnn::numeric_cast<>() is used for user-provided data (protecting about overflows).
// static_cast<> is ok for internal data (assumes that, when internal data was originally provided by a user,
- // a boost::numeric_cast<>() handled the conversion).
- const int nW = boost::numeric_cast<int>(newWidth);
- const int nH = boost::numeric_cast<int>(newHeight);
+ // a armnn::numeric_cast<>() handled the conversion).
+ const int nW = armnn::numeric_cast<int>(newWidth);
+ const int nH = armnn::numeric_cast<int>(newHeight);
const int w = static_cast<int>(im.GetWidth());
const int h = static_cast<int>(im.GetHeight());