From 24ac85943b609e48fc36d16570ca4b5b90d31a6a Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Wed, 23 Sep 2020 16:57:23 +0100 Subject: IVGCVSW-5334 Remove remaining boost::numeric_cast from armnn * Floating point casts now use armnn::numeric_cast. * Also removed remaining header imports. Signed-off-by: Matthew Sloyan Change-Id: I2d37847d67f164fc0a0ae17f34d49ff3d2210c30 --- tests/InferenceTest.cpp | 1 - tests/InferenceTest.inl | 5 ++--- tests/InferenceTestImage.cpp | 13 ++++++------- tests/MobileNetSsdInferenceTest.hpp | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/InferenceTest.cpp b/tests/InferenceTest.cpp index b0d0b47443..64205449ef 100644 --- a/tests/InferenceTest.cpp +++ b/tests/InferenceTest.cpp @@ -8,7 +8,6 @@ #include #include "../src/armnn/Profiling.hpp" -#include #include #include diff --git a/tests/InferenceTest.inl b/tests/InferenceTest.inl index e10bb38cb0..e8401f6bc3 100644 --- a/tests/InferenceTest.inl +++ b/tests/InferenceTest.inl @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -247,8 +246,8 @@ ClassifierTestCaseProvider::GetTestCase(unsigned int template bool ClassifierTestCaseProvider::OnInferenceTestFinished() { - const double accuracy = boost::numeric_cast(m_NumCorrectInferences) / - boost::numeric_cast(m_NumInferences); + const double accuracy = armnn::numeric_cast(m_NumCorrectInferences) / + armnn::numeric_cast(m_NumInferences); ARMNN_LOG(info) << std::fixed << std::setprecision(3) << "Overall accuracy: " << accuracy; // If a validation file was requested as output, the predictions are saved to it. diff --git a/tests/InferenceTestImage.cpp b/tests/InferenceTestImage.cpp index a1b6cf4bdb..bb1f5c2397 100644 --- a/tests/InferenceTestImage.cpp +++ b/tests/InferenceTestImage.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -72,8 +71,8 @@ std::vector ResizeBilinearAndNormalize(const InferenceTestImage & image, // How much to scale pixel coordinates in the output image to get the corresponding pixel coordinates // in the input image. - const float scaleY = boost::numeric_cast(inputHeight) / boost::numeric_cast(outputHeight); - const float scaleX = boost::numeric_cast(inputWidth) / boost::numeric_cast(outputWidth); + const float scaleY = armnn::numeric_cast(inputHeight) / armnn::numeric_cast(outputHeight); + const float scaleX = armnn::numeric_cast(inputWidth) / armnn::numeric_cast(outputWidth); uint8_t rgb_x0y0[3]; uint8_t rgb_x1y0[3]; @@ -83,11 +82,11 @@ std::vector ResizeBilinearAndNormalize(const InferenceTestImage & image, for (unsigned int y = 0; y < outputHeight; ++y) { // Corresponding real-valued height coordinate in input image. - const float iy = boost::numeric_cast(y) * scaleY; + const float iy = armnn::numeric_cast(y) * scaleY; // Discrete height coordinate of top-left texel (in the 2x2 texel area used for interpolation). const float fiy = floorf(iy); - const unsigned int y0 = boost::numeric_cast(fiy); + const unsigned int y0 = armnn::numeric_cast(fiy); // Interpolation weight (range [0,1]) const float yw = iy - fiy; @@ -95,9 +94,9 @@ std::vector ResizeBilinearAndNormalize(const InferenceTestImage & image, for (unsigned int x = 0; x < outputWidth; ++x) { // Real-valued and discrete width coordinates in input image. - const float ix = boost::numeric_cast(x) * scaleX; + const float ix = armnn::numeric_cast(x) * scaleX; const float fix = floorf(ix); - const unsigned int x0 = boost::numeric_cast(fix); + const unsigned int x0 = armnn::numeric_cast(fix); // Interpolation weight (range [0,1]). const float xw = ix - fix; diff --git a/tests/MobileNetSsdInferenceTest.hpp b/tests/MobileNetSsdInferenceTest.hpp index f426ed2ae4..2a5d47d634 100644 --- a/tests/MobileNetSsdInferenceTest.hpp +++ b/tests/MobileNetSsdInferenceTest.hpp @@ -9,8 +9,8 @@ #include #include +#include -#include #include #include @@ -53,7 +53,7 @@ public: const std::vector& output4 = mapbox::util::get>(this->GetOutputs()[3]); ARMNN_ASSERT(output4.size() == k_OutputSize4); - const size_t numDetections = boost::numeric_cast(output4[0]); + const size_t numDetections = armnn::numeric_cast(output4[0]); // Check if number of valid detections matches expectations const size_t expectedNumDetections = m_DetectedObjects.size(); -- cgit v1.2.1