Class SimdThresholds
Minimum element counts for SIMD to be beneficial. Below these thresholds, the overhead of SIMD setup may exceed the benefits. Based on Vector256 (32 bytes) width.
public static class SimdThresholds
- Inheritance
-
SimdThresholds
- Inherited Members
Fields
Byte
Minimum elements for byte (32 per Vector256).
public const int Byte = 64
Field Value
Double
Minimum elements for Double (4 per Vector256) - conservative.
public const int Double = 512
Field Value
Int16
Minimum elements for Int16/UInt16 (16 per Vector256).
public const int Int16 = 64
Field Value
Int32
Minimum elements for Int32/UInt32/Single (8 per Vector256).
public const int Int32 = 96
Field Value
Int64
Minimum elements for Int64/UInt64/Double (4 per Vector256).
public const int Int64 = 256
Field Value
MemoryBound
Size above which memory bandwidth dominates and SIMD speedup diminishes. At very large sizes, we're limited by memory bandwidth, not compute.
public const int MemoryBound = 10000000
Field Value
Single
Minimum elements for Single (8 per Vector256).
public const int Single = 96
Field Value
Methods
GetThreshold(NPTypeCode)
Get the minimum threshold for a given NPTypeCode.
public static int GetThreshold(NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
ShouldUseSIMD(NPTypeCode, int)
Returns true if the array size is above the SIMD threshold for the given type.
public static bool ShouldUseSIMD(NPTypeCode typeCode, int size)
Parameters
typeCodeNPTypeCodesizeint