Mono.Simd 2.0.0.0 System.Object Methods to probe for SIMD support.

Helper methods used to probe for features in the SIMD runtime.

Sometimes it is desirable to write code in more than way to take advantage or features available only on recent machines. This class provides the required introspection capabilities to have such thing detected at runtime.

The following example shows how to detect the feature set and conditionally generate the right code.

`using System; using Mono.Simd; public class SampleRuntimeDetection { static bool MinimalSimdSupport () { return SimdRuntime.IsMethodAccelerated (typeof (Vector4f), "op_Addition") && SimdRuntime.IsMethodAccelerated (typeof (Vector4f), "op_Multiply") && SimdRuntime.IsMethodAccelerated (typeof (VectorOperations), "Shuffle", typeof (Vector4f), typeof (ShuffleSel)); } static bool EnhancedSimdSupport () { return SimdRuntime.IsMethodAccelerated (typeof (VectorOperations), "HorizontalAdd", typeof (Vector4f), typeof (Vector4f)) && SimdRuntime.IsMethodAccelerated (typeof (Vector4f), "op_Multiply"); } static readonly bool basic_support = MinimalSimdSupport (); static readonly bool enhanced_support = EnhancedSimdSupport (); public static float DotProduct (ref Vector4f a, ref Vector4f b) { if (enhanced_support) { Vector4f prod = a * b; prod = prod.HorizontalAdd (prod); prod = prod.HorizontalAdd (prod); return prod.X; } else if (basic_support) { Vector4f prod = a * b; prod += prod.Shuffle (ShuffleSel.XFromZ | ShuffleSel.YFromW); prod += prod.Shuffle (ShuffleSel.XFromY); return prod.X; } else { return a.X * b.X + a.Y * b.Y + a.Z * b.Z + a.W * b.W; } } public static void Main () { Vector4f x = new Vector4f (1, 2, 3, 1); Vector4f y = new Vector4f (5, 6, 7, 1); float res = DotProduct (ref x, ref y); Console.WriteLine ("Dot product of {0} . {1} is {2}", x, y, res); } }`
- Property
  2.0.0.0
  Mono.Simd.AccelMode The acceleration mode supported in this system. This value returns the acceleration mode supported in the current configuration. The value is AccelMode.None on systems without SIMD support or runtimes without SIMD support (like .NET) .
- Method
  2.0.0.0
  System.Boolean `` `` could not be found on The type to lookup, a Type from Mono.Simd. The name of the method. Returns true if the specified method is accelerated on this platform. True if the method is accelerated. The method name must be the full name, for example the C# operator + is actually encoded as op_Addition. You must use the underlying name for this lookup.
- Method
  2.0.0.0
  System.Boolean `` `` `System.ParamArray` with could not be found on The type to lookup, a Type from Mono.Simd. The name of the method. The signature for the method. Returns true if the specified method is accelerated on this platform. True if the method is accelerated. The method name must be the full name, for example the C# operator + is actually encoded as op_Addition. You must use the underlying name for this lookup.
- Method
  2.0.0.0
  Mono.Simd.AccelMode `` was . To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  Mono.Simd.AccelMode `` `` could not be found on The type to lookup, a Type from Mono.Simd. The name of the method. Returns the acceleration mode for a method. An AccelMode that describes the conditions required for the method to be hardware accelerated. The method name must be the full name, for example the C# operator + is actually encoded as op_Addition. You must use the underlying name for this lookup.
- Method
  2.0.0.0
  Mono.Simd.AccelMode `` `` `System.ParamArray` with could not be found on The type to lookup, a Type from Mono.Simd. The name of the method. Type parameters for the method to lookup. Returns the acceleration mode for a method. An AccelMode that describes the conditions required for the method to be hardware accelerated. The method name must be the full name, for example the C# operator + is actually encoded as op_Addition. You must use the underlying name for this lookup.