Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Eigen alignment #63

Merged
merged 1 commit into from
Apr 15, 2020
Merged

Fix Eigen alignment #63

merged 1 commit into from
Apr 15, 2020

Conversation

gleichdick
Copy link
Contributor

IMarkerEndEffector has a vectorizable Eigen member, so it needs proper alignment.
std::make_shared also does not respect alignment, so it is replaced with std::allocate_shared.

@mamoll
Copy link
Contributor

mamoll commented Apr 15, 2020

Is this the only Eigen alignment that needs to be fixed? Might be nice to one PR for all similar alignment fixes.

@gleichdick
Copy link
Contributor Author

Eigen can make use of CPU extensions like SSE and AVX, which have these alignment requirements. I'm currently trying to enable it for moveit, so I took a look at the packages used there.
Related Issues: ompl/ompl#601 moveit/moveit#1902

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - all Eigen members covered. Thanks for your effort!

@@ -97,7 +98,9 @@ IMarkerRobotState::IMarkerRobotState(planning_scene_monitor::PlanningSceneMonito
else
eef_name = imarker_name + "_left";

end_effectors_[i] = std::make_shared<IMarkerEndEffector>(this, eef_name, arm_datas_[i], color);
// respect Eigen alignment
end_effectors_[i] = std::allocate_shared<IMarkerEndEffector>(Eigen::aligned_allocator<IMarkerEndEffector>(), this,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having IMarkerEndEffector declaring EIGEN_MAKE_ALIGNED_OPERATOR_NEW, why do you need this change here as well?
Found the answer myself: https://gitlab.com/libeigen/eigen/issues/1049

@mamoll mamoll merged commit c69e24f into moveit:master Apr 15, 2020
@rhaschke
Copy link
Contributor

@mamoll, please remember to use squash-merging for such 1-commit PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants