Class SimdScalarOperations
- Namespace
- DotCompute.Backends.CPU.Kernels.Simd
- Assembly
- DotCompute.Backends.CPU.dll
Scalar operations for fallback and remainder processing in SIMD execution. Provides optimized scalar implementations when vectorization is not available or beneficial.
public static class SimdScalarOperations
- Inheritance
-
SimdScalarOperations
- Inherited Members
Methods
AddGeneric<T>(T, T)
Generic type-safe addition operation.
public static T AddGeneric<T>(T a, T b) where T : unmanaged
Parameters
aTbT
Returns
- T
Type Parameters
T
AddRemainder<T>(T*, T*, T*, long)
Optimized scalar addition with loop unrolling.
public static void AddRemainder<T>(T* ptr1, T* ptr2, T* ptrOut, long count) where T : unmanaged
Parameters
ptr1T*ptr2T*ptrOutT*countlong
Type Parameters
T
MaxFloat32(float*, int)
Gets max float32.
public static float MaxFloat32(float* data, int count)
Parameters
Returns
- float
The result of the operation.
Max<T>(ReadOnlySpan<T>)
Scalar max reduction with fallback to dynamic operations.
public static T Max<T>(ReadOnlySpan<T> input) where T : unmanaged
Parameters
inputReadOnlySpan<T>
Returns
- T
Type Parameters
T
MinFloat32(float*, int)
Gets min float32.
public static float MinFloat32(float* data, int count)
Parameters
Returns
- float
The result of the operation.
Min<T>(ReadOnlySpan<T>)
Scalar min reduction with fallback to dynamic operations.
public static T Min<T>(ReadOnlySpan<T> input) where T : unmanaged
Parameters
inputReadOnlySpan<T>
Returns
- T
Type Parameters
T
Product<T>(ReadOnlySpan<T>)
Scalar product reduction with fallback to dynamic operations.
public static T Product<T>(ReadOnlySpan<T> input) where T : unmanaged
Parameters
inputReadOnlySpan<T>
Returns
- T
Type Parameters
T
SumFloat32(float*, int)
Gets sum float32.
public static float SumFloat32(float* data, int count)
Parameters
Returns
- float
The result of the operation.
SumFloat64(double*, int)
Gets sum float64.
public static double SumFloat64(double* data, int count)
Parameters
Returns
- double
The result of the operation.
SumInt32(int*, int)
Gets sum int32.
public static int SumInt32(int* data, int count)
Parameters
Returns
- int
The result of the operation.
Sum<T>(ReadOnlySpan<T>)
Scalar sum reduction with fallback to dynamic operations.
public static T Sum<T>(ReadOnlySpan<T> input) where T : unmanaged
Parameters
inputReadOnlySpan<T>
Returns
- T
Type Parameters
T