1 #ifndef OPENMM_HARDWARE_H_
2 #define OPENMM_HARDWARE_H_
43 #include <sys/sysctl.h>
52 #include <cpu-features.h>
59 static int getNumProcessors() {
63 if (sysctlbyname(
"hw.logicalcpu", &ncpu, &len, NULL, 0) == 0)
69 SYSTEM_INFO siSysInfo;
71 GetSystemInfo(&siSysInfo);
72 ncpu = siSysInfo.dwNumberOfProcessors;
78 return android_getCpuCount();
80 long nProcessorsOnline = sysconf(_SC_NPROCESSORS_ONLN);
81 if (nProcessorsOnline == -1)
84 return (
int) nProcessorsOnline;
96 #if !defined(__ANDROID__) && !defined(__PNACL__)
97 static void cpuid(
int cpuInfo[4],
int infoType){
99 __asm__ __volatile__ (
108 __asm__ __volatile__ (
124 #endif // OPENMM_HARDWARE_H_