Java GPU编程 [英] Java GPU programming

查看:270
本文介绍了Java GPU编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以用Java进行GPU编程? 我的意思是不使用本机库.

Is it possible to do GPU programming in Java ? I mean without using native libraries.

当我们切换到gpu的时候,可以期待多少性能提升?

And how much of a performance improvement can one expect when we switch over to gpu's ?

我不是在看游戏编程,而是想做硬核数字处理.

I am not looking at game programming, I want to do hard core number crunching.

推荐答案

是. Java3D,LWJGL和JOGL支持

Yes. Java3D, LWJGL and JOGL support GLSL (OpenGL Shading Language).


如果要在GPU上进行与平台无关的通用计算,则可以使用OpenCL.尽管功能集和执行环境千差万别,但该框架使您可以编写将所有处理单元均一地对待的代码.但是,与Java相比,这是非常底层的编程.


You can use OpenCL if you want to do platform-neutral, general-purpose computation on GPUs. This framework lets you write code that treats all processing units identically, despite wildly varying feature sets and execution environments. Though, this is very low level programming compared with Java.

看来,您的理想选择是使用OpenCL支持编写的JVM.在网上搜索时,我发现对该创意有点兴趣,但没有任何重大支持的证据.

It seems your ideal would be a JVM written with OpenCL support. Searching online, I found a little bit of interest in the idea but no evidence of any major backing.

人们可以期望多少性能提升

how much of a performance improvement can one expect

这取决于您所运行的系统以及要处理的数据类型(矩阵和矢量数学在GPU上极为有效).您可能会在像我的系统上获得一些重大收获,例如带有两个功能强大的GPU和一个适度的单核CPU的系统.但是,在具有适度GPU和四核CPU的计算机上,性能提升可能很难克服开销.

That depends on the system you're running on and what sort of data you're processing (Matrix and vector math is extremely efficient on GPUs). You'd likely get some major gains on a system like mine with two powerful GPUs and a modest single-core CPU. However on a computer with a modest GPU and a quad-core CPU, the performance gains might have a hard time overcoming the overhead.

这篇关于Java GPU编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆