Skip to content

Commit

Permalink
use AVX2 SSE for cmake&clang on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Jan 29, 2019
1 parent fd881e4 commit fc55b58
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ if (WIN32)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/arch/simddetect.cpp
PROPERTIES COMPILE_FLAGS "/DAVX /DAVX2 /DSSE4_1")
else(CLANG)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/arch/dotproductsse.cpp
PROPERTIES COMPILE_FLAGS "-msse4.1")
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/arch/intsimdmatrixsse.cpp
PROPERTIES COMPILE_FLAGS "-msse4.1")
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/arch/dotproductavx.cpp
PROPERTIES COMPILE_FLAGS "-mavx")
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/arch/intsimdmatrixavx2.cpp
PROPERTIES COMPILE_FLAGS "-mavx2")
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/arch/simddetect.cpp
PROPERTIES COMPILE_FLAGS "-DAVX -DAVX2 -DSSE4_1")
endif() # NOT CLANG
endif() # MSVC
else()
Expand Down

2 comments on commit fc55b58

@stweil
Copy link
Member

@stweil stweil commented on fc55b58 Jan 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for gcc (x86_64-w64-mingw) on Windows is still missing even after that change. It might be simpler to change the code and handle MSC as the only special case.

Another problem is that the current CMake code fails on non-Intel hosts which don't have SSE / AVX.

@zdenop
Copy link
Contributor Author

@zdenop zdenop commented on fc55b58 Jan 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just quick fix - I am "playing with clang" on Windows, because VS community edition has some limitation.

Please sign in to comment.