File tree Expand file tree Collapse file tree
thirdparty/faiss/faiss/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ if(__AARCH64)
7777 message (STATUS "SVE for ARMv8: Not Found" )
7878 endif ()
7979
80+ if (APPLE )
81+ set (HAS_ARMV9_SVE FALSE )
82+ set (HAS_ARMV8_SVE FALSE )
83+ message (STATUS "Disable SVE for Apple" )
84+ endif ()
85+
8086 if (HAS_ARMV9_SVE)
8187 foreach (SVE_FILE ${UTILS_SVE_SRC} )
8288 set_source_files_properties (${SVE_FILE} PROPERTIES COMPILE_OPTIONS "-march=armv9-a+sve" )
Original file line number Diff line number Diff line change 3535#include " distances_powerpc.h"
3636#endif
3737
38- #if defined(__aarch64__)
38+ #if defined(__aarch64__) && !defined(__APPLE__)
3939#include < asm/hwcap.h>
4040#include < sys/auxv.h>
4141#endif
@@ -132,12 +132,19 @@ cpu_support_f16c() {
132132#endif
133133
134134#if defined(__aarch64__)
135+ #if defined(__APPLE__)
136+ bool
137+ supports_sve () {
138+ return false ;
139+ }
140+ #else
135141bool
136142supports_sve () {
137143 unsigned long hwcap = getauxval (AT_HWCAP );
138144 return (hwcap & HWCAP_SVE ) != 0 ;
139145}
140146#endif
147+ #endif
141148
142149static std::mutex patch_bf16_mutex;
143150
Original file line number Diff line number Diff line change 88#include < stdio.h>
99#include < string.h>
1010
11- #ifdef __linux__
11+ #if defined( __linux__) || defined(__APPLE__)
1212
1313#include < fcntl.h>
1414#include < sys/mman.h>
3030
3131namespace faiss {
3232
33- #ifdef __linux__
33+ #if defined( __linux__) || defined(__APPLE__)
3434
3535struct MmappedFileMappingOwner ::PImpl {
3636 void * ptr = nullptr ;
You can’t perform that action at this time.
0 commit comments