Skip to content

Commit

Permalink
Follow-up to c772d28
Browse files Browse the repository at this point in the history
Support for oneTBB from oneAPI, where Intel reworked and deprecated
some interfaces.
Implements some of TBB universal fix (2020/2021 fixes) #7332
This one adds TBB_HAS_GLOBAL_CONTROL for the up to date oneTBB.
  • Loading branch information
bubnikv committed Dec 12, 2021
1 parent c772d28 commit 23e4ecd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@

#include <tbb/parallel_for.h>

// Intel redesigned some TBB interface considerably when merging TBB with their oneAPI set of libraries, see GH #7332.
// We are using quite an old TBB 2017 U7. Before we update our build servers, let's use the old API, which is deprecated in up to date TBB.
#if ! defined(TBB_VERSION_MAJOR)
#include <tbb/version.h>
#endif

#if ! defined(TBB_VERSION_MAJOR)
static_assert(false, "TBB_VERSION_MAJOR not defined");
#endif

// Intel redesigned some TBB interface considerably when merging TBB with their oneAPI set of libraries, see GH #7332.
#if TBB_VERSION_MAJOR >= 2021
#include <tbb/parallel_pipeline.h>
using slic3r_tbb_filtermode = tbb::filter_mode;
Expand Down
10 changes: 10 additions & 0 deletions src/libslic3r/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@

// We are using quite an old TBB 2017 U7, which does not support global control API officially.
// Before we update our build servers, let's use the old API, which is deprecated in up to date TBB.
#include <tbb/tbb.h>
#if ! defined(TBB_VERSION_MAJOR)
#include <tbb/version.h>
#endif
#if ! defined(TBB_VERSION_MAJOR)
static_assert(false, "TBB_VERSION_MAJOR not defined");
#endif
#if TBB_VERSION_MAJOR >= 2021
#define TBB_HAS_GLOBAL_CONTROL
#endif
#ifdef TBB_HAS_GLOBAL_CONTROL
#include <tbb/global_control.h>
#else
Expand Down

0 comments on commit 23e4ecd

Please sign in to comment.