aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2020-10-29 11:39:14 +0000
committerJim Flynn <jim.flynn@arm.com>2020-10-29 19:24:16 +0000
commit9a5ce4ab5ce777ef683035a4d0f4fcac67847c88 (patch)
tree5989f29900208e1cbc12d7592824776fd6dfa992 /tests
parent06e0300ccf279c6b0fcbb5ef3b6fa36e00229492 (diff)
downloadarmnn-9a5ce4ab5ce777ef683035a4d0f4fcac67847c88.tar.gz
IVGCVSW-5265 Remove boost from core ArmNN CMake
* Remove all but Boost_UNIT_TEST_FRAMEWORK_LIBRARY from ArmNN Cmake files. * Remove references to boost::fpc from old test applications. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: Ibb1261dee4b971d1788d2805528aa800a8b883ce
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt28
-rw-r--r--tests/DeepSpeechV1InferenceTest.hpp11
-rw-r--r--tests/MobileNetSsdInferenceTest.hpp19
-rw-r--r--tests/YoloInferenceTest.hpp15
4 files changed, 20 insertions, 53 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 7141edf47d..da757c2c82 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -30,10 +30,6 @@ if(BUILD_CAFFE_PARSER)
target_link_libraries(${testName} armnnCaffeParser)
target_link_libraries(${testName} armnn)
target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(${testName}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(${testName})
endmacro()
@@ -97,10 +93,6 @@ if(BUILD_TF_PARSER)
target_link_libraries(${testName} armnnTfParser)
target_link_libraries(${testName} armnn)
target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(${testName}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(${testName})
endmacro()
@@ -145,10 +137,6 @@ if (BUILD_TF_LITE_PARSER)
target_link_libraries(${testName} armnnTfLiteParser)
target_link_libraries(${testName} armnn)
target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(${testName}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(${testName})
endmacro()
@@ -233,10 +221,6 @@ if (BUILD_ONNX_PARSER)
target_link_libraries(${testName} armnnOnnxParser)
target_link_libraries(${testName} armnn)
target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(${testName}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(${testName})
endmacro()
@@ -288,10 +272,6 @@ if (BUILD_ARMNN_SERIALIZER OR BUILD_CAFFE_PARSER OR BUILD_TF_PARSER OR BUILD_TF_
target_link_libraries(ExecuteNetwork armnn)
target_link_libraries(ExecuteNetwork ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(ExecuteNetwork
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(ExecuteNetwork)
endif()
@@ -313,10 +293,6 @@ if(BUILD_ACCURACY_TOOL)
if (BUILD_ONNX_PARSER)
target_link_libraries(${executorName} armnnOnnxParser)
endif()
- target_link_libraries(${executorName}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(${executorName})
endmacro()
@@ -336,10 +312,6 @@ endif()
if(BUILD_ARMNN_QUANTIZER)
macro(ImageTensorExecutor executorName)
target_link_libraries(${executorName} ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(${executorName}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(${executorName})
endmacro()
diff --git a/tests/DeepSpeechV1InferenceTest.hpp b/tests/DeepSpeechV1InferenceTest.hpp
index ac799cb45a..9115a8f351 100644
--- a/tests/DeepSpeechV1InferenceTest.hpp
+++ b/tests/DeepSpeechV1InferenceTest.hpp
@@ -9,8 +9,7 @@
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
-
-#include <boost/test/tools/floating_point_comparison.hpp>
+#include <armnnUtils/FloatingPointComparison.hpp>
#include <vector>
@@ -30,7 +29,6 @@ public:
testCaseData.m_InputData.m_StateH,
testCaseData.m_InputData.m_StateC},
{ k_OutputSize1, k_OutputSize2, k_OutputSize3 })
- , m_FloatComparer(boost::math::fpc::percent_tolerance(1.0f))
, m_ExpectedOutputs({testCaseData.m_ExpectedOutputData.m_InputSeq, testCaseData.m_ExpectedOutputData.m_StateH,
testCaseData.m_ExpectedOutputData.m_StateC})
{}
@@ -50,7 +48,7 @@ public:
// Check each output to see whether it is the expected value
for (unsigned int j = 0u; j < output1.size(); j++)
{
- if(!m_FloatComparer(output1[j], m_ExpectedOutputs.m_InputSeq[j]))
+ if(!armnnUtils::within_percentage_tolerance(output1[j], m_ExpectedOutputs.m_InputSeq[j]))
{
ARMNN_LOG(error) << "InputSeq for Lstm " << this->GetTestCaseId() <<
" is incorrect at" << j;
@@ -60,7 +58,7 @@ public:
for (unsigned int j = 0u; j < output2.size(); j++)
{
- if(!m_FloatComparer(output2[j], m_ExpectedOutputs.m_StateH[j]))
+ if(!armnnUtils::within_percentage_tolerance(output2[j], m_ExpectedOutputs.m_StateH[j]))
{
ARMNN_LOG(error) << "StateH for Lstm " << this->GetTestCaseId() <<
" is incorrect";
@@ -70,7 +68,7 @@ public:
for (unsigned int j = 0u; j < output3.size(); j++)
{
- if(!m_FloatComparer(output3[j], m_ExpectedOutputs.m_StateC[j]))
+ if(!armnnUtils::within_percentage_tolerance(output3[j], m_ExpectedOutputs.m_StateC[j]))
{
ARMNN_LOG(error) << "StateC for Lstm " << this->GetTestCaseId() <<
" is incorrect";
@@ -86,7 +84,6 @@ private:
static constexpr unsigned int k_OutputSize2 = 2048u;
static constexpr unsigned int k_OutputSize3 = 2048u;
- boost::math::fpc::close_at_tolerance<float> m_FloatComparer;
LstmInput m_ExpectedOutputs;
};
diff --git a/tests/MobileNetSsdInferenceTest.hpp b/tests/MobileNetSsdInferenceTest.hpp
index 7377640629..acb7b374ef 100644
--- a/tests/MobileNetSsdInferenceTest.hpp
+++ b/tests/MobileNetSsdInferenceTest.hpp
@@ -10,8 +10,7 @@
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <armnn/utility/NumericCast.hpp>
-
-#include <boost/test/tools/floating_point_comparison.hpp>
+#include <armnnUtils/FloatingPointComparison.hpp>
#include <vector>
@@ -29,7 +28,6 @@ public:
testCaseId,
{ std::move(testCaseData.m_InputData) },
{ k_OutputSize1, k_OutputSize2, k_OutputSize3, k_OutputSize4 })
- , m_FloatComparer(boost::math::fpc::percent_tolerance(1.0f))
, m_DetectedObjects(testCaseData.m_ExpectedDetectedObject)
{}
@@ -107,7 +105,7 @@ public:
return TestCaseResult::Failed;
}
- if(!m_FloatComparer(detectedObject.m_Confidence, expectedObject.m_Confidence))
+ if(!armnnUtils::within_percentage_tolerance(detectedObject.m_Confidence, expectedObject.m_Confidence))
{
ARMNN_LOG(error) << "Confidence of prediction for test case " << this->GetTestCaseId() <<
" is incorrect: Expected (" << expectedObject.m_Confidence << ") +- 1.0 pc" <<
@@ -115,10 +113,14 @@ public:
return TestCaseResult::Failed;
}
- if (!m_FloatComparer(detectedObject.m_BoundingBox.m_XMin, expectedObject.m_BoundingBox.m_XMin) ||
- !m_FloatComparer(detectedObject.m_BoundingBox.m_YMin, expectedObject.m_BoundingBox.m_YMin) ||
- !m_FloatComparer(detectedObject.m_BoundingBox.m_XMax, expectedObject.m_BoundingBox.m_XMax) ||
- !m_FloatComparer(detectedObject.m_BoundingBox.m_YMax, expectedObject.m_BoundingBox.m_YMax))
+ if (!armnnUtils::within_percentage_tolerance(detectedObject.m_BoundingBox.m_XMin,
+ expectedObject.m_BoundingBox.m_XMin) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_BoundingBox.m_YMin,
+ expectedObject.m_BoundingBox.m_YMin) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_BoundingBox.m_XMax,
+ expectedObject.m_BoundingBox.m_XMax) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_BoundingBox.m_YMax,
+ expectedObject.m_BoundingBox.m_YMax))
{
ARMNN_LOG(error) << "Detected bounding box for test case " << this->GetTestCaseId() <<
" is incorrect";
@@ -139,7 +141,6 @@ private:
static constexpr unsigned int k_OutputSize3 = k_Shape;
static constexpr unsigned int k_OutputSize4 = 1u;
- boost::math::fpc::close_at_tolerance<float> m_FloatComparer;
std::vector<DetectedObject> m_DetectedObjects;
};
diff --git a/tests/YoloInferenceTest.hpp b/tests/YoloInferenceTest.hpp
index 4f391a84a5..cb1817a0bb 100644
--- a/tests/YoloInferenceTest.hpp
+++ b/tests/YoloInferenceTest.hpp
@@ -9,10 +9,9 @@
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
+#include <armnnUtils/FloatingPointComparison.hpp>
#include <boost/multi_array.hpp>
-#include <boost/test/tools/floating_point_comparison.hpp>
-
#include <algorithm>
#include <array>
#include <utility>
@@ -27,7 +26,6 @@ public:
unsigned int testCaseId,
YoloTestCaseData& testCaseData)
: InferenceModelTestCase<Model>(model, testCaseId, { std::move(testCaseData.m_InputImage) }, { YoloOutputSize })
- , m_FloatComparer(boost::math::fpc::percent_tolerance(1.0f))
, m_TopObjectDetections(std::move(testCaseData.m_TopObjectDetections))
{
}
@@ -155,11 +153,11 @@ public:
return TestCaseResult::Failed;
}
- if (!m_FloatComparer(detectedObject.m_Box.m_X, expectedDetection.m_Box.m_X) ||
- !m_FloatComparer(detectedObject.m_Box.m_Y, expectedDetection.m_Box.m_Y) ||
- !m_FloatComparer(detectedObject.m_Box.m_W, expectedDetection.m_Box.m_W) ||
- !m_FloatComparer(detectedObject.m_Box.m_H, expectedDetection.m_Box.m_H) ||
- !m_FloatComparer(detectedObject.m_Confidence, expectedDetection.m_Confidence))
+ if (!armnnUtils::within_percentage_tolerance(detectedObject.m_Box.m_X, expectedDetection.m_Box.m_X) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_Box.m_Y, expectedDetection.m_Box.m_Y) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_Box.m_W, expectedDetection.m_Box.m_W) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_Box.m_H, expectedDetection.m_Box.m_H) ||
+ !armnnUtils::within_percentage_tolerance(detectedObject.m_Confidence, expectedDetection.m_Confidence))
{
ARMNN_LOG(error) << "Detected bounding box for test case " << this->GetTestCaseId() <<
" is incorrect";
@@ -173,7 +171,6 @@ public:
}
private:
- boost::math::fpc::close_at_tolerance<float> m_FloatComparer;
std::vector<YoloDetectedObject> m_TopObjectDetections;
};