Browse Source

Drop managed reference linear algebra provider

dependabot/nuget/NUnit3TestAdapter-4.2.0
Christoph Ruegg 5 years ago
parent
commit
5a33bada11
  1. 6
      src/Benchmark/LinearAlgebra/DenseVector.cs
  2. 7
      src/Numerics/Control.cs
  3. 3
      src/Numerics/Providers/LinearAlgebra/LinearAlgebraControl.cs
  4. 2816
      src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex.cs
  5. 2819
      src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex32.cs
  6. 2724
      src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Double.cs
  7. 2729
      src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Single.cs
  8. 66
      src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.cs

6
src/Benchmark/LinearAlgebra/DenseVector.cs

@ -27,14 +27,13 @@ namespace Benchmark.LinearAlgebra
public enum ProviderId public enum ProviderId
{ {
Managed, Managed,
ManagedReference,
NativeMKL, NativeMKL,
} }
[Params(4, 32, 128, 4096, 16384, 524288)] [Params(4, 32, 128, 4096, 16384, 524288)]
public int N { get; set; } public int N { get; set; }
[Params(ProviderId.Managed, ProviderId.ManagedReference)] //, ProviderId.NativeMKL)] [Params(ProviderId.Managed)] //, ProviderId.NativeMKL)]
public ProviderId Provider { get; set; } public ProviderId Provider { get; set; }
double[] _a; double[] _a;
@ -52,9 +51,6 @@ namespace Benchmark.LinearAlgebra
case ProviderId.Managed: case ProviderId.Managed:
Control.UseManaged(); Control.UseManaged();
break; break;
case ProviderId.ManagedReference:
Control.UseManagedReference();
break;
case ProviderId.NativeMKL: case ProviderId.NativeMKL:
MklControl.UseNativeMKL(MklConsistency.Auto, MklPrecision.Double, MklAccuracy.High); MklControl.UseNativeMKL(MklConsistency.Auto, MklPrecision.Double, MklAccuracy.High);
break; break;

7
src/Numerics/Control.cs

@ -74,13 +74,6 @@ namespace MathNet.Numerics
SparseSolverControl.UseManaged(); SparseSolverControl.UseManaged();
} }
public static void UseManagedReference()
{
LinearAlgebraControl.UseManagedReference();
FourierTransformControl.UseManaged();
SparseSolverControl.UseManaged();
}
/// <summary> /// <summary>
/// Use a specific provider if configured, e.g. using /// Use a specific provider if configured, e.g. using
/// environment variables, or fall back to the best providers. /// environment variables, or fall back to the best providers.

3
src/Numerics/Providers/LinearAlgebra/LinearAlgebraControl.cs

@ -88,9 +88,6 @@ namespace MathNet.Numerics.Providers.LinearAlgebra
public static ILinearAlgebraProvider CreateManaged() => new Managed.ManagedLinearAlgebraProvider(); public static ILinearAlgebraProvider CreateManaged() => new Managed.ManagedLinearAlgebraProvider();
public static void UseManaged() => Provider = CreateManaged(); public static void UseManaged() => Provider = CreateManaged();
internal static ILinearAlgebraProvider CreateManagedReference() => new ManagedReference.ManagedReferenceLinearAlgebraProvider();
internal static void UseManagedReference() => Provider = CreateManagedReference();
public static void UseNativeMKL() => Provider = MklProbe.Create(); public static void UseNativeMKL() => Provider = MklProbe.Create();
public static bool TryUseNativeMKL() => TryUse(MklProbe.TryCreate()); public static bool TryUseNativeMKL() => TryUse(MklProbe.TryCreate());

2816
src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex.cs

File diff suppressed because it is too large

2819
src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Complex32.cs

File diff suppressed because it is too large

2724
src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Double.cs

File diff suppressed because it is too large

2729
src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.Single.cs

File diff suppressed because it is too large

66
src/Numerics/Providers/LinearAlgebra/ManagedReference/ManagedReferenceLinearAlgebraProvider.cs

@ -1,66 +0,0 @@
// <copyright file="ManagedReferenceLinearAlgebraProvider.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
//
// Copyright (c) 2009-2020 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
namespace MathNet.Numerics.Providers.LinearAlgebra.ManagedReference
{
/// <summary>
/// The managed linear algebra provider.
/// </summary>
internal partial class ManagedReferenceLinearAlgebraProvider : ILinearAlgebraProvider
{
/// <summary>
/// Try to find out whether the provider is available, at least in principle.
/// Verification may still fail if available, but it will certainly fail if unavailable.
/// </summary>
public virtual bool IsAvailable()
{
return true;
}
/// <summary>
/// Initialize and verify that the provided is indeed available. If not, fall back to alternatives like the managed provider
/// </summary>
public virtual void InitializeVerify()
{
}
/// <summary>
/// Frees memory buffers, caches and handles allocated in or to the provider.
/// Does not unload the provider itself, it is still usable afterwards.
/// </summary>
public virtual void FreeResources()
{
}
public override string ToString()
{
return "Managed";
}
}
}
Loading…
Cancel
Save