Skip to content

Commit 56ecc59

Browse files
cyyeverfacebook-github-bot
authored andcommitted
Use fbgemm_fml_flags and add fbgemm_sve guard (#4948)
Summary: X-link: facebookresearch/FBGEMM#1977 Add a missing part in #4942 . I also fix another aarch64 issue on PyTorch CI: ``` /var/lib/jenkins/workspace/third_party/fbgemm/include/fbgemm/./Utils.h:26:10: fatal error: arm_neon_sve_bridge.h: No such file or directory 26 | #include <arm_neon_sve_bridge.h> // manual | ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. ``` [ARM documentation](https://developer.arm.com/documentation/110065/0100/Software-codec-optimization/Compiler-recommendations) says: SVE and SVE2 feature paths in libaom, libvpx, and x265 require the intrinsics declared in arm_neon_sve_bridge.h. This header file is available in the following releases: Clang 17 and later. GCC 14 and later. Pull Request resolved: #4948 Reviewed By: cthi Differential Revision: D83578552 Pulled By: q10 fbshipit-source-id: 13b07cbb68ec7b233488a1958d86510b8828a52f
1 parent 5a40c0e commit 56ecc59

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
317317
-ftree-vectorize
318318
-fno-trapping-math
319319
-Wignored-qualifiers
320-
-march=armv8.2-a+fp16fml
320+
${fbgemm_fml_flags}
321321
DEFINITIONS
322322
${fbgemm_arm_defs}
323323
DEPS
@@ -337,7 +337,14 @@ endif()
337337
################################################################################
338338

339339
set(FBGEMM_BUILD_SVE False)
340-
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64")
340+
# SVE and SVE2 feature paths require the intrinsics declared in arm_neon_sve_bridge.h
341+
# This header file is available in the following releases:
342+
# Clang 17 and later.
343+
# GCC 14 and later.
344+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64" AND
345+
((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14)
346+
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17)))
347+
341348
check_cxx_compiler_flag(-march=armv8-a+sve COMPILER_SUPPORTS_SVE)
342349
check_cxx_compiler_flag(-march=armv8-a+sve2 COMPILER_SUPPORTS_SVE2)
343350
if(COMPILER_SUPPORTS_SVE2)

0 commit comments

Comments
 (0)