aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--CMakeLists.txt31
-rw-r--r--cmake/AddDllCopyCommands.cmake3
-rw-r--r--cmake/ArmnnConfig.cmake.in5
-rw-r--r--cmake/GlobalConfig.cmake2
-rwxr-xr-xsrc/armnnTfLiteParser/CMakeLists.txt2
-rw-r--r--src/dynamic/sample/CMakeLists.txt5
-rw-r--r--tests/CMakeLists.txt28
-rw-r--r--tests/DeepSpeechV1InferenceTest.hpp11
-rw-r--r--tests/MobileNetSsdInferenceTest.hpp19
-rw-r--r--tests/YoloInferenceTest.hpp15
10 files changed, 24 insertions, 97 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13a8a962fc..abe9bf1e12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,8 +103,6 @@ if(BUILD_CAFFE_PARSER)
target_include_directories(armnnCaffeParser PRIVATE src/armnnUtils)
- target_link_libraries(armnnCaffeParser ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY})
-
target_link_libraries(armnnCaffeParser armnn)
target_link_libraries(armnnCaffeParser ${PROTOBUF_LIBRARIES})
set_target_properties(armnnCaffeParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
@@ -183,12 +181,7 @@ if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
include_directories(SYSTEM "${FLATBUFFERS_INCLUDE_PATH}")
set_target_properties(armnnQuantizer PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
- target_link_libraries(armnnQuantizer
- armnn
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_THREAD_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
+ target_link_libraries(armnnQuantizer armnn)
add_executable_ex(ArmnnQuantizer
src/armnnQuantizer/ArmNNQuantizerMain.cpp)
@@ -197,11 +190,6 @@ if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
target_include_directories(ArmnnQuantizer PRIVATE src/armnn)
target_link_libraries(ArmnnQuantizer
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_THREAD_LIBRARY} )
-
- target_link_libraries(ArmnnQuantizer
armnnQuantizer
armnnSerializer
armnn
@@ -622,12 +610,6 @@ endif()
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-target_link_libraries(armnn
- ${Boost_THREAD_LIBRARY}
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY}
- )
-
if(ARMCOMPUTENEON OR ARMCOMPUTECL)
target_link_libraries(armnn ${ARMCOMPUTE_LIBRARIES})
endif()
@@ -970,7 +952,7 @@ if(BUILD_UNIT_TESTS)
endif()
target_link_libraries(UnitTests ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(UnitTests ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
+ target_link_libraries(UnitTests ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(UnitTests armnn)
target_link_libraries(UnitTests armnnUtils)
@@ -1049,10 +1031,6 @@ if (BUILD_ARMNN_SERIALIZER AND (BUILD_TF_PARSER OR BUILD_TF_LITE_PARSER OR BUILD
target_link_libraries(ArmnnConverter armnn)
target_link_libraries(ArmnnConverter ${CMAKE_THREAD_LIBS_INIT})
- target_link_libraries(ArmnnConverter
- ${Boost_SYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY})
addDllCopyCommands(ArmnnConverter)
endif()
@@ -1117,10 +1095,7 @@ if(BUILD_GATORD_MOCK)
armnn
armnnBasePipeServer
timelineDecoder
- gatordMockService
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
- ${Boost_FILESYSTEM_LIBRARY}
- ${Boost_SYSTEM_LIBRARY})
+ gatordMockService)
if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
target_link_libraries(GatordMock ${CMAKE_THREAD_LIBS_INIT})
diff --git a/cmake/AddDllCopyCommands.cmake b/cmake/AddDllCopyCommands.cmake
index 74f6f6fff1..ff57bb173d 100644
--- a/cmake/AddDllCopyCommands.cmake
+++ b/cmake/AddDllCopyCommands.cmake
@@ -72,9 +72,6 @@ macro(addDllCopyCommands target)
addDllCopyCommand(${target} "${MINGW32_ROOT}/bin/libgfortran-3.dll" "${MINGW32_ROOT}/bin/libgfortran-3.dll")
addDllCopyCommand(${target} "${MINGW32_ROOT}/bin/libgcc_s_dw2-1.dll" "${MINGW32_ROOT}/bin/libgcc_s_dw2-1.dll")
addDllCopyCommand(${target} "${MINGW32_ROOT}/bin/libquadmath-0.dll" "${MINGW32_ROOT}/bin/libquadmath-0.dll")
- addBoostDllCopyCommand(${target} ${Boost_SYSTEM_LIBRARY})
- addBoostDllCopyCommand(${target} ${Boost_THREAD_LIBRARY})
- addBoostDllCopyCommand(${target} ${Boost_CHRONO_LIBRARY})
endif()
endif()
endmacro()
diff --git a/cmake/ArmnnConfig.cmake.in b/cmake/ArmnnConfig.cmake.in
index 1e572fea1d..e608f86b6a 100644
--- a/cmake/ArmnnConfig.cmake.in
+++ b/cmake/ArmnnConfig.cmake.in
@@ -7,11 +7,6 @@ include(CMakeFindDependencyMacro)
list(APPEND CMAKE_MODULE_PATH ${ARMNN_CMAKE_DIR})
-add_definitions("-DBOOST_ALL_NO_LIB")
-find_package(Boost 1.59 REQUIRED COMPONENTS system filesystem program_options)
-include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
-link_directories(${Boost_LIBRARY_DIRS})
-
if(NOT TARGET Armnn::Armnn)
MESSAGE(STATUS "Armnn Import: ${ARMNN_CMAKE_DIR}/ArmnnTargets.cmake")
include("${ARMNN_CMAKE_DIR}/ArmnnTargets.cmake")
diff --git a/cmake/GlobalConfig.cmake b/cmake/GlobalConfig.cmake
index 1db0025daa..3fb12df19d 100644
--- a/cmake/GlobalConfig.cmake
+++ b/cmake/GlobalConfig.cmake
@@ -135,7 +135,7 @@ if (NOT BUILD_PIPE_ONLY)
set(Boost_USE_STATIC_LIBS ON)
endif()
add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
- find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework filesystem system program_options)
+ find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework)
include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
link_directories(${Boost_LIBRARY_DIRS})
endif()
diff --git a/src/armnnTfLiteParser/CMakeLists.txt b/src/armnnTfLiteParser/CMakeLists.txt
index d14cb75c49..12f2127375 100755
--- a/src/armnnTfLiteParser/CMakeLists.txt
+++ b/src/armnnTfLiteParser/CMakeLists.txt
@@ -18,8 +18,6 @@ if(BUILD_TF_LITE_PARSER)
target_include_directories(armnnTfLiteParser PRIVATE ../armnnUtils)
target_include_directories(armnnTfLiteParser SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
- target_link_libraries(armnnTfLiteParser ${Boost_THREAD_LIBRARY})
-
# If user has explicitly specified flatbuffers lib then use that,
# otherwise search for it based on FLATBUFFERS_BUILD_DIR
if (FLATBUFFERS_LIBRARY)
diff --git a/src/dynamic/sample/CMakeLists.txt b/src/dynamic/sample/CMakeLists.txt
index 0a32bf9b63..07a2d4f98f 100644
--- a/src/dynamic/sample/CMakeLists.txt
+++ b/src/dynamic/sample/CMakeLists.txt
@@ -9,9 +9,6 @@ project(sample-dynamic)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
-find_package(Boost REQUIRED COMPONENTS system filesystem)
-include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
-link_directories(${Boost_LIBRARY_DIRS})
list(APPEND armnnSampleDynamicBackend_sources
SampleDynamicAdditionWorkload.cpp
@@ -40,6 +37,4 @@ target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DI
target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DIR}/../../../src/profiling)
target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DIR}/../../../profiling/common/include)
target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DIR}/../../../profiling)
-target_include_directories(Arm_SampleDynamic_backend PRIVATE ${Boost_INCLUDE_DIRS})
-target_link_libraries(Arm_SampleDynamic_backend ${Boost_SYSTEM_LIBRARY})
target_link_libraries(Arm_SampleDynamic_backend ${ARMNN_PATH})
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;
};