使用 BLAS 进行整数类型的矩阵乘法

发布于 2024-08-13 12:52:08 字数 200 浏览 8 评论 0原文

对于整数类型,是否有等效的 dgemm (来自 BLAS)? 我只知道 dgemm、sgemm 用于双精度/单精度矩阵,但希望将其用于整数类型的矩阵,例如 int (或短 int ...)。

注意:我不是在寻找涉及转换为 float/double 的解决方案,而是在寻找快速的库实现。

另外,dgemms 也有同样的问题(使用 strassen 算法)。

Is there an equivalent of dgemm (from BLAS) for integral types?
I only know of dgemm, sgemm for double precision / single precision matrices, but would like to have it for matrices that are of integral type such as int (or short int...).

Note: I'm not looking for a solution that involves converting to float/double, and am looking for a fast library implementation.

Also, same question for dgemms (using strassen algorithm).

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

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

发布评论

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

评论(2

时光暖心i 2024-08-20 12:52:09

您没有指定编程语言。在 C++ 中,您可以与矩阵库交互,例如 Eigen (免责声明:我与这个项目有关)。 Eigen 使用矢量化,因此速度应该相当快 - 请确保启用矢量化 - 但我没有做过任何实验,所以我不确定。有一些复杂的对齐问题可能对您来说是个问题,但我对他们不熟悉。

这个问题< /a> 讨论各种 C++ 矩阵库,主要是在计算机图形学的背景下。

You did not specify a programming language. In C++, you could interface with a matrix library such as Eigen (disclaimer: I'm associated with this project). Eigen uses vectorization so it should be pretty fast - make sure you enable vectorization - but I didn't do any experiments so I'm not sure. There are some complicated alignment issues that may be a problem for you, but I'm not familiar with them.

This SO question discusses various C++ matrix libraries, mainly in the context of computer graphics.

煮酒 2024-08-20 12:52:08

BLAS 算法本身不支持整数类型。

BLAS algorithms don't natively support integer types.

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