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

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

Functions

template<typename T >
constexpr size_t DefaultWidth () noexcept
 The default SoA width W (points per PointSoAT group): 4, for both float and double, in every translation unit.
 
template<typename T >
constexpr size_t HostWidth () noexcept
 The SoA width W (points per PointSoAT group) that fills one SIMD register for type T under the compiler's SIMD flags.
 

Detailed Description

Namespace for PointSoAT-related compile-time utilities.

Function Documentation

◆ DefaultWidth()

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

The default SoA width W (points per PointSoAT group): 4, for both float and double, in every translation unit.

This is the value the library's class templates default to. It never depends on compiler flags, so a type spelled with it has the same layout in a host-only file, in a file compiled with AVX, and in both passes of a CUDA or HIP compile – which is what lets an object be built on the host and used on a device. On the benchmarks in the Sphinx page on configuration options, it is also as fast on the host as the ISA-tuned value.

For host-only code, HostWidth<T>() gives the value tuned to the compiler's SIMD flags instead. EBGEOMETRY_HOST_TUNED_DEFAULTS does not change this value: it only widens the triangle groups (TriangleSoA::DefaultWidth), since wider point groups measured no faster. Usage: size_t W = PointSoA::DefaultWidth<T>() as a template-parameter default.

Template Parameters
TFloating-point precision type (float or double).
Returns
4.

◆ HostWidth()

template<typename T >
constexpr size_t EBGeometry::PointSoA::HostWidth ( )
constexprnoexcept

The SoA width W (points per PointSoAT group) that fills one SIMD register for type T under the compiler's SIMD flags.

Opt-in, for host-only code:

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

The value depends on the flags each translation unit is compiled with, so a type spelled with it can mean different types in different files, and different layouts in the host and device passes of one CUDA or HIP compile. Never use it for a type that is shared with device code or with another translation unit built with different flags; use DefaultWidth<T>() there.

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