is it possible to run "for loops" of java code on GPU using OpenACC?? my data mining algorithm coded in java and i want to parallelism my sequential code on GPU. how can i parallelize my java code on GPU?
Asked
Active
Viewed 992 times
4
-
Good question... but what API do you intend to use to delegate to the GPU? CUDA? – fge Apr 14 '15 at 09:14
-
to run it in on GPU using CUDA again i need to rewrite my whole java code into CUDA right? – user3826791 Apr 14 '15 at 09:38
-
is there any way to parallelized my sequential java code on GPU without need of changing the whole code? – user3826791 Apr 14 '15 at 09:40
-
1rootbeer is one approach I can think of currently to convert java code directly to something executable on a GPU. However IBM is [developing GPU capabilities for java8](http://www-01.ibm.com/support/knowledgecenter/#!/SSYKE2_8.0.0/com.ibm.java.lnx.80.doc/user/gpu_developing_cuda4j.html) and if you simply want to interface Java to GPU code there are a number of options covered [here](http://stackoverflow.com/questions/22866901/using-java-with-nvidia-gpus-cuda) This last link gives a good overview of options including other options for java-code-on-GPU – Robert Crovella Apr 14 '15 at 20:32
1 Answers
1
As of today, tools are beginning to show support for automatically optimizing code (Youtube: Stochastic Optimization for x86 Binaries, Automatic Parallelization with Intel® Compilers) but they can't do that in the general case.
OpenACC is available for Fortran and C++, there is no Java support.
That means today, you still have to do this manually yourself. Look at frameworks like Akka or Hadoop to make your life easier.
For resources how to access shader languages, see Java GPU programming

Community
- 1
- 1

Aaron Digulla
- 321,842
- 108
- 597
- 820
-
-
my project is in java netbeans IDE 8.0.2 and mysql...i want to parallelizes my java code on GPU.."Today the source code to the Rootbeer GPU Compiler was released as open source on github. This work allows for a developer to use almost any Java code on the GPU. It is free, open source and highly tested. Rootbeer is the most full featured translator to convert Java Bytecode to CUDA. It allows arbitrary graphs of objects to be serialized to the GPU and the GPU kernel to be written in Java." is this the only way i can parallelized my java code??? please help – user3826791 Apr 14 '15 at 18:20
-
This isn't the only way. There are many ways but all of them include you doing a lot of work. There is no cheap/free/efforless way to convert your existing Java code to CUDA. Rootbeer can help a lot but it also requires you to write your code in a certain way. – Aaron Digulla Apr 15 '15 at 09:03
-