Skip to content

Commit

Permalink
Factor out AVX2/FMA composition functions (RobotLocomotion#17752)
Browse files Browse the repository at this point in the history
* Factor out AVX2/FMA composition functions into separate target in preparation for adding runtime detection of AVX2/FMA capability.
  • Loading branch information
calderpg-tri authored Aug 22, 2022
1 parent 2f34019 commit 44dd7ef
Show file tree
Hide file tree
Showing 4 changed files with 568 additions and 359 deletions.
19 changes: 17 additions & 2 deletions math/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ drake_cc_package_library(
":eigen_sparse_triplet",
":evenly_distributed_pts_on_sphere",
":fast_pose_composition_functions",
":fast_pose_composition_functions_avx2_fma",
":geometric_transform",
":gradient",
":gray_code",
Expand Down Expand Up @@ -279,17 +280,31 @@ drake_cc_library(
# Currently (March 2021) we can't do that on Apple even if it is Intel-based
# due to our old Mac CI machines. Compiling for Broadwell (or later) gets
# those instructions.
drake_cc_library(
name = "fast_pose_composition_functions_avx2_fma",
srcs = ["fast_pose_composition_functions_avx2_fma.cc"],
hdrs = ["fast_pose_composition_functions_avx2_fma.h"],
copts = select({
"//tools/cc_toolchain:apple": [],
"//conditions:default": [
"-DDRAKE_ENABLE_AVX2_FMA",
"-march=broadwell",
],
}),
deps = [],
)

drake_cc_library(
name = "fast_pose_composition_functions",
srcs = ["fast_pose_composition_functions.cc"],
hdrs = ["fast_pose_composition_functions.h"],
copts = select({
"//tools/cc_toolchain:apple": [],
"//conditions:default": [
"-march=broadwell",
"-DDRAKE_ENABLE_AVX2_FMA",
],
}),
deps = [],
deps = [":fast_pose_composition_functions_avx2_fma"],
)

# === test/ ===
Expand Down
Loading

0 comments on commit 44dd7ef

Please sign in to comment.