Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Namespaces | Classes | Enumerations | Functions
srfm::simd Namespace Reference

Namespaces

namespace  detail
 

Classes

class  BetaCalculator
 Stateful wrapper around computeBetaBatch / computeGammaBatch. More...
 
struct  SimdGammaCompute
 Internal factory helper for constructing LorentzFactor objects from pre-computed gamma scalars (friend of LorentzFactor). More...
 

Enumerations

enum class  SimdLevel : std::uint8_t { SCALAR = 0 , SSE42 = 1 , AVX2 = 2 , AVX512F = 3 }
 Ordered enumeration of SIMD capability tiers. More...
 

Functions

std::vector< srfm::momentum::BetaVelocity > computeBetaBatch (const std::vector< double > &velocities, double &running_max) noexcept
 
std::vector< srfm::momentum::LorentzFactor > computeGammaBatch (const std::vector< srfm::momentum::BetaVelocity > &betas) noexcept
 Compute γ_i = 1/√(1 − β_i²) for every element.
 
SimdLevel detect_simd_level () noexcept
 
bool has_avx512f () noexcept
 Returns true when AVX-512F is available on this CPU/OS.
 
bool has_avx2 () noexcept
 Returns true when AVX2 is available on this CPU/OS.
 
bool has_sse42 () noexcept
 Returns true when SSE 4.2 is available on this CPU/OS.
 
const char * simd_level_name (SimdLevel level) noexcept
 Human-readable name for a SimdLevel value.
 

Enumeration Type Documentation

◆ SimdLevel

enum class srfm::simd::SimdLevel : std::uint8_t
strong

Ordered enumeration of SIMD capability tiers.

Compare with < / <= to check "at least this level":

@ AVX2
AVX2 — 256-bit; 4 doubles per YMM register.
SimdLevel detect_simd_level() noexcept
Enumerator
SCALAR 

No SIMD; pure scalar C++ path.

SSE42 

SSE 4.2 — 128-bit; 2 doubles per YMM half.

AVX2 

AVX2 — 256-bit; 4 doubles per YMM register.

AVX512F 

AVX-512F — 512-bit; 8 doubles per ZMM register.

Examples
/home/runner/work/Special-Relativity-in-Financial-Modeling/Special-Relativity-in-Financial-Modeling/include/srfm/simd/cpu_features.hpp, and /home/runner/work/Special-Relativity-in-Financial-Modeling/Special-Relativity-in-Financial-Modeling/include/srfm/simd/simd_dispatch.hpp.

Definition at line 59 of file cpu_features.hpp.

Function Documentation

◆ computeBetaBatch()

std::vector< srfm::momentum::BetaVelocity > srfm::simd::computeBetaBatch ( const std::vector< double > &  velocities,
double &  running_max 
)
noexcept

◆ computeGammaBatch()

std::vector< srfm::momentum::LorentzFactor > srfm::simd::computeGammaBatch ( const std::vector< srfm::momentum::BetaVelocity > &  betas)
noexcept

Compute γ_i = 1/√(1 − β_i²) for every element.

Inputs are clamped to [0, BETA_MAX_SAFE) before the sqrt to prevent NaN. SIMD kernel processes 8 (AVX-512) or 4 (AVX2) elements per cycle.

Parameters
betasValidated BetaVelocity values from computeBetaBatch().
Returns
One LorentzFactor per input beta, in order. Empty vector when betas is empty.

Panics

This function never panics.

Examples
/home/runner/work/Special-Relativity-in-Financial-Modeling/Special-Relativity-in-Financial-Modeling/include/srfm/simd/simd_dispatch.hpp.

Definition at line 119 of file simd_dispatch.cpp.

◆ detect_simd_level()

SimdLevel srfm::simd::detect_simd_level ( )
inlinenoexcept

◆ has_avx2()

bool srfm::simd::has_avx2 ( )
inlinenoexcept

◆ has_avx512f()

bool srfm::simd::has_avx512f ( )
inlinenoexcept

◆ has_sse42()

bool srfm::simd::has_sse42 ( )
inlinenoexcept

◆ simd_level_name()

const char * srfm::simd::simd_level_name ( SimdLevel  level)
inlinenoexcept