/// <summary> /// Try to use the Intel MKL native provider for linear algebra. /// </summary> /// <returns> /// True if the provider was found and initialized successfully. /// False if it failed and the previous provider is still active. /// </returns> public static bool TryUseNativeMKL() { bool linearAlgebra = LinearAlgebraControl.TryUseNativeMKL(); bool fourierTransform = FourierTransformControl.TryUseNativeMKL(); return(linearAlgebra || fourierTransform); }
public void ProviderMatchesManagedProviderArbitraryLarge64() { // 30870 = 2*3*3*5*7*7*7 var samples = Generate.RandomComplex(30870, GetUniform(1)); Verify(samples, 10, FourierTransformScaling.NoScaling, FourierTransformControl.CreateManaged().Forward, FourierTransformControl.Provider.Forward); }
public void ProviderMatchesManagedProviderPowerOfTwoLarge64() { // 65536 = 2^16 var samples = Generate.RandomComplex(65536, GetUniform(1)); Verify(samples, 10, FourierTransformScaling.NoScaling, FourierTransformControl.CreateManaged().Forward, FourierTransformControl.Provider.Forward); }
public static void UseNativeMKL( Providers.Common.Mkl.MklConsistency consistency = Providers.Common.Mkl.MklConsistency.Auto, Providers.Common.Mkl.MklPrecision precision = Providers.Common.Mkl.MklPrecision.Double, Providers.Common.Mkl.MklAccuracy accuracy = Providers.Common.Mkl.MklAccuracy.High) { LinearAlgebraControl.UseNativeMKL(consistency, precision, accuracy); FourierTransformControl.UseNativeMKL(); }
/// <summary> /// Try to use the Intel MKL native provider for linear algebra. /// </summary> /// <returns> /// True if the provider was found and initialized successfully. /// False if it failed and the previous provider is still active. /// </returns> public static bool TryUseNativeMKL() { bool linearAlgebra = LinearAlgebraControl.TryUseNativeMKL(); bool fourierTransform = FourierTransformControl.TryUseNativeMKL(); bool directSparseSolver = SparseSolverControl.TryUseNativeMKL(); return(linearAlgebra || fourierTransform || directSparseSolver); }
/// <summary> /// Use the best provider available. /// </summary> public static void UseBestProviders() { if (AppSwitches.DisableNativeProviders || AppSwitches.DisableNativeProviderProbing) { UseManaged(); return; } LinearAlgebraControl.UseBest(); FourierTransformControl.UseBest(); SparseSolverControl.UseBest(); }
/// <summary> /// Try to use any available native provider in an undefined order. /// </summary> /// <returns> /// True if one of the native providers was found and successfully initialized. /// False if it failed and the previous provider is still active. /// </returns> public static bool TryUseNative() { if (AppSwitches.DisableNativeProviders || AppSwitches.DisableNativeProviderProbing) { return(false); } bool linearAlgebra = LinearAlgebraControl.TryUseNative(); bool fourierTransform = FourierTransformControl.TryUseNative(); bool directSparseSolver = SparseSolverControl.TryUseNative(); return(linearAlgebra || fourierTransform || directSparseSolver); }
public void ProviderSurvivesFreeResources() { var samples = Generate.PeriodicMap(16, w => new Complex(Math.Sin(w), 0), 16, 1.0, Constants.Pi2); var spectrum1 = new Complex[samples.Length]; samples.Copy(spectrum1); FourierTransformControl.Provider.Forward(spectrum1, FourierTransformScaling.ForwardScaling); FourierTransformControl.FreeResources(); var spectrum2 = new Complex[samples.Length]; samples.Copy(spectrum2); FourierTransformControl.Provider.Forward(spectrum2, FourierTransformScaling.ForwardScaling); for (var i = 0; i < spectrum1.Length; i++) { Assert.AreEqual(spectrum1[i], spectrum2[i]); } }
/// <summary> /// Use the Intel MKL native provider for linear algebra. /// Throws if it is not available or failed to initialize, in which case the previous provider is still active. /// </summary> public static void UseNativeMKL() { LinearAlgebraControl.UseNativeMKL(); FourierTransformControl.UseNativeMKL(); }
public static bool TryUseNativeMKL() => FourierTransformControl.TryUse(CreateNativeMKL());
/// <summary> /// Use the best provider available. /// </summary> public static void UseBestProviders() { LinearAlgebraControl.UseBest(); FourierTransformControl.UseBest(); }
public static void UseManagedReference() { LinearAlgebraControl.UseManagedReference(); FourierTransformControl.UseManaged(); }
public static void FreeResources() { LinearAlgebraControl.FreeResources(); FourierTransformControl.FreeResources(); }
public static void UseManaged() { LinearAlgebraControl.UseManaged(); FourierTransformControl.UseManaged(); SparseSolverControl.UseManaged(); }
public void ProviderMatchesManagedProviderArbitraryLarge32_GH286() { var samples = Generate.RandomComplex32(46500, GetUniform(1)); Verify(samples, 5, FourierTransformScaling.NoScaling, FourierTransformControl.CreateManaged().Forward, FourierTransformControl.Provider.Forward); }
static ProgressDlg() { FFT = FourierTransformControl.CreateManaged(); }