File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ if (NO_AVX2)
110
110
set (GETARCH_FLAGS "${GETARCH_FLAGS} -DNO_AVX2" )
111
111
endif ()
112
112
113
+ if (NO_AVX512 )
114
+ message (STATUS "Disabling Advanced Vector Extensions 512 (AVX512)." )
115
+ set (GETARCH_FLAGS "${GETARCH_FLAGS} -DNO_AVX512" )
116
+ endif ()
117
+
113
118
if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
114
119
set (GETARCH_FLAGS "${GETARCH_FLAGS} ${CMAKE_C_FLAGS_DEBUG} " )
115
120
endif ()
Original file line number Diff line number Diff line change @@ -109,13 +109,15 @@ else()
109
109
endif ()
110
110
111
111
if (X86_64 OR X86 )
112
+ if (NOT NO_AVX512 )
112
113
file (WRITE ${PROJECT_BINARY_DIR} /avx512.c "#include <immintrin.h>\n\n int main(void){ __asm__ volatile(\" vbroadcastss -4 * 4(%rsi), %zmm2\" ); }" )
113
114
execute_process (COMMAND ${CMAKE_C_COMPILER} -march=skylake-avx512 -c -v -o ${PROJECT_BINARY_DIR} /avx512.o ${PROJECT_BINARY_DIR} /avx512.c OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_AVX512 )
114
115
if (NO_AVX512 EQUAL 1 )
115
116
set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512" )
116
117
endif ()
117
118
file (REMOVE "avx512.c" "avx512.o" )
118
119
endif ()
120
+ endif ()
119
121
120
122
include (CheckIncludeFile )
121
123
CHECK_INCLUDE_FILE ("stdatomic.h" HAVE_C11 )
You can’t perform that action at this time.
0 commit comments