EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Functions
EBGeometry::TriangleSoA Namespace Reference

Namespace for TriangleSoAT-related compile-time utilities. More...

Functions

template<typename T >
constexpr size_t DefaultWidth () noexcept
 Returns the SIMD-optimal SoA width (triangles per TriangleSoAT group) for type T on the current target ISA.
 

Detailed Description

Namespace for TriangleSoAT-related compile-time utilities.

Function Documentation

◆ DefaultWidth()

template<typename T >
constexpr size_t EBGeometry::TriangleSoA::DefaultWidth ( )
constexprnoexcept

Returns the SIMD-optimal SoA width (triangles per TriangleSoAT group) for type T on the current target ISA.

Maps the floating-point type and the compile-time ISA to the W that fills one SIMD register exactly, matching the paths TriangleSoAT::signedDistance() actually implements. Not a member of TriangleSoAT itself: that class is templated on W, so a member couldn't be used to compute W's own default (the same reason BVH::DefaultBranchingRatio<T>() is a free function in namespace BVH rather than a member of TreeBVH).

ISA T=float T=double
AVX-512F 16 8
AVX 8 4
otherwise 4 4

Usage: size_t W = EBGeometry::TriangleSoA::DefaultWidth<T>() as a template-parameter default.

Template Parameters
TFloating-point precision type (float or double).
Returns
Optimal W for the current ISA and T.