1 #ifndef OPENMM_HARDWARE_H_
2 #define OPENMM_HARDWARE_H_
43 #include <sys/sysctl.h>
55 static int getNumProcessors() {
59 if (sysctlbyname(
"hw.logicalcpu", &ncpu, &len, NULL, 0) == 0)
65 SYSTEM_INFO siSysInfo;
67 GetSystemInfo(&siSysInfo);
68 ncpu = siSysInfo.dwNumberOfProcessors;
73 long nProcessorsOnline = sysconf(_SC_NPROCESSORS_ONLN);
74 if (nProcessorsOnline == -1)
77 return (
int) nProcessorsOnline;
88 static void cpuid(
int cpuInfo[4],
int infoType){
90 __asm__ __volatile__ (
99 __asm__ __volatile__ (
114 #endif // OPENMM_HARDWARE_H_