File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ project(qsim)
17
17
18
18
IF (WIN32 )
19
19
add_compile_options (/arch:AVX2 )
20
+ ELSEIF (APPLE AND NOT CMAKE_APPLE_SILICON_PROCESSOR )
21
+ # On Intel MacOS, CMake detects AVX* but clang doesn't recognize -mavx2.
22
+ # Using arch=native should turn on the features if they're available.
23
+ add_compile_options (-march=native )
20
24
ELSE ()
21
25
add_compile_options (-mavx2 -mfma )
22
26
ENDIF ()
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ project(qsim)
17
17
18
18
IF (WIN32 )
19
19
add_compile_options (/arch:AVX512 )
20
+ ELSEIF (APPLE AND NOT CMAKE_APPLE_SILICON_PROCESSOR
21
+ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
22
+ # On Intel Macs CMake detects AVX but clang doesn't recognize -mavx512.
23
+ # Using arch=native should turn on the features if they're available.
24
+ add_compile_options (-march=native )
20
25
ELSE ()
21
26
add_compile_options (-mavx512f -mbmi2 )
22
27
ENDIF ()
You can’t perform that action at this time.
0 commit comments