Closed QiuYilin closed 1 month ago
I believe https://pcl.readthedocs.io/projects/tutorials/en/master/adding_custom_ptype.html should answer your question
In an ideal world, these 4 components would create a single structure, SSE-aligned. However, because the majority of point operations will either set the last component of the data[4] array (from the xyz union) to 0 or 1 (for transformations), we cannot make intensity a member of the same structure, as its contents will be overwritten. For example, a dot product between two points will set their 4th component to 0, otherwise the dot product doesn’t make sense, etc.
Therefore for SSE-alignment, we pad intensity with 3 extra floats. Inefficient in terms of storage, but good in terms of memory alignment.
Now I know why pcl::normal is designed to use 32 bytes. SIMD is a mechanism on the CPU, so it is not necessary to use it on the GPU, right?
SIMD is a mechanism on the CPU, so it is not necessary to use it on the GPU, right?
That is a very general question, and I don't know enough about GPUs to answer this.
Please use Stackoverflow or the Discord community chat for such questions in the future. The GitHub issues are intended mainly for bug reports and compile errors.
pcl::normal contains four float data: nx, ny, nz and curve, but uses two float[4] for alignment.
I noticed that the gpu module also tends to use float[4] to represent normal, which leads to a very strange calling form:https://github.com/PointCloudLibrary/pcl/issues/2419. (Although it is also possible to use pcl::gpu::Feature::NormalType instead of pcl::PointXYZ)
What are the considerations for doing this?
.