Skip to content

Commit 9876fe1

Browse files
add option for sse4 and avs512 (#3853) (#3855)
(cherry picked from commit 7274811) Co-authored-by: Steve Macenski <[email protected]>
1 parent 6e35cc7 commit 9876fe1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

nav2_mppi_controller/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@ nav2_package()
3636

3737
include(CheckCXXCompilerFlag)
3838

39+
check_cxx_compiler_flag("-mno-avx512f" COMPILER_SUPPORTS_AVX512)
40+
check_cxx_compiler_flag("-msse4.2" COMPILER_SUPPORTS_SSE4)
3941
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
4042
check_cxx_compiler_flag("-mfma" COMPILER_SUPPORTS_FMA)
4143

44+
if(COMPILER_SUPPORTS_AVX512)
45+
add_compile_options(-mno-avx512f)
46+
endif()
47+
48+
if(COMPILER_SUPPORTS_SSE4)
49+
add_compile_options(-msse4.2)
50+
endif()
51+
4252
if(COMPILER_SUPPORTS_AVX2)
4353
add_compile_options(-mavx2)
4454
endif()
@@ -48,7 +58,7 @@ if(COMPILER_SUPPORTS_FMA)
4858
endif()
4959

5060
# If building one the same hardware to be deployed on, try `-march=native`!
51-
add_compile_options(-O3 -finline-limit=10000000 -ffp-contract=fast -ffast-math -mtune=generic -mno-avx512f)
61+
add_compile_options(-O3 -finline-limit=10000000 -ffp-contract=fast -ffast-math -mtune=generic)
5262

5363
add_library(mppi_controller SHARED
5464
src/controller.cpp

0 commit comments

Comments
 (0)