![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
SIMD abstraction layer for vectorized arithmetic operations. More...
#include <cstddef>#include <cmath>#include <algorithm>#include <cassert>Go to the source code of this file.
Namespaces | |
| namespace | openswmm |
| namespace | openswmm::simd |
| namespace | openswmm::fastmath |
Macros | |
| #define | OPENSWMM_RESTRICT __restrict__ |
| #define | OPENSWMM_IVDEP |
| #define | OPENSWMM_SIMD_SCALAR 1 |
| #define | OPENSWMM_SIMD_WIDTH 1 |
| Scalar fallback. | |
Functions | |
| void | openswmm::simd::add (const double *OPENSWMM_RESTRICT a, const double *OPENSWMM_RESTRICT b, double *OPENSWMM_RESTRICT dst, std::size_t n) noexcept |
| Compute dst[i] = a[i] + b[i] over n doubles. | |
| void | openswmm::simd::multiply (const double *OPENSWMM_RESTRICT a, const double *OPENSWMM_RESTRICT b, double *OPENSWMM_RESTRICT dst, std::size_t n) noexcept |
| Compute dst[i] = a[i] * b[i] over n doubles. | |
| double | openswmm::simd::min (const double *a, std::size_t n) noexcept |
| Reduce an array to its minimum value. | |
| double | openswmm::simd::max (const double *a, std::size_t n) noexcept |
| Reduce an array to its maximum value. | |
| void | openswmm::simd::clamp (double *a, double lo, double hi, std::size_t n) noexcept |
| Clamp each array element in place to an inclusive interval. | |
| double | openswmm::simd::dot (const double *OPENSWMM_RESTRICT a, const double *OPENSWMM_RESTRICT b, std::size_t n) noexcept |
| Sum corresponding products from two arrays. | |
| constexpr std::size_t | openswmm::simd::lane_width () noexcept |
| Report the compile-time number of doubles per SIMD register. | |
| void | openswmm::simd::sqrt_array (const double *OPENSWMM_RESTRICT a, double *OPENSWMM_RESTRICT dst, std::size_t n) noexcept |
| Compute dst[i] = sqrt(a[i]) over n doubles. | |
| void | openswmm::simd::fabs_array (const double *OPENSWMM_RESTRICT a, double *OPENSWMM_RESTRICT dst, std::size_t n) noexcept |
| Compute dst[i] = fabs(a[i]) over n doubles. | |
| void | openswmm::simd::fma_array (const double *OPENSWMM_RESTRICT a, const double *OPENSWMM_RESTRICT b, const double *OPENSWMM_RESTRICT c, double *OPENSWMM_RESTRICT dst, std::size_t n) noexcept |
| Compute dst[i] = a[i] * b[i] + c[i] over n doubles. | |
| double | openswmm::fastmath::pow3_2 (double x) noexcept |
| Compute the real 3/2 power using square or cube roots. | |
| double | openswmm::fastmath::pow5_2 (double x) noexcept |
| Compute the real 5/2 power using square or cube roots. | |
| double | openswmm::fastmath::pow5_3 (double x) noexcept |
| Compute the real 5/3 power using square or cube roots. | |
| double | openswmm::fastmath::pow4_3 (double x) noexcept |
| Compute the real 4/3 power using square or cube roots. | |
| double | openswmm::fastmath::pow2_3 (double x) noexcept |
| Compute the real 2/3 power using square or cube roots. | |
SIMD abstraction layer for vectorized arithmetic operations.
Provides a platform-neutral interface over:
The goal is to express numerical loops in a way that the compiler can vectorize, with explicit SIMD intrinsics as hints for the most performance-critical paths.
Do NOT pepper the solver code with raw intrinsics. Instead:
| #define OPENSWMM_IVDEP |
| #define OPENSWMM_RESTRICT __restrict__ |
| #define OPENSWMM_SIMD_SCALAR 1 |
| #define OPENSWMM_SIMD_WIDTH 1 |
Scalar fallback.