-
Notifications
You must be signed in to change notification settings - Fork 88
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:2021 oneAPI compatibility #178
Conversation
Thanks for this! Lines 68 to 72 in a0f4630
So maybe we need to move the code around in the CMakeLists to first determine if it is c++17 or c++14 and set the value. |
Yea, I saw this, just tried the minimum required changes to allow tbb:2021 support, haven't thought about aberrations form cuda compiler. |
################################## | ||
find_package(TBB CONFIG) | ||
if(TBB_FOUND) | ||
return() |
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.
we need something like this before returning
set(TBB_LIBRARIES TBB::tbb)
Otherwise in CONFIG mode TBB_LIBRARIES
is empty and it won't link with tbb
@@ -102,7 +106,11 @@ static void constructFlowComponentFromSeed( | |||
} | |||
|
|||
{ | |||
#if TBB_VERSION_MAJOR > 2020 | |||
std::scoped_lock lock(G_SortMutex); |
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.
another alternative is to use boost::scoped_lock()
since Boost.Thread is already among the dependencies.
This would have the advantage of avoiding raising the standard to c++17.
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.
I think std::lock_guard
would work just fine in this particular case.
@simogasp Could we maybe just use |
yes that's what they just did on vcpkg a couple of days ago when they updated TBB version |
Thanks for initiating this PR! |
Description: TBB:2021 compatibility fix
Implementation remarks
tbb::mutex
withstd::mutex
tbb::mutex::scoped_lock
withstd::scoped_lock
cpp17
iftbb>2020
tbb:2021
inFindTBB.cmake
Fix #177