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()
# flags are for MSVC only!
check_sse("AVX" "-mavx")
if(NOT ${AVX_FOUND})
set(LLAMA_AVX OFF)
@ -85,7 +86,8 @@ else()
endif()
check_sse("AVX2" "-mavx2")
if(NOT ${AVX2_FOUND})
check_sse("FMA" "-mfma")
if((NOT ${AVX2_FOUND}) OR (NOT ${FMA_FOUND}))
set(LLAMA_AVX2 OFF)
else()
set(LLAMA_AVX2 ON)