From: Matthias Maier Date: Thu, 6 Jan 2022 12:36:58 +0000 (-0600) Subject: port multithread_info.cc to oneAPI X-Git-Tag: v9.3.3~5^2~16 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a9bc9eac10a28431048c2c345f55a3746992cac;p=dealii.git port multithread_info.cc to oneAPI --- diff --git a/source/base/multithread_info.cc b/source/base/multithread_info.cc index 01d8275914..c78fbd7b8c 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 @@ -90,11 +90,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 }