14 #if defined(LINUX) && defined(_SC_NPROCESSORS_ONLN)
17 #include <sys/types.h>
18 #include <sys/sysctl.h>
22 using namespace shogun;
43 #if defined(LINUX) && defined(_SC_NPROCESSORS_ONLN)
44 return sysconf( _SC_NPROCESSORS_ONLN );
47 size_t size=
sizeof(num);
48 if (!sysctlbyname(
"hw.ncpu", &num, &size, NULL, 0))
69 return m_refcount->
ref();
79 int32_t rc = m_refcount->
unref();
void set_num_threads(int32_t n)
int32_t get_num_cpus() const
int32_t get_num_threads() const
int32_t ref_count() const
Class Parallel provides helper functions for multithreading.