diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index 7b98725aa3..545e1207ac 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -157,7 +157,7 @@ namespace ARDOUR { ExportGraphBuilder::ExportGraphBuilder (Session const & session) : session (session) - , thread_pool (hardware_concurrency()) + , thread_pool (PBD::hardware_concurrency()) { process_buffer_samples = session.engine().samples_per_cycle(); } diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 3f5cff7ccb..8ffb70fae6 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -749,7 +749,7 @@ ARDOUR::init (bool try_optimization, const char* localedir, bool with_gui) * WaveViewThreads::start_threads adds `min (8, hw - 1)` * */ - BufferManager::init (hardware_concurrency () * 3 + 6); + BufferManager::init (PBD::hardware_concurrency () * 3 + 6); PannerManager::instance ().discover_panners (); diff --git a/libs/ardour/io_tasklist.cc b/libs/ardour/io_tasklist.cc index d1756fe1fd..7724a67947 100644 --- a/libs/ardour/io_tasklist.cc +++ b/libs/ardour/io_tasklist.cc @@ -45,7 +45,7 @@ IOTaskList::IOTaskList (uint32_t n_threads) , _exec_sem ("io thread exec", 0) , _idle_sem ("io thread idle", 0) { - assert (n_threads <= hardware_concurrency ()); + assert (n_threads <= PBD::hardware_concurrency ()); if (n_threads < 2) { return; diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 683ddeee97..a0746b970b 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -610,8 +610,8 @@ LuaBindings::common (lua_State* L) .addConst ("UseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::UseGroup)) .endNamespace () - .addFunction ("hardware_concurrency", hardware_concurrency) - .addFunction ("max_mmcss_threads_per_process", max_mmcss_threads_per_process) + .addFunction ("hardware_concurrency", PBD::hardware_concurrency) + .addFunction ("max_mmcss_threads_per_process", PBD::max_mmcss_threads_per_process) .endNamespace (); // PBD diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index cacb5f79db..345c288c0e 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -718,7 +718,7 @@ ARDOUR::how_many_dsp_threads () { /* CALLER MUST HOLD PROCESS LOCK */ - int num_cpu = hardware_concurrency(); + int num_cpu = PBD::hardware_concurrency(); int pu = Config->get_processor_usage (); uint32_t num_threads = max (num_cpu - 1, 2); // default to number of cpus minus one, or 2, whichever is larger @@ -750,7 +750,7 @@ ARDOUR::how_many_dsp_threads () uint32_t ARDOUR::how_many_io_threads () { - int num_cpu = hardware_concurrency(); + int num_cpu = PBD::hardware_concurrency(); int pu = Config->get_io_thread_count (); uint32_t num_threads = max (num_cpu - 2, 2); if (pu < 0) { diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc index 6df37441b8..f39c8a57de 100644 --- a/libs/pbd/cpus.cc +++ b/libs/pbd/cpus.cc @@ -40,7 +40,7 @@ #endif int32_t -max_mmcss_threads_per_process () +PBD::max_mmcss_threads_per_process () { #ifdef PLATFORM_WINDOWS DWORD dwType = REG_DWORD; @@ -61,7 +61,7 @@ max_mmcss_threads_per_process () } uint32_t -hardware_concurrency() +PBD::hardware_concurrency() { if (getenv("ARDOUR_CONCURRENCY")) { int c = atoi (getenv("ARDOUR_CONCURRENCY")); diff --git a/libs/pbd/pbd/cpus.h b/libs/pbd/pbd/cpus.h index e33aee4d3d..eb52a01c1f 100644 --- a/libs/pbd/pbd/cpus.h +++ b/libs/pbd/pbd/cpus.h @@ -22,5 +22,9 @@ #include "pbd/libpbd_visibility.h" +namespace PBD{ + LIBPBD_API extern uint32_t hardware_concurrency (); LIBPBD_API extern int32_t max_mmcss_threads_per_process (); + +} diff --git a/libs/waveview/wave_view_private.cc b/libs/waveview/wave_view_private.cc index eb68bfbfe5..7dc681d327 100644 --- a/libs/waveview/wave_view_private.cc +++ b/libs/waveview/wave_view_private.cc @@ -342,7 +342,7 @@ WaveViewThreads::start_threads () { assert (!_threads.size()); - const int num_cpus = hardware_concurrency (); + const int num_cpus = PBD::hardware_concurrency (); /* the upper limit of 8 here is entirely arbitrary. It just doesn't * seem worthwhile having "ncpus" of low priority threads for