diff --git a/Tests/TestHelpers.h b/Tests/TestHelpers.h index 03322aaf59..6bc687fdb8 100644 --- a/Tests/TestHelpers.h +++ b/Tests/TestHelpers.h @@ -21,6 +21,7 @@ #include "QueryEngine/TargetValue.h" #include +#include #include #include #include @@ -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(handle); bool const finalized = tbb::finalize(handle, std::nothrow_t{}); std::cout << __FILE__ << " +" << __LINE__ << ' ' << __func__ @@ -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(handle); bool const finalized = tbb::finalize(handle, std::nothrow_t{});