13 #if defined(LINUX) && defined(_SC_NPROCESSORS_ONLN)
16 #include <sys/types.h>
17 #include <sys/sysctl.h>
21 using namespace shogun;
39 #if defined(LINUX) && defined(_SC_NPROCESSORS_ONLN)
40 return sysconf( _SC_NPROCESSORS_ONLN );
43 size_t size=
sizeof(num);
44 if (!sysctlbyname(
"hw.ncpu", &num, &size, NULL, 0))
76 if (refcount==0 || --refcount==0)
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.