問題描述
圖形處理單元(GPGPU)上的通用計算是一個非常有吸引力的概念GPU 的強大功能可用于任何類型的計算.
General-purpose computing on graphics processing units (GPGPU) is a very attractive concept to harness the power of the GPU for any kind of computing.
我很想將 GPGPU 用于圖像處理、粒子和快速幾何運算.
I'd love to use GPGPU for image processing, particles, and fast geometric operations.
目前,該領域的兩個競爭者似乎是 CUDA 和 OpenCL.我想知道:
Right now, it seems the two contenders in this space are CUDA and OpenCL. I'd like to know:
- OpenCL 是否可以在 Windows/Mac 上的 Java 中使用?
- 與 OpenCL/CUDA 接口的庫方法有哪些?
- 是否可以直接使用 JNA?
- 我是不是忘記了什么?
感謝任何現實世界的經驗/例子/戰爭故事.
Any real-world experience/examples/war stories are appreciated.
推薦答案
AFAIK, JavaCL/OpenCL4Java 是目前唯一可在所有平臺上使用的 OpenCL 綁定(包括 MacOS X、FreeBSD、Linux、Windows、Solaris,均采用 Intel 32、64 位和 ppc 變體,這要歸功于它使用 JNA).
AFAIK, JavaCL / OpenCL4Java is the only OpenCL binding that is available on all platforms right now (including MacOS X, FreeBSD, Linux, Windows, Solaris, all in Intel 32, 64 bits and ppc variants, thanks to its use of JNA).
它的演示至少在 Mac 和 Windows 上可以從 Java Web Start 正常運行(為了避免 Linux 上的隨機崩潰,請參閱 this wiki page,例如這個 粒子演示.
It has demos that actually run fine from Java Web Start at least on Mac and Windows (to avoid random crashes on Linux, please see this wiki page, such as this Particles Demo.
它還帶有一些實用程序(GPGPU 隨機數生成、基本并行縮減、線性代數)和一個 Scala DSL.
It also comes with a few utilities (GPGPU random number generation, basic parallel reduction, linear algebra) and a Scala DSL.
最后,它是可用的最古老的綁定(自 2009 年 6 月以來)并且 它有一個活躍的用戶社區.
Finally, it's the oldest bindings available (since june 2009) and it has an active user community.
(免責聲明:我是 JavaCL 的作者 :-))
(Disclaimer: I'm JavaCL's author :-))
這篇關于Java 中 GPGPU/CUDA/OpenCL 的最佳方法?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!