diff options
Diffstat (limited to 'meta/multi_thread_common.h')
-rw-r--r-- | meta/multi_thread_common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/multi_thread_common.h b/meta/multi_thread_common.h index dc1b799..0b35759 100644 --- a/meta/multi_thread_common.h +++ b/meta/multi_thread_common.h @@ -20,6 +20,15 @@ namespace gemmlowp { namespace meta { +inline int ResolveMaxThreads(int max_threads) { + if (max_threads == 0) { + static const int hardware_threads_count = + static_cast<int>(sysconf(_SC_NPROCESSORS_CONF)); + return hardware_threads_count; + } + return max_threads; +} + template <typename WorkersPool> class SimpleContext { public: |