什么是.net(C#)好的免费(开源)BLAS/LAPACK库? [英] What is a good free (open source) BLAS/LAPACK library for .net (C#)?

查看:131
本文介绍了什么是.net(C#)好的免费(开源)BLAS/LAPACK库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用C#编写的项目,我需要在矩阵上进行各种线性代数运算(例如LU分解).

由于该程序主要是为确认理论而创建的原型,因此C#实现就足够了(与可能更快的C ++实现相比),但是我仍然希望有一个好的BLAS或LAPACK库可以为我节省一些编码.

长话短说,有人可以推荐使用.net的免费/开源BLAS或LAPACK库吗?

最诚挚的问候Egil.

更新:今天发现了 Math.NET数值,看起来很有趣,有人对此有任何经验吗?

解决方案

AMD的ACML是免费下载的,但它仅是二进制文件,不是开源的,并且是本机代码,不是.NET. /p>

性能通常优于Netlib.org代码,并且通常与英特尔的MKL大致相同,后者不是免费的IIRC.

下载内容包括一个示例,该示例演示了如何将其绑定到C#.与从C#调用任何其他C或C ++库没有什么不同.

库可实现BLAS,LAPACK,FFT和RNG.

http://developer.amd.com/cpu/库/acml/downloads/pages/default.aspx

编辑以评论:

在Intel CPU上,AMD的ACML和Intel的MKL大约会执行 ,但这取决于算法,矩阵大小,内核数,内存拓扑和速度等,等等. . 你的旅费可能会改变.唯一可以肯定的方法是运行自己的基准测试.在某些情况下,即使在Itel硬件上,ACML也比MKL快.

对于大型矩阵,任何一种都比任何幼稚"的实现都要快得多.两者都设计为在多核处理器上使用多个线程,并且具有经过手动调整的汇编语言内核以及针对各种计算机上的缓存行为进行的大量调整.

对于小型矩阵,性能通常是无关紧要的,因为任何现代cpu都可以在短短的几毫秒内解决小型Matix,即使使用最简单的代码也是如此.在这种情况下,您只是在使用一个库来避免编写和调试已经编写了数百次的代码.

I have a project written in C# where I need to do various linear algebraic operations on matrices (like LU-factorization).

Since the program is mainly a prototype created to confirm a theory, a C# implementation will suffice (compared to a possibly speedier C++ one), but I would still like a good BLAS or LAPACK library available to save me some coding.

Long story short, can anybody recommend a free/open source BLAS or LAPACK library for use with .net?

Best regards Egil.

Update: Found Math.NET Numerics today, looks interesting, anybody have any experience with that?

解决方案

AMD's ACML is a free download, but it is binary only, not open source, and native code, not .NET.

Performance is generally superior to the Netlib.org code, and generally roughly the same as Intel's MKL -- which is not free IIRC.

The download includes one sample that demonstrates how to bind it to C#. Not any different from calling any other C or C++ library from C#.

Library implements BLAS, LAPACK, FFTs, and RNGs.

http://developer.amd.com/cpu/Libraries/acml/downloads/pages/default.aspx

EDIT TO RESPOND TO COMMENT:

On an Intel CPU, AMD's ACML will perform approximately as well as Intel's MKL, but it depends on the algorithm, matrix sizes, number of cores, memory topology and speed, etc. etc. etc. Your mileage may vary. The only way to tell for sure is to run your own benchmark. In some cases, ACML is faster than MKL even on Itel hardware.

Either one will be significantly faster than any "naive" implementation for large matrixes. Both are architected to use multiple threads on multicore processors, and have hand-tweaked assembly language kernels and a lot of tuning for the cache behaviours on various machines.

For small matrixes, performance is generally a don't-care, since any modern cpu can solve a small matix in just a few milliseconds, even using the simplest code. In that case, you're only using a library to avoid writing and debugging code that has been written hundreds of times already.

这篇关于什么是.net(C#)好的免费(开源)BLAS/LAPACK库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆