Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Java code can be moved to the GPU?

Tags:

java

gpu

rootbeer

With the framework rootbeer is GPU programming for Java possible.

Which Java code should be used for rootbeer and which code should better run in the Java VM self?

Or other: which code produce more overhead and it make no sense?

like image 241
Horcrux7 Avatar asked Aug 12 '12 18:08

Horcrux7


3 Answers

It's a bit of a silly thing to say, but the obvious answer would be "for problems at which a GPU is better than a CPU". Modern GPU's have in excess of a thousand cores, but comparatively little memory, so in general, this means stuff that lends itself well to parallelization and doesn't take too much memory.

G. Bach mentioned brute-force attacks against crypto stuff in the comments, that's a good example. Scientific simulations are another good example, in fact, a few years ago a few research institutions (notably NASA) had clusters of Playstation 3's running simulations. Wikipedia's article on GPGPU computing lists several applications of the technology.

like image 60
Barend Avatar answered Oct 08 '22 19:10

Barend


In addition to the other answers: There are also some Java-Features that are not supported to translate by rootbeer jet.

  1. native methods
  2. reflection
  3. dynamic method invocation
  4. sleeping while inside a monitor.
  5. garbage collection(!)

You should avoid code with these features used.

Updates for Rootbeer are in production to provide garbage collection and other missing Java features.

like image 22
Simulant Avatar answered Oct 08 '22 18:10

Simulant


To get speedups with GPUs, you want to have lots of computation per data element because data transfer is so slow. You usually want 2 or 3 nested for loops running on the GPU with at least a 1000 threads.

like image 40
pcpratts Avatar answered Oct 08 '22 18:10

pcpratts