EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Attributes | Static Public Attributes | List of all members
EBGeometry::BVH::ChildBoxes< T, K > Struct Template Reference

The boxes of the K children of one interior node, in SoA layout: m_lo[axis][child] and m_hi[axis][child], so that one axis of all K children loads as one SIMD register. More...

#include <EBGeometry_BVHQuery.hpp>

Public Attributes

T m_lo [3][K]
 Lower corners: m_lo[axis][child], axis in {0, 1, 2}, child in {0, ..., K - 1}.
 
T m_hi [3][K]
 Upper corners: m_hi[axis][child], axis in {0, 1, 2}, child in {0, ..., K - 1}.
 

Static Public Attributes

static constexpr size_t RowAlignment
 Alignment of one axis row, in bytes.
 

Detailed Description

template<class T, size_t K>
struct EBGeometry::BVH::ChildBoxes< T, K >

The boxes of the K children of one interior node, in SoA layout: m_lo[axis][child] and m_hi[axis][child], so that one axis of all K children loads as one SIMD register.

What a query type tests when PackedBVH::traverse() expands a node. Read-only for users: a PackedBVH builds and refits its rows.

Template Parameters
TFloating-point precision.
KBranching factor.

Member Data Documentation

◆ RowAlignment

template<class T , size_t K>
constexpr size_t EBGeometry::BVH::ChildBoxes< T, K >::RowAlignment
staticconstexpr
Initial value:
=
(((sizeof(T) * K) & ((sizeof(T) * K) - 1)) == 0) ? (sizeof(T) * K) : alignof(T)

Alignment of one axis row, in bytes.

A row is sizeof(T) * K bytes wide, and every SIMD path loads a whole row with one aligned load, so the row wants to be aligned to its own width. That width is only a legal alignment when it is a power of two, which it is for exactly the (T, K) combinations that have a SIMD path (16, 32 and 64 bytes). For every other K (3, 5, 6, 7, ...) no SIMD path is compiled, nothing performs an aligned vector load on the row, and T's natural alignment is both sufficient and legal. Asking for sizeof(T) * K unconditionally would make PackedBVH<double, P, 3> and its odd-K siblings fail to compile ("requested alignment 24 is not a positive power of 2").


The documentation for this struct was generated from the following file: