https://github.com/deepakkumar1984/openblas.net
OpenBLAS is an open source implementation of the BLAS (Basic Linear Algebra Subprograms) API with many hand-crafted optimizations for specific processor types.
https://github.com/deepakkumar1984/openblas.net
blas complex complex-numbers linear-algebra maths openblas
Last synced: about 2 months ago
JSON representation
OpenBLAS is an open source implementation of the BLAS (Basic Linear Algebra Subprograms) API with many hand-crafted optimizations for specific processor types.
- Host: GitHub
- URL: https://github.com/deepakkumar1984/openblas.net
- Owner: deepakkumar1984
- License: bsd-3-clause
- Created: 2019-08-15T05:08:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-15T06:42:14.000Z (about 6 years ago)
- Last Synced: 2025-08-20T22:16:20.900Z (about 2 months ago)
- Topics: blas, complex, complex-numbers, linear-algebra, maths, openblas
- Language: C#
- Homepage: https://deepakkumar1984.github.io/OpenBLAS.NET/
- Size: 6.28 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenBLAS.NET
OpenBLAS.NET is a CSharp binding of OpenBLAS library: https://www.openblas.net/
In scientific computing, OpenBLAS is an open source implementation of the BLAS (Basic Linear Algebra Subprograms) API with many hand-crafted optimizations for specific processor types. It is developed at the Lab of Parallel Software and Computational Science, ISCAS.
Documentation: https://deepakkumar1984.github.io/OpenBLAS.NET/
## Nuget
Install from nuget: https://www.nuget.org/packages/OpenBLAS.NET
```
Install-Package OpenBLAS.NET
``````
dotnet add package OpenBLAS.NET
```## Example Dot Operation
```csharp
static Array Dot(float[,] a, float[,] b, float alpha, float beta)
{
unsafe
{
int m = 2;
int k = 3;
int n = 2;
int lda = 2;
int ldb = 3;
int ldc = 2;
float[,] c = new float[m, n];sbyte nta = (sbyte)BlasOp.NonTranspose;
BLAS.Sgemm(&nta, &nta, ref m, ref n, ref k, ref alpha, ref a[0, 0], ref lda, ref b[0, 0], ref ldb, ref beta, ref c[0, 0], ref ldc);return c;
}
}
```Invoke the function:
```csharp
static void Main(string[] args)
{
int num_threads = 2;BLAS.OpenblasSetNumThreads(ref num_threads);
float[,] a = new float[,] { { 1, 2 }, { 3, 4 }, { 5, 6 } };
float[,] b = new float[,] { { 2, 2, 2}, { 3, 3, 3 } };
var c = Dot(a, b, 1, 0);Console.ReadLine();
}
```