Skip to content

Commit 3cc91b2

Browse files
committed
msvc combines avx2 and fma into /arch:AVX2 so check for both
1 parent ec40b70 commit 3cc91b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/FindSIMD.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ macro(check_sse type flags)
7777

7878
endmacro()
7979

80+
# flags are for MSVC only!
8081
check_sse("AVX" "-mavx")
8182
if(NOT ${AVX_FOUND})
8283
set(LLAMA_AVX OFF)
@@ -85,7 +86,8 @@ else()
8586
endif()
8687

8788
check_sse("AVX2" "-mavx2")
88-
if(NOT ${AVX2_FOUND})
89+
check_sse("FMA" "-mfma")
90+
if((NOT ${AVX2_FOUND}) OR (NOT ${FMA_FOUND}))
8991
set(LLAMA_AVX2 OFF)
9092
else()
9193
set(LLAMA_AVX2 ON)

0 commit comments

Comments
 (0)