Skip to content

Commit 4b39c55

Browse files
q10facebook-github-bot
authored andcommitted
Fix CXX_AVX2_FLAGS (#4823)
Summary: X-link: facebookresearch/FBGEMM#1851 - Remove quotes from CXX_AVX2_FLAGS to avoid compilation issue (see P1932287429) Pull Request resolved: #4823 Reviewed By: cthi Differential Revision: D81732858 Pulled By: q10 fbshipit-source-id: 9a52b09436013d8f520b21bdbaa19a81e0bdf9b3
1 parent d86d65d commit 4b39c55

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ include(GNUInstallDirs)
6464
# Check AVX
6565
set(CHECK_AVX_COMPILE ON)
6666
include(${MODULE_PATH}/FindAVX.cmake)
67+
# For some reason, AVX flag values end up being packed into a single quoted
68+
# string when FBGEMM is built as part of PyTorch build, so we need to separate
69+
# the flags here back into list-string format
70+
separate_arguments(CXX_AVX2_FLAGS)
71+
separate_arguments(CXX_AVX512_FLAGS)
6772

6873
# Load Python
6974
find_package(Python)

cmake/modules/FindAVX.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,7 @@ foreach(lang C;CXX)
106106
CHECK_SSE(${lang} "AVX512" "-mavx512f -mavx512dq -mavx512vl -mavx512bw -mfma;/arch:AVX512")
107107
endif()
108108
endforeach()
109+
110+
MESSAGE(STATUS "CXX_AVX_FLAGS: ${CXX_AVX_FLAGS}")
111+
MESSAGE(STATUS "CXX_AVX2_FLAGS: ${CXX_AVX2_FLAGS}")
112+
MESSAGE(STATUS "CXX_AVX512_FLAGS: ${CXX_AVX512_FLAGS}")

0 commit comments

Comments
 (0)