Since you mention high-level operations on matrices and vectors, ATLAS, Intel's MKL, PLASMA, and FLAME may be of interest.
Some C++ matrix math libraries include uBLAS from Boost, Armadillo, Eigen, IT++, and Newmat. The POOMA library probably also includes some of these things. This question also refers to MTL.
If you're looking for lower-level portability primitives, a colleague of mine has developed a wrapper around SSE2, Altivec, VSX, Larrabee, and Cell SPE vector operations. It can be found in our source repository, but its licensing (academic) may not be appropriate if you want to distribute it as part of your work. It is also still under significant development to cover the range of application needs that it's targeted at.
Eigen is an MPL2-licensed header-only C++ library that has vector / matrix math that is optimized for SSE, Neon, and Altivec. They have more more sophisticated math operations in their add-on modules.
Try liboil or the related ORC. Especially ORC is interesting; it implements a high-level assembly language that is compiled into architecture specific code. Pretty sophisticated, much more so than a simple wrapper library.
If you don't mind getting down and dirty with assembler then you can always use the intrinsic functions for all the SIMD instructions. They will be processor specific, i.e. SSE4 intrinsics will only run on SSE4 enabled CPUs and it's up to you to make sure the extensions are there.
You could, however, use a compiler that generates SIMD code for you without any external libraries. VectorC is supposed to be good although I've never used it personally. It doesn't require any special libraries as far as I know, it just spots those bits of source code that can benfit from SIMD and compiles to whatever level of SSE you specify.
发布评论
评论(5)
由于您提到了矩阵和向量的高级运算,ATLAS,英特尔的 MKL, PLASMA 和
一些 C++ 矩阵数学库包括来自 Boost、Armadillo、Eigen、IT++ 和 Newmat 的 uBLAS。 POOMA 库可能也包含其中一些内容。 这个问题也涉及MTL。
如果您正在寻找较低级别的可移植性原语,我的一位同事开发了一个围绕 SSE2、Altivec、VSX、Larrabee 和 Cell SPE 矢量操作的包装器。 它可以在我们的 源存储库,但如果您想将其作为您工作的一部分进行分发,则其许可(学术)可能不合适。 它还仍在进行重大开发,以满足其目标应用需求的范围。
Since you mention high-level operations on matrices and vectors, ATLAS, Intel's MKL, PLASMA, and FLAME may be of interest.
Some C++ matrix math libraries include uBLAS from Boost, Armadillo, Eigen, IT++, and Newmat. The POOMA library probably also includes some of these things. This question also refers to MTL.
If you're looking for lower-level portability primitives, a colleague of mine has developed a wrapper around SSE2, Altivec, VSX, Larrabee, and Cell SPE vector operations. It can be found in our source repository, but its licensing (academic) may not be appropriate if you want to distribute it as part of your work. It is also still under significant development to cover the range of application needs that it's targeted at.
Eigen 是一个 MPL2< /a>-仅获得许可的标头 C++ 库,具有针对 SSE、Neon 和 Altivec 优化的矢量/矩阵数学。 他们的附加模块中有更复杂的数学运算。
Eigen is an MPL2-licensed header-only C++ library that has vector / matrix math that is optimized for SSE, Neon, and Altivec. They have more more sophisticated math operations in their add-on modules.
查看 macstl:http://www.pixelglow.com/macstl/
Check out macstl: http://www.pixelglow.com/macstl/
尝试 liboil 或相关的 ORC. 特别是ORC很有趣; 它实现了一种高级汇编语言,该语言被编译成特定于体系结构的代码。 相当复杂,比简单的包装库要复杂得多。
Try liboil or the related ORC. Especially ORC is interesting; it implements a high-level assembly language that is compiled into architecture specific code. Pretty sophisticated, much more so than a simple wrapper library.
如果您不介意使用汇编程序,那么您始终可以对所有 SIMD 指令使用内部函数。 它们将是特定于处理器的,即 SSE4 内在函数只能在支持 SSE4 的 CPU 上运行,并且由您来确保扩展存在。
此处有一篇关于应用 SIMD 的好文章。
但是,您可以使用无需任何外部库即可生成 SIMD 代码的编译器。 VectorC 应该不错,尽管我个人从未使用过它。 据我所知,它不需要任何特殊的库,它只是发现那些可以从 SIMD 中受益的源代码,并编译到您指定的任何级别的 SSE。
If you don't mind getting down and dirty with assembler then you can always use the intrinsic functions for all the SIMD instructions. They will be processor specific, i.e. SSE4 intrinsics will only run on SSE4 enabled CPUs and it's up to you to make sure the extensions are there.
There is a good article here about applying SIMD.
You could, however, use a compiler that generates SIMD code for you without any external libraries. VectorC is supposed to be good although I've never used it personally. It doesn't require any special libraries as far as I know, it just spots those bits of source code that can benfit from SIMD and compiles to whatever level of SSE you specify.