[custom] EIGEN_ALIGN16 bad idea

Open
#5,805 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

Start with the point definitions and the PCL_ADD_UNION_POINT4D macro shown in the issue, then review how their EIGEN_ALIGN16 and union usage relate to Eigen requirements. Done would require an agreed approach for configurable or removed alignment that preserves the relevant point behavior and addresses cache efficiency and multithreading concerns.

Written by the indexing model from the issue text.

Description

status: triage

the use of EIGEN_ALIGN16
seems to be a very bad idea. In particular for cache efficiency and multithreading.

I would either eliminate that and all similar ones or substitute them with something configurable at compile time
giving also the option to use, compile-time-configurable directives like
alignas(std::hardware_destructive_interference_size) (and here the topic of moving to C++17 goes on)

why are the definitions of the points so relying on alignment and they make use of union??
isn't this too hard coding and anti-OOP?

#define PCL_ADD_UNION_POINT4D
union EIGEN_ALIGN16 {
float data[4];
struct {
float x;
float y;
float z;
};
};

i see it is probably "required" by Eigen

Dominant language
C++
Stars
11.2k
Forks
4.7k
Avg merge
6d 13h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PointCloudLibrary/pcl

All issues in PointCloudLibrary/pcl

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.