|
| void | pack (const Vec3T< T > *a_positions, uint32_t a_count) noexcept |
| | Pack a_count positions from a_positions[0..a_count-1] into this SoA group.
|
| |
| Array< T, W > | getDistances2 (const Vec3T< T > &a_point) const noexcept |
| | Squared unsigned distances from a_point to every one of the W lane positions.
|
| |
| Array< T, W > | getDistances (const Vec3T< T > &a_point) const noexcept |
| | Unsigned distances from a_point to every one of the W lane positions.
|
| |
| T | getMinimumDistance2 (const Vec3T< T > &a_point) const noexcept |
| | Shortest squared unsigned distance from a_point to the closest position in this group.
|
| |
| T | getMinimumDistance (const Vec3T< T > &a_point) const noexcept |
| | Shortest unsigned distance from a_point to the closest position in this group.
|
| |
| T | getMaximumDistance2 (const Vec3T< T > &a_point) const noexcept |
| | Largest squared unsigned distance from a_point to the farthest position in this group.
|
| |
| T | getMaximumDistance (const Vec3T< T > &a_point) const noexcept |
| | Largest unsigned distance from a_point to the farthest position in this group.
|
| |
| template<class BV > |
| BV | computeBoundingVolume () const noexcept |
| | Compute the bounding volume enclosing all valid positions in this group.
|
| |
| uint32_t | numValid () const noexcept |
| | Number of real (non-padded) positions in this group.
|
| |
template<class T, size_t W = PointSoA::DefaultWidth<T>()>
struct EBGeometry::PointSoAT< T, W >
True SoA (Structure of Arrays) layout for W point positions, enabling SIMD distance evaluation against the whole group at once.
Deliberately carries positions only – no ids, no orientation. A point has no inside/outside notion, so there is no signedDistance() here, only unsigned distance queries. The one SIMD kernel computes the squared distance from the query point to all W lane positions simultaneously; everything the class exposes is a thin wrapper over it – getDistances2()/ getDistances() return the whole W-lane array, and getMinimumDistance2()/getMaximumDistance2() (and their sqrt counterparts) horizontally reduce it. Point ids, when needed, are carried by the separate PointAoSoA<T, W> wrapper (see EBGeometry_PointAoSoA.hpp) rather than as a member here, so that a pure position-only distance traversal never has id bytes anywhere near its hot data – not merely unused, but physically absent from this type.
- Warning
- This type is over-aligned (up to 64 bytes, for AVX-512F) via alignas. The library's own usage (PackedBVH storing groups in a Pool-backed PODVector, reserved at the group's alignof inside a PoolBaseAlign-aligned block) is safe. If you allocate a PointSoAT yourself outside of that path – a raw
new, a container with a custom/pre-C++17-style allocator, placement-new into externally-owned storage, or a malloc'd buffer – you are responsible for ensuring the memory is aligned to alignof(PointSoAT<T, W>); nothing in this class enforces or checks that.
- Template Parameters
-
| T | Floating-point precision. |
| W | Lanes per group. A host build vectorizes (float, 4) with SSE4.1, (float, 8), (double, 4) and (double, 8, as two halves) with AVX, and (float, 16) and (double, 8) with AVX-512F; any other width, and every width on a device, runs the scalar loop. Defaults to PointSoA::DefaultWidth<T>(), which is 4 for both float and double in every translation unit; PointSoA::HostWidth<T>() gives the width that fills one SIMD register for T under the compiler's SIMD flags, for host-only code. |
template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Squared unsigned distances from a_point to every one of the W lane positions.
This is the group's one SIMD kernel; every other distance query is a wrapper over it. Squared, so sqrt-free – prefer it (and getMinimumDistance2()/getMaximumDistance2()) whenever the caller only needs distances for comparison, not their actual magnitude. All W lanes are returned: padded lanes (indices m_validCount..W-1) repeat the last real position's squared distance, matching pack()'s padding, so a caller iterating lanes should stop at the real count (or, if it lacks that count, use numValid()). Requires the group to have already been packed via pack() (1 <= m_validCount <= W).
- Parameters
-
| [in] | a_point | Query point. Must be finite. |
- Returns
- Per-lane squared distances, one per W lanes.