BlasSharp.Shared
0.1.1
See the version list below for details.
dotnet add package BlasSharp.Shared --version 0.1.1
NuGet\Install-Package BlasSharp.Shared -Version 0.1.1
<PackageReference Include="BlasSharp.Shared" Version="0.1.1" />
<PackageVersion Include="BlasSharp.Shared" Version="0.1.1" />
<PackageReference Include="BlasSharp.Shared" />
paket add BlasSharp.Shared --version 0.1.1
#r "nuget: BlasSharp.Shared, 0.1.1"
#addin nuget:?package=BlasSharp.Shared&version=0.1.1
#tool nuget:?package=BlasSharp.Shared&version=0.1.1
BlasSharp
BLAS/LAPACK bindings for .NET (OpenBLAS, MKL, Apple Accelerate)
English | 日本語
Overview
BlasSharp is a library that provides bindings to BLAS/LAPACK for .NET.
BLAS/LAPACK libraries optimized for various CPUs are provided by Intel, Apple, and others. By bringing these libraries into C#, you can perform linear algebra computations with optimal performance.
This library is currently provided as an alpha version and may introduce breaking changes without notice.
Usage
You can use the bindings by installing the package that corresponds to the desired library. Below is a sample using OpenBLAS:
using BlasSharp;
using static BlasSharp.OpenBlas.NativeMethods;
unsafe
{
double[] A = [
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0
];
double[] B = [
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0,
];
double[] C = new double[9];
fixed (double* a = A, b = B, c = C)
{
cblas_dgemm(CBLAS_ORDER.CblasColMajor,
CBLAS_TRANSPOSE.CblasNoTrans,
CBLAS_TRANSPOSE.CblasNoTrans,
3, 3, 3, 1.0, a, 3, b, 3, 0.0, c, 3);
}
Console.WriteLine(string.Join(',', C));
}
OpenBLAS
You can use the OpenBLAS binaries and bindings by adding BlasSharp.OpenBlas to your project.
BlasSharp.OpenBlas supports multiple platforms:
win-x64
, osx-x64
, osx-arm64
, linux-x64
, and linux-arm64
.
.NET CLI
dotnet add package BlasSharp.OpenBlas
Package Manager
Install-Package BlasSharp.OpenBlas
MKL
You can use the bindings for Intel's MKL by adding BlasSharp.Mkl to your project.
.NET CLI
dotnet add package BlasSharp.Mkl
Package Manager
Install-Package BlasSharp.Mkl
To use MKL, you also need to install the official Intel MKL NuGet package (e.g., intelmkl.devel.win-x64
).
See the MKL download page for more details.
Accelerate (Apple)
You can use the bindings for Apple’s Accelerate framework by adding BlasSharp.AppleAccelerate to your project.
BlasSharp.AppleAccelerate currently supports only osx-arm64
.
.NET CLI
dotnet add package BlasSharp.AppleAccelerate
Package Manager
Install-Package BlasSharp.AppleAccelerate
License
This library is released under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on BlasSharp.Shared:
Package | Downloads |
---|---|
BlasSharp.AppleAccelerate
Package Description |
|
BlasSharp.OpenBlas
Package Description |
|
BlasSharp.Mkl
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.