Skip to content

Commit

Permalink
Bridge to TBB version 2021.8 (#7243)
Browse files Browse the repository at this point in the history
* Fix TBB compatibility with ENABLE_TSAN

* Bridge to TBB version 2021.8 fixing TestHelper.h

Signed-off-by: Misiu Godfrey <[email protected]>
  • Loading branch information
steveblackmon-mapd authored and Misiu Godfrey committed Aug 15, 2023
1 parent 9012f57 commit 440b4f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/TestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "QueryEngine/TargetValue.h"

#include <gtest/gtest.h>
#include <tbb/version.h>
#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
#include <boost/variant.hpp>
Expand All @@ -41,7 +42,11 @@ class TbbPrivateServerKiller : public ::testing::Test {
protected:
#if PRINT_TBB_TASK_SCHEDULER_HANDLE_DIAGNOSTICS
void SetUp() override {
#if TBB_VERSION_MAJOR == 2021 && TBB_VERSION_MINOR < 6
auto handle = tbb::task_scheduler_handle::get();
#else
auto handle = oneapi::tbb::task_scheduler_handle{oneapi::tbb::attach {}};
#endif
bool const handle_as_bool = static_cast<bool>(handle);
bool const finalized = tbb::finalize(handle, std::nothrow_t{});
std::cout << __FILE__ << " +" << __LINE__ << ' ' << __func__
Expand All @@ -52,7 +57,11 @@ class TbbPrivateServerKiller : public ::testing::Test {
void TearDown() override {
// Expected to kill tbb::detail::r1::rml::private_server after each test,
// which can otherwise trigger false positive tsan data race warnings.
#if TBB_VERSION_MAJOR == 2021 && TBB_VERSION_MINOR < 6
auto handle = tbb::task_scheduler_handle::get();
#else
auto handle = oneapi::tbb::task_scheduler_handle{oneapi::tbb::attach{}};
#endif
#if PRINT_TBB_TASK_SCHEDULER_HANDLE_DIAGNOSTICS
bool const handle_as_bool = static_cast<bool>(handle);
bool const finalized = tbb::finalize(handle, std::nothrow_t{});
Expand Down

0 comments on commit 440b4f1

Please sign in to comment.