diff --git a/AnnService/CMakeLists.txt b/AnnService/CMakeLists.txt index 5aaa1cbca..c8abeeddb 100644 --- a/AnnService/CMakeLists.txt +++ b/AnnService/CMakeLists.txt @@ -34,7 +34,8 @@ add_library (DistanceUtils STATIC ) if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") - target_compile_options(DistanceUtils PRIVATE -mavx2 -mavx -msse -msse2 -mavx512f -mavx512bw -mavx512dq -fPIC) + target_compile_options(DistanceUtils PRIVATE -fPIC -fopenmp-simd -O3) + target_compile_definitions(DistanceUtils PRIVATE SIMDE_ENABLE_NATIVE_ALIASES SIMDE_ENABLE_OPENMP) endif() add_library (SPTAGLib SHARED ${SRC_FILES} ${HDR_FILES}) diff --git a/AnnService/inc/Core/Common/DistanceUtils.h b/AnnService/inc/Core/Common/DistanceUtils.h index e46c0c84f..60d9787ad 100644 --- a/AnnService/inc/Core/Common/DistanceUtils.h +++ b/AnnService/inc/Core/Common/DistanceUtils.h @@ -4,7 +4,7 @@ #ifndef _SPTAG_COMMON_DISTANCEUTILS_H_ #define _SPTAG_COMMON_DISTANCEUTILS_H_ -#include +#include #include #include diff --git a/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h b/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h index 99adae3c0..a91274420 100644 --- a/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h +++ b/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h @@ -4,7 +4,7 @@ #ifndef _SPTAG_COMMON_RNG_H_ #define _SPTAG_COMMON_RNG_H_ -#include +#include #include "NeighborhoodGraph.h" namespace SPTAG diff --git a/AnnService/inc/Core/Common/SIMDUtils.h b/AnnService/inc/Core/Common/SIMDUtils.h index 73e5e2334..8480cdb06 100644 --- a/AnnService/inc/Core/Common/SIMDUtils.h +++ b/AnnService/inc/Core/Common/SIMDUtils.h @@ -4,7 +4,7 @@ #ifndef _SPTAG_COMMON_SIMDUTILS_H_ #define _SPTAG_COMMON_SIMDUTILS_H_ -#include +#include #include #include diff --git a/AnnService/src/Core/Common/DistanceUtils.cpp b/AnnService/src/Core/Common/DistanceUtils.cpp index e98f38121..c8ae2af76 100644 --- a/AnnService/src/Core/Common/DistanceUtils.cpp +++ b/AnnService/src/Core/Common/DistanceUtils.cpp @@ -2,7 +2,21 @@ // Licensed under the MIT License. #include "inc/Core/Common/DistanceUtils.h" -#include +#include +#include +#include + +#ifndef __mmask32 +#define __mmask32 simde__mmask32 +#endif + +#ifndef __mmask64 +#define __mmask64 simde__mmask64 +#endif + +#ifndef _mm512_setzero_ps +#define _mm512_setzero_ps simde_mm512_setzero_ps +#endif using namespace SPTAG; using namespace SPTAG::COMMON; diff --git a/AnnService/src/Core/Common/SIMDUtils.cpp b/AnnService/src/Core/Common/SIMDUtils.cpp index 428552bb9..53909bf2c 100644 --- a/AnnService/src/Core/Common/SIMDUtils.cpp +++ b/AnnService/src/Core/Common/SIMDUtils.cpp @@ -2,7 +2,9 @@ // Licensed under the MIT License. #include "inc/Core/Common/SIMDUtils.h" -#include +#include +#include +#include using namespace SPTAG; using namespace SPTAG::COMMON;