BlasSharp.Shared 0.1.1

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlasSharp.Shared" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlasSharp.Shared" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="BlasSharp.Shared" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlasSharp.Shared --version 0.1.1
                    
#r "nuget: BlasSharp.Shared, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=BlasSharp.Shared&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=BlasSharp.Shared&version=0.1.1
                    
Install as a Cake Tool

BlasSharp

BLAS/LAPACK bindings for .NET (OpenBLAS, MKL, Apple Accelerate)

Releases
GitHub license

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

NuGet

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

NuGet

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)

NuGet

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
0.2.0 166 5/20/2025
0.1.1 144 5/9/2025
0.1.0 218 4/14/2025