File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ if(CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS)
28
28
add_dependencies (Caffe2_perfkernels_avx2 Caffe2_PROTO)
29
29
target_link_libraries (Caffe2_perfkernels_avx PRIVATE c10)
30
30
target_link_libraries (Caffe2_perfkernels_avx2 PRIVATE c10)
31
- if (MSVC )
31
+ if (MSVC AND NOT " ${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
32
32
target_compile_options (Caffe2_perfkernels_avx
33
33
PRIVATE "/arch:AVX"
34
34
PRIVATE "/D__F16C__" )
@@ -61,7 +61,7 @@ if(CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS)
61
61
add_library (Caffe2_perfkernels_avx512 STATIC ${avx512_srcs} )
62
62
add_dependencies (Caffe2_perfkernels_avx512 Caffe2_PROTO)
63
63
target_link_libraries (Caffe2_perfkernels_avx512 PRIVATE c10)
64
- if (MSVC )
64
+ if (MSVC AND NOT " ${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
65
65
target_compile_options (Caffe2_perfkernels_avx512
66
66
PRIVATE "/D__AVX512F__"
67
67
PRIVATE "/D__AVX512DQ__"
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ cmake_pop_check_state()
134
134
# ---[ Check if the compiler has AVX/AVX2 support. We only check AVX2.
135
135
if (NOT INTERN_BUILD_MOBILE)
136
136
cmake_push_check_state(RESET)
137
- if (MSVC )
137
+ if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
138
138
set (CMAKE_REQUIRED_FLAGS "/arch:AVX2" )
139
139
else ()
140
140
set (CMAKE_REQUIRED_FLAGS "-mavx2" )
@@ -160,7 +160,7 @@ if(NOT INTERN_BUILD_MOBILE)
160
160
endif ()
161
161
# ---[ Check if the compiler has AVX512 support.
162
162
cmake_push_check_state(RESET)
163
- if (MSVC )
163
+ if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
164
164
# We could've used MSVC's hidden option /arch:AVX512 that defines __AVX512F__,
165
165
# __AVX512DQ__, and __AVX512VL__, and /arch:AVX512F that defines __AVX512F__.
166
166
# But, we chose not to do that not to rely on hidden options.
You can’t perform that action at this time.
0 commit comments