什么是适用于 .net (C#) 的优秀免费(开源)BLAS/LAPACK 库?

发布于 2024-08-04 19:44:43 字数 1539 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

甜心小果奶 2024-08-11 19:44:43

AMD 的 ACML 可以免费下载,但它只是二进制文件,不是开源的,并且是本机代码,而不是 .NET。

性能通常优于 Netlib.org 代码,并且通常与 Intel 的 MKL 大致相同——它不是免费的 IIRC。

下载包含一个示例,演示如何将其绑定到 C#。与从 C# 调用任何其他 C 或 C++ 库没有任何不同。

库实现了 BLAS、LAPACK、FFT 和 RNG。

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

编辑回复评论:

在 Intel CPU 上,AMD 的 ACML 的性能大约与 Intel 的 MKL 一样,但这取决于算法、矩阵大小、核心数量、内存拓扑和速度等。您的情况可能会有所不同。唯一可以确定的方法是运行您自己的基准测试。在某些情况下,即使在 Itel 硬件上,ACML 也比 MKL 更快。

任何一种方法都比大型矩阵的任何“简单”实现要快得多。两者都被设计为在多核处理器上使用多个线程,并且具有手动调整的汇编语言内核以及对各种机器上的缓存行为的大量调整。

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

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.

一场信仰旅途 2024-08-11 19:44:43

数学库 DotNumerics 是用 C# 编写的免费/开源项目,包含 Lapack、Blas 和 Eispack 的翻译C#。

The math library DotNumerics is free/open source project written in C# and contains the translation of Lapack, Blas, and Eispack to C#.

终难愈 2024-08-11 19:44:43

类似 BLIS 的库实例化软件 (BLIS) 是开源 BLAS 库当前的黄金标准。 https://github.com/flame/blis 它不如 MKL 快(尽管接近)但在几乎所有 CPU 上都比 OpenBLAS(传说中的 GotoBLAS 的一个分支)更快(在包括 Intel、AMD 和 ARM 在内的最新架构上更快)。它维护得很好。

另一个答案中提到的 ACML 已不存在。 AMD 现在使用开源软件作为其 ACL(AMD 计算库)软件堆栈的一部分。 BLIS 是该软件堆栈的一部分: https://developer.amd .com/amd-cpu-libraries/blas-library/

Caviat:海报是 BLIS 项目的一部分。上述说法有据可查。

(后来添加的评论:没有注意到“.NET”。不幸的是 Windows 还没有很好地支持 BLIS。)

The BLIS-like Library Instantiation Software (BLIS) is the current gold standard for open source BLAS libraries. https://github.com/flame/blis It is not as fast as MKL (although close) but faster than OpenBLAS, a fork of the legendary GotoBLAS, on essentially all CPUs (and much faster on the latest architectures including Intel, AMD, and ARM). It is well maintained.

ACML, mentioned in another answer, no longer exists. AMD now uses open source software as part of their ACL (AMD Compute Library) software stack. BLIS is what is part of that software stack: https://developer.amd.com/amd-cpu-libraries/blas-library/.

Caviat: poster is part of the BLIS project. The above claims are well-documented.

(Comment added later: Didn't notice the ".NET". Unfortunately BLIS is not yet supported well for Windows.)

指尖微凉心微凉 2024-08-11 19:44:43

Lutz Roeder 有一个很好的开源端口 Mapack.Net

过去用于各种项目,发现了它愿意合作

Lutz Roeder has a good open source port Mapack.Net

Used in the past for various projects and found it eary to work with

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文