Class AdvancedSimdPatterns
- Namespace
- DotCompute.Backends.CPU.Kernels
- Assembly
- DotCompute.Backends.CPU.dll
Advanced SIMD patterns for high-performance scientific computing. Implements patterns from the SIMD Playbook for .NET 9 with Native AOT.
public static class AdvancedSimdPatterns
- Inheritance
-
AdvancedSimdPatterns
- Inherited Members
Methods
ConditionalSelect(ReadOnlySpan<float>, ReadOnlySpan<float>, ReadOnlySpan<float>, Span<float>, float)
Performs masked SIMD operation (conditional selection) using AVX-512 or blending.
public static void ConditionalSelect(ReadOnlySpan<float> condition, ReadOnlySpan<float> trueValues, ReadOnlySpan<float> falseValues, Span<float> result, float threshold = 0)
Parameters
conditionReadOnlySpan<float>trueValuesReadOnlySpan<float>falseValuesReadOnlySpan<float>resultSpan<float>thresholdfloat
DotProduct(ReadOnlySpan<float>, ReadOnlySpan<float>)
Performs vectorized dot product of two arrays with platform-optimal SIMD.
public static float DotProduct(ReadOnlySpan<float> a, ReadOnlySpan<float> b)
Parameters
aReadOnlySpan<float>bReadOnlySpan<float>
Returns
GatherFloat32(ReadOnlySpan<float>, ReadOnlySpan<int>, Span<float>)
Advanced gather operation for sparse/indirect memory access patterns. Uses AVX2 gather when available, falls back to scalar.
public static void GatherFloat32(ReadOnlySpan<float> source, ReadOnlySpan<int> indices, Span<float> destination)
Parameters
sourceReadOnlySpan<float>indicesReadOnlySpan<int>destinationSpan<float>
L2Norm(ReadOnlySpan<float>)
Computes L2 norm (Euclidean norm) of a vector using SIMD.
public static float L2Norm(ReadOnlySpan<float> vector)
Parameters
vectorReadOnlySpan<float>
Returns
VectorSum(ReadOnlySpan<float>)
Performs vectorized reduction (sum) with platform-optimal SIMD.
public static float VectorSum(ReadOnlySpan<float> vector)
Parameters
vectorReadOnlySpan<float>