mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-12 15:48:05 +00:00
more volatilty
This commit is contained in:
@@ -174,6 +174,19 @@ public static class SimdExtensions
|
||||
return ContainsNonFiniteScalar(span);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates sum using SIMD vectorization when available.
|
||||
/// 4-8x faster than scalar loop on AVX2/AVX-512 hardware.
|
||||
/// Returns NaN if any input value is non-finite.
|
||||
/// Uses lazy non-finite check: computes sum first, then validates result.
|
||||
/// If result is non-finite, falls back to explicit check.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static double SumSIMD(this Span<double> span)
|
||||
{
|
||||
return SumSIMD((ReadOnlySpan<double>)span);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates sum using SIMD vectorization when available.
|
||||
/// 4-8x faster than scalar loop on AVX2/AVX-512 hardware.
|
||||
|
||||
Reference in New Issue
Block a user