是否有用于加速矢量计算的 Java 库?
我正在寻找一个Java库,它允许使用向量(也许还有矩阵)进行一些快速计算。
我所说的“快速”是指它利用了 GPU 处理和/或 SSE 指令。我想知道是否可以找到更便携的东西。我认识到 JVM 提供了一个厚硬件抽象层。
我遇到过 JCUDA,但有一个缺点:在没有 Nnvidia 显卡的计算机上应该运行它在仿真模式下(所以我开始相信它不会像预期的那样有效)。有人已经尝试过吗?
I'm looking for a Java lib that permits to do some fast computations with vector (and maybe matrices too).
By fast I mean that it takes advantage of GPU processing and/or SSE instructions. I'm wondering if it can be possible to find something more portable as possible. I recognize that the JVM provides a thick abstraction layer of the hardware.
I've come across JCUDA, but there's a drawback: on a computer without an Nnvidia graphic card it should be run in emulation mode (so I come to believe it will be not efficient as expected). Has anyone already tried it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
OpenCL 怎么样?它应该为您提供此类优化操作的良好起点。
Java 存在许多绑定,从 jocl 开始(但也可以在 JavaCL 或 LWJGL 从 2.6 开始增加了支持)
What about OpenCL? It should provide you a good starting point for this kind of optimized operations.
There exist many bindings for Java, starting from jocl (but take a loot also at JavaCL or LWJGL that added support from 2.6)
如果您所说的“快”指的是高速而不是需要对您的特定硬件的支持,我建议使用 Colt。向量称为一维矩阵在这个图书馆里。
If by fast you mean high speed rather than requiring support for your particular hardware, I'd recommend Colt. Vectors are called 1-d matrices in this library.
我建议使用 UJMP (包含大多数(如果不是全部)高速 Java 矩阵库)并等待为其编写一个不错的 GPGPU 实现(我 不久前开始使用 JavaCL 进行破解,但它需要一些认真的重写,也许使用 ScalaCLv2 正在开发中)。
I'd recommend using UJMP (wraps most if not all of the high-speed Java matrix libraries) and wait for a decent GPGPU implementation to be written for it (I started hacking it with JavaCL a while ago, but it needs some serious rewrite, maybe using ScalaCLv2 that's in the works).