From: Matthias Maier Date: Thu, 6 Jan 2022 12:36:58 +0000 (-0600) Subject: port multithread_info.cc to oneAPI X-Git-Tag: v9.4.0-rc1~659^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d7e6a4883c5cefacf5c2c69fd47e0bffc8113dc;p=dealii.git port multithread_info.cc to oneAPI --- diff --git a/source/base/multithread_info.cc b/source/base/multithread_info.cc index aeed71a479..f9d6c984d2 100644 --- a/source/base/multithread_info.cc +++ b/source/base/multithread_info.cc @@ -22,7 +22,7 @@ #ifdef DEAL_II_WITH_TBB # ifdef DEAL_II_TBB_WITH_ONEAPI -# include +# include # else # include # endif @@ -96,11 +96,16 @@ MultithreadInfo::set_thread_limit(const unsigned int max_threads) n_max_threads = n_cores(); #ifdef DEAL_II_WITH_TBB +# ifdef DEAL_II_TBB_WITH_ONEAPI + tbb::global_control(tbb::global_control::max_allowed_parallelism, + n_max_threads); +# else // Initialize the scheduler and destroy the old one before doing so static tbb::task_scheduler_init dummy(tbb::task_scheduler_init::deferred); if (dummy.is_active()) dummy.terminate(); dummy.initialize(n_max_threads); +# endif #endif #ifdef DEAL_II_WITH_TASKFLOW