@@ -109,9 +109,6 @@ if(MSVC)
109
109
set (MSVC_BOOL True )
110
110
else (MSVC )
111
111
set (MSVC_BOOL False )
112
- check_cxx_compiler_flag(-march=armv8-a+sve COMPILER_SUPPORTS_SVE)
113
- check_cxx_compiler_flag(-march=armv8-a+sve2 COMPILER_SUPPORTS_SVE2)
114
- check_cxx_compiler_flag(-march=armv8-a+fp16fml COMPILER_SUPPORTS_FP16FML)
115
112
endif (MSVC )
116
113
117
114
################################################################################
@@ -290,6 +287,17 @@ endif()
290
287
################################################################################
291
288
292
289
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64" )
290
+ check_cxx_compiler_flag(-march=armv8.2-a+fp16fml COMPILER_SUPPORTS_FP16FML)
291
+ if (COMPILER_SUPPORTS_FP16FML)
292
+ set (fbgemm_fml_flags "-march=armv8.2-a+fp16fml" )
293
+ endif ()
294
+ if (NOT COMPILER_SUPPORTS_FP16FML) # for clang
295
+ check_cxx_compiler_flag(-mfp16fml COMPILER_SUPPORTS_FP16FML)
296
+ if (COMPILER_SUPPORTS_FP16FML)
297
+ set (fbgemm_fml_flags "-march=armv8.2 -mfp16fml" )
298
+ endif ()
299
+ endif ()
300
+
293
301
if (NOT COMPILER_SUPPORTS_FP16FML)
294
302
message (FATAL_ERROR "The current compiler does not support building FP16FML code" )
295
303
endif ()
@@ -309,7 +317,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
309
317
-ftree-vectorize
310
318
-fno-trapping-math
311
319
-Wignored-qualifiers
312
- -march=armv8-a+fp16fml
320
+ -march=armv8.2 -a+fp16fml
313
321
DEFINITIONS
314
322
${fbgemm_arm_defs}
315
323
DEPS
@@ -330,6 +338,8 @@ endif()
330
338
331
339
set (FBGEMM_BUILD_SVE False )
332
340
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64" )
341
+ check_cxx_compiler_flag(-march=armv8-a+sve COMPILER_SUPPORTS_SVE)
342
+ check_cxx_compiler_flag(-march=armv8-a+sve2 COMPILER_SUPPORTS_SVE2)
333
343
if (COMPILER_SUPPORTS_SVE2)
334
344
set (FBGEMM_BUILD_SVE True )
335
345
set (fbgemm_sve_flags "-march=armv8-a+sve2" )
0 commit comments