fix mac compilation error (#10268)

Fix Mac compilation error in new cpuinfo changes
This commit is contained in:
Chen Fu 2022-01-18 08:09:27 -08:00 committed by GitHub
parent c12cafa524
commit 33dd2f8f5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@
#endif
#endif
#if defined(CPUIDINFO_ARCH_ARM) && defined(CPUINFO_SUPPORTED)
#if defined(CPUIDINFO_ARCH_ARM) && defined(CPUINFO_SUPPORTED) && defined(__linux__)
#include <sys/auxv.h>
#include <asm/hwcap.h>
// N.B. Support building with older versions of asm/hwcap.h that do not define
@ -109,7 +109,7 @@ CPUIDInfo::CPUIDInfo() {
#endif
#if defined(CPUIDINFO_ARCH_ARM)
#ifdef CPUINFO_SUPPORTED
#ifdef HWCAP_ASIMDDP
// only works on ARM linux or android, does not work on Windows
if (pytorch_cpuinfo_init_) {