11#ifndef EBGEOMETRY_POINTSOA_HPP
12#define EBGEOMETRY_POINTSOA_HPP
19#if defined(__SSE4_1__) || defined(__AVX__) || defined(__AVX512F__)
50[[nodiscard]]
constexpr size_t
53 static_assert(std::is_floating_point_v<T>,
"EBGeometry::PointSoA::DefaultWidth requires a floating-point T");
76[[nodiscard]]
constexpr size_t
79 static_assert(std::is_floating_point_v<T>,
"EBGeometry::PointSoA::HostWidth requires a floating-point T");
80#if defined(__AVX512F__)
81 if constexpr (std::is_same_v<T, double>) {
88 if constexpr (std::is_same_v<T, double>) {
126template <class T, size_t W = PointSoA::DefaultWidth<T>()>
129 static_assert(W > 0,
"W must be positive");
130 static_assert(std::is_floating_point_v<T>,
"PointSoAT requires a floating-point type T");
242 alignas(W *
sizeof(T)) T
m_x[W];
263static_assert(std::is_trivially_copyable_v<PointSoAT<float>>,
"PointSoAT<float> must be trivially copyable");
264static_assert(std::is_trivially_copyable_v<PointSoAT<double>>,
"PointSoAT<double> must be trivially copyable");
268#include "EBGeometry_PointSoAImplem.hpp"
A fixed-size array that compiles for both host and device.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
constexpr size_t HostWidth() noexcept
The SoA width W (points per PointSoAT group) that fills one SIMD register for type T under the compil...
Definition EBGeometry_PointSoA.hpp:77
constexpr size_t DefaultWidth() noexcept
The default SoA width W (points per PointSoAT group): 4, for both float and double,...
Definition EBGeometry_PointSoA.hpp:51
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Fixed-size array with host- and device-callable members.
Definition EBGeometry_Array.hpp:33
True SoA (Structure of Arrays) layout for W point positions, enabling SIMD distance evaluation agains...
Definition EBGeometry_PointSoA.hpp:128
BV computeBoundingVolume() const noexcept
Compute the bounding volume enclosing all valid positions in this group.
T m_z[W]
z-coordinates of point positions.
Definition EBGeometry_PointSoA.hpp:252
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.
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 > getDistances(const Vec3T< T > &a_point) const noexcept
Unsigned distances from a_point to every one of the W lane positions.
T getMaximumDistance2(const Vec3T< T > &a_point) const noexcept
Largest squared unsigned distance from a_point to the farthest position in this group.
T getMinimumDistance2(const Vec3T< T > &a_point) const noexcept
Shortest squared unsigned distance from a_point to the closest 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.
uint32_t numValid() const noexcept
Number of real (non-padded) positions in this group.
Definition EBGeometry_PointSoA.hpp:233
T m_y[W]
y-coordinates of point positions.
Definition EBGeometry_PointSoA.hpp:247
uint32_t m_validCount
Number of valid (non-padded) positions in this group (1..W).
Definition EBGeometry_PointSoA.hpp:260
T m_x[W]
x-coordinates of point positions. m_x[j] = x-coord of point j.
Definition EBGeometry_PointSoA.hpp:242
T getMinimumDistance(const Vec3T< T > &a_point) const noexcept
Shortest unsigned distance from a_point to the closest position in this group.