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
diff --git a/tests/InferenceTestImage.cpp b/tests/InferenceTestImage.cpp
index f76c958..a1b6cf4 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 @@
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 @@
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());