Skip to content

Commit

Permalink
fix illegal instruction on platform which has avx only (#175)
Browse files Browse the repository at this point in the history
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
  • Loading branch information
LHT129 authored Dec 2, 2024
1 parent fd8a1e6 commit dfab566
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/simd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ if (DIST_CONTAINS_AVX)
set_source_files_properties (avx.cpp PROPERTIES COMPILE_FLAGS "-mavx")
add_definitions (-DENABLE_AVX=1)
endif ()
if (DIST_CONTAINS_AVX2)
set_source_files_properties (avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2 -mfma")
add_definitions (-DENABLE_AVX2=1)
endif ()
# FIXME(LHT): cause illegal instruction on platform which has avx only
#if (DIST_CONTAINS_AVX2)
# set_source_files_properties (avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2 -mfma")
# add_definitions (-DENABLE_AVX2=1)
#endif ()
if (DIST_CONTAINS_AVX512)
set (SIMD_SRCS ${SIMD_SRCS} avx512.cpp)
set_source_files_properties (avx512.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi")
Expand Down

0 comments on commit dfab566

Please sign in to comment.