Wie kann ich Openblas mit MathNet.Numerics verwenden?
Posted: 27 Jan 2025, 03:29
Ich habe OpenBLAS mit Conda unter Windows installiert.
Meine package.config lautet wie folgt: ist Teil von mathNet.numerics.openblas.win , aber ich habe mich geirrt. P>
Meine package.config lautet wie folgt:
Code: Select all
< /code>
using System;
using MathNet.Numerics;
using MathNet.Numerics.Providers.LinearAlgebra;
class Program
{
static void Main()
{
// Configure MathNet to use OpenBLAS
LinearAlgebraControl.UseNativeOpenBLAS();
// Verify which provider is currently in use
Console.WriteLine($"CUDA available: {Control.TryUseNativeCUDA()}");
Console.WriteLine($"OpenBLAS available: {Control.TryUseNativeOpenBLAS()}");
Console.WriteLine($"MKL available: {Control.TryUseNativeMKL()}");
Console.WriteLine($"Current linear algebra provider: {LinearAlgebraControl.Provider}");
// Test matrix multiplication
var A = MathNet.Numerics.LinearAlgebra.Matrix.Build.Random(1000, 1000);
var B = MathNet.Numerics.LinearAlgebra.Matrix.Build.Random(1000, 1000);
var C = A * B;
Console.WriteLine($"Matrix multiplication result: {C.RowCount}x{C.ColumnCount}");
}
}
< /code>
However I am getting the following error:
System.NotSupportedException
HResult=0x80131515
Message=OpenBLAS Native Provider not found.
Source=
StackTrace:
Inner Exception 1:
DllNotFoundException: Unable to load DLL 'libMathNetNumericsOpenBLAS': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
< /code>
I thought libMathNetNumericsOpenBLAS.dll