msvc combines avx2 and fma into /arch:AVX2 so check for both

This commit is contained in:
netrunnereve 2023-11-02 22:18:41 -04:00
parent ec40b70ea9
commit 3cc91b2d66

View file

@ -77,6 +77,7 @@ macro(check_sse type flags)
endmacro() endmacro()
# flags are for MSVC only!
check_sse("AVX" "-mavx") check_sse("AVX" "-mavx")
if(NOT ${AVX_FOUND}) if(NOT ${AVX_FOUND})
set(LLAMA_AVX OFF) set(LLAMA_AVX OFF)
@ -85,7 +86,8 @@ else()
endif() endif()
check_sse("AVX2" "-mavx2") check_sse("AVX2" "-mavx2")
if(NOT ${AVX2_FOUND}) check_sse("FMA" "-mfma")
if((NOT ${AVX2_FOUND}) OR (NOT ${FMA_FOUND}))
set(LLAMA_AVX2 OFF) set(LLAMA_AVX2 OFF)
else() else()
set(LLAMA_AVX2 ON) set(LLAMA_AVX2 ON)