-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tbb, pagmo2] Update TBB to 2021.5 and update pagmo2 to 2.18.0 #26284
Changes from 75 commits
233e072
fa338f7
ad58b50
2ca52a8
1b8b26a
4c70733
ac412fa
5a988a4
db3b323
d7d9e88
06e183e
7e3ead2
b1143f6
22bbd2a
c97c3bf
bcb1dd3
b5d6382
a0f290a
7312990
5956dce
5e57eb1
de6dadd
c0a5a39
e24db6f
5b512bb
aed9a79
8a181c2
3d6ee39
3eb53d6
5c1046e
1d0290b
282e513
01c734a
76fa379
d17623c
a6edea0
805e54a
6a9ecaa
dfb9d65
4932c3d
ad4216b
c35d463
c4269ff
23c7880
cbf17c1
3e4ca69
bbbee35
ce998f8
addf160
b369e73
5ba8a05
f76eb8e
b597b72
4d6fea3
6dda0d4
aaa9dc0
a06c4a2
e6cf91e
26d4682
6e1bb7a
baa5ce4
fe6c57b
fff15f3
b658429
34847cc
d5ac766
64a44bf
37cb40e
1e919a9
29f1044
a72770a
871162c
1445ded
ebb1ddd
cec55d4
1f73368
d82fc62
39467db
817cbd0
006c899
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,218 @@ | ||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||||||
index 95821ac..a5f30e1 100644 | ||||||
--- a/CMakeLists.txt | ||||||
+++ b/CMakeLists.txt | ||||||
@@ -238,8 +238,7 @@ endif() | ||||||
|
||||||
# FIND Intel TBB | ||||||
# With MVSC, CMAKE_BUILD_TYPE will always be None, so TBB_USE_DEBUG_BUILD will always be false. | ||||||
-string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" Debug TBB_USE_DEBUG_BUILD) | ||||||
-find_package(TBB REQUIRED) | ||||||
+find_package(TBB CONFIG REQUIRED) | ||||||
|
||||||
add_subdirectory(src) | ||||||
|
||||||
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in | ||||||
index c5a82c0..3ce4719 100644 | ||||||
--- a/cmake/Config.cmake.in | ||||||
+++ b/cmake/Config.cmake.in | ||||||
@@ -42,6 +42,7 @@ | ||||||
include(CMakeFindDependencyMacro) | ||||||
|
||||||
set(OpenCV_DIR @OpenCV_DIR@) | ||||||
+find_dependency(TBB) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should match the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were already deleting |
||||||
find_dependency(OpenCV) | ||||||
find_dependency(Eigen3 @CCTAG_EIGEN_REQUIRED_VERSION@) | ||||||
find_dependency(Boost 1.66 REQUIRED COMPONENTS @BOOST_REQUIRED_COMPONENTS@) | ||||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||||||
index 7b64b83..e72647a 100644 | ||||||
--- a/src/CMakeLists.txt | ||||||
+++ b/src/CMakeLists.txt | ||||||
@@ -166,7 +166,6 @@ if(CCTAG_WITH_CUDA) | ||||||
# INCLUDE_DIRECTORIES -- "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>" | ||||||
include_directories(${CMAKE_CURRENT_LIST_DIR} | ||||||
${OpenCV_INCLUDE_DIRS} ${Eigen_INCLUDE_DIR} | ||||||
- ${TBB_INCLUDE_DIRS} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hunk isn't needed -- TBB_INCLUDE_DIRS will evaluate to empty |
||||||
"${CMAKE_SOURCE_DIR}/src") | ||||||
|
||||||
CUDA_ADD_LIBRARY(CCTag ${CUDA_cpp} ${CUDA_cu} ${CCTag_cpp}) | ||||||
@@ -176,15 +175,15 @@ if(CCTAG_WITH_CUDA) | ||||||
${OpenCV_LIBS} | ||||||
Boost::date_time Boost::chrono Boost::thread Boost::serialization Boost::system Boost::filesystem Boost::atomic Boost::program_options Boost::timer Boost::math_c99 | ||||||
Eigen3::Eigen | ||||||
- ${TBB_LIBRARIES} ${CUDA_CUDADEVRT_LIBRARY}) | ||||||
+ TBB::tbb | ||||||
+ ${CUDA_CUDADEVRT_LIBRARY}) | ||||||
|
||||||
if(NOT MSVC) | ||||||
target_link_libraries(CCTag pthread dl) | ||||||
endif() | ||||||
|
||||||
target_compile_definitions(CCTag | ||||||
- PUBLIC -DCCTAG_WITH_CUDA | ||||||
- PRIVATE ${TBB_DEFINITIONS}) | ||||||
+ PUBLIC -DCCTAG_WITH_CUDA) | ||||||
|
||||||
if(CCTAG_HAVE_SHFL_DOWN_SYNC) | ||||||
target_compile_definitions(CCTag PRIVATE "-DCCTAG_HAVE_SHFL_DOWN_SYNC") | ||||||
@@ -213,23 +212,20 @@ else() # without CUDA | ||||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>" | ||||||
"$<BUILD_INTERFACE:${generated_dir}>" | ||||||
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>" | ||||||
- PUBLIC ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} | ||||||
- PRIVATE ${TBB_INCLUDE_DIRS}) | ||||||
+ PUBLIC ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}) | ||||||
|
||||||
# just for testing | ||||||
# get_target_property(testprop CCTag INTERFACE_INCLUDE_DIRECTORIES ) | ||||||
# message(STATUS "testprop: ${testprop}") | ||||||
|
||||||
- target_compile_definitions(CCTag | ||||||
- PRIVATE ${TBB_DEFINITIONS}) | ||||||
|
||||||
target_link_libraries(CCTag | ||||||
PUBLIC | ||||||
${OpenCV_LIBS} | ||||||
Eigen3::Eigen | ||||||
Boost::atomic Boost::chrono Boost::date_time Boost::filesystem Boost::serialization Boost::system Boost::thread Boost::timer Boost::math_c99 | ||||||
- PRIVATE | ||||||
- ${TBB_LIBRARIES}) | ||||||
+ TBB::tbb | ||||||
+ ) | ||||||
|
||||||
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | ||||||
target_link_libraries(CCTag PRIVATE pthread dl) | ||||||
diff --git a/src/applications/CMakeLists.txt b/src/applications/CMakeLists.txt | ||||||
index 506d19b..aba3e1d 100644 | ||||||
--- a/src/applications/CMakeLists.txt | ||||||
+++ b/src/applications/CMakeLists.txt | ||||||
@@ -59,8 +59,7 @@ find_package(OpenCV REQUIRED core videoio imgproc imgcodecs highgui) | ||||||
|
||||||
# TBB | ||||||
if(NOT TBB_FOUND) | ||||||
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just delete |
||||||
- find_package(TBB REQUIRED) | ||||||
+ find_package(TBB CONFIG REQUIRED) | ||||||
else() | ||||||
message(STATUS "TBB already there") | ||||||
endif() | ||||||
@@ -82,11 +81,10 @@ find_package(DevIL COMPONENTS IL ILU) # yields IL_FOUND, IL_LIBRARIES, IL_INCLUD | ||||||
|
||||||
target_include_directories(detection PUBLIC | ||||||
${OpenCV_INCLUDE_DIRS} | ||||||
- ${TBB_INCLUDE_DIRS} | ||||||
) | ||||||
target_link_libraries(detection PUBLIC | ||||||
CCTag::CCTag | ||||||
- ${TBB_LIBRARIES} | ||||||
+ TBB::tbb | ||||||
${OpenCV_LIBS} | ||||||
Boost::filesystem Boost::program_options Boost::timer | ||||||
) | ||||||
diff --git a/src/cctag/Detection.cpp b/src/cctag/Detection.cpp | ||||||
index 21c47bf..a800fbc 100644 | ||||||
--- a/src/cctag/Detection.cpp | ||||||
+++ b/src/cctag/Detection.cpp | ||||||
@@ -44,6 +44,7 @@ | ||||||
#include <list> | ||||||
#include <utility> | ||||||
#include <memory> | ||||||
+#include <mutex> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we pull https://github.com/alicevision/CCTag/commit/1840f4224ef6f2ba78aaa2cd0b311d0a5bbd6710.diff instead of including it inline here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think we should be doing things like that only when the patch wouldn't be de-minimis. |
||||||
#ifdef CCTAG_WITH_CUDA | ||||||
#include <cctag/cuda/cctag_cuda_runtime.h> // only for debugging | ||||||
#endif // CCTAG_WITH_CUDA | ||||||
@@ -71,7 +72,7 @@ static void constructFlowComponentFromSeed( | ||||||
std::vector<CandidatePtr> & vCandidateLoopOne, | ||||||
const Parameters & params) | ||||||
{ | ||||||
- static tbb::mutex G_SortMutex; | ||||||
+ static std::mutex G_SortMutex; | ||||||
|
||||||
assert( seed ); | ||||||
// Check if the seed has already been processed, i.e. belongs to an already | ||||||
@@ -102,7 +103,7 @@ static void constructFlowComponentFromSeed( | ||||||
} | ||||||
|
||||||
{ | ||||||
- tbb::mutex::scoped_lock lock(G_SortMutex); | ||||||
+ std::lock_guard<std::mutex> lock(G_SortMutex); | ||||||
candidate->_averageReceivedVote = (float) (nReceivedVote*nReceivedVote) / (float) nVotedPoints; | ||||||
auto it = std::lower_bound(vCandidateLoopOne.begin(), vCandidateLoopOne.end(), candidate, | ||||||
[](const CandidatePtr& c1, const CandidatePtr& c2) { return c1->_averageReceivedVote > c2->_averageReceivedVote; }); | ||||||
@@ -119,8 +120,8 @@ static void completeFlowComponent( | ||||||
std::size_t runId, | ||||||
const Parameters & params) | ||||||
{ | ||||||
- static tbb::spin_mutex G_UpdateMutex; | ||||||
- static tbb::mutex G_InsertMutex; | ||||||
+ static std::mutex G_UpdateMutex; | ||||||
+ static std::mutex G_InsertMutex; | ||||||
|
||||||
try | ||||||
{ | ||||||
@@ -171,7 +172,7 @@ static void completeFlowComponent( | ||||||
if (nSegmentCommon == -1) | ||||||
{ | ||||||
{ | ||||||
- tbb::spin_mutex::scoped_lock lock(G_UpdateMutex); | ||||||
+ std::lock_guard<std::mutex> lock(G_UpdateMutex); | ||||||
nLabel = nSegmentOut; | ||||||
++nSegmentOut; | ||||||
} | ||||||
@@ -239,7 +240,7 @@ static void completeFlowComponent( | ||||||
} | ||||||
|
||||||
{ | ||||||
- tbb::mutex::scoped_lock lock(G_InsertMutex); | ||||||
+ std::lock_guard<std::mutex> lock(G_InsertMutex); | ||||||
vCandidateLoopTwo.push_back(candidate); | ||||||
} | ||||||
|
||||||
@@ -384,7 +385,7 @@ static void cctagDetectionFromEdgesLoopTwoIteration( | ||||||
float scale, | ||||||
const Parameters& params) | ||||||
{ | ||||||
- static tbb::mutex G_InsertMutex; | ||||||
+ static std::mutex G_InsertMutex; | ||||||
|
||||||
const Candidate& candidate = vCandidateLoopTwo[iCandidate]; | ||||||
|
||||||
@@ -543,7 +544,7 @@ static void cctagDetectionFromEdgesLoopTwoIteration( | ||||||
#endif | ||||||
|
||||||
{ | ||||||
- tbb::mutex::scoped_lock lock(G_InsertMutex); | ||||||
+ std::lock_guard<std::mutex> lock(G_InsertMutex); | ||||||
markers.push_back( tag ); // markers takes responsibility for delete | ||||||
} | ||||||
#ifdef CCTAG_SERIALIZE | ||||||
diff --git a/src/cctag/Identification.cpp b/src/cctag/Identification.cpp | ||||||
index 15c9d9b..99b616a 100644 | ||||||
--- a/src/cctag/Identification.cpp | ||||||
+++ b/src/cctag/Identification.cpp | ||||||
@@ -29,6 +29,7 @@ | ||||||
|
||||||
#include <cmath> | ||||||
#include <vector> | ||||||
+#include <mutex> | ||||||
|
||||||
#include <tbb/tbb.h> | ||||||
|
||||||
@@ -71,7 +72,7 @@ bool orazioDistanceRobust( | ||||||
#endif // GRIFF_DEBUG | ||||||
|
||||||
const size_t cut_count = cuts.size(); | ||||||
- static tbb::mutex vscore_mutex; | ||||||
+ static std::mutex vscore_mutex; | ||||||
|
||||||
tbb::parallel_for(size_t(0), cut_count, [&](size_t i) { | ||||||
const cctag::ImageCut& cut = cuts[i]; | ||||||
@@ -183,7 +184,7 @@ bool orazioDistanceRobust( | ||||||
#endif // GRIFF_DEBUG | ||||||
|
||||||
{ | ||||||
- tbb::mutex::scoped_lock lock(vscore_mutex); | ||||||
+ std::lock_guard<std::mutex> lock(vscore_mutex); | ||||||
vScore[idSet.front().first].push_back(idSet.front().second); | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "cctag", | ||
"version-semver": "1.0.2", | ||
"port-version": 1, | ||
"port-version": 2, | ||
"maintainers": "[email protected]", | ||
"description": "Computer vision library for detecting CCTag markers made up of concentric circles", | ||
"homepage": "https://github.com/alicevision/CCTag", | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting
FindTBB.cmake
removes the need for this hunk.