PointCloudLibrary / PointCloudLibrary/pcl

[custom] EIGEN_ALIGN16 bad idea

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

Nobody has claimed this yet.

status: triage
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.