launch jar application on GPU

Hello,

I have a jar application that I can launch on my 4 CPUs in an embarassingly parallel fashion.
I was wondering whether it is also possible using the GPUs and Cuda.

If yes, how ?

Thanks

  • Martial

Hello,

I have a jar application that I can launch on my 4 CPUs in an embarassingly parallel fashion.
I was wondering whether it is also possible using the GPUs and Cuda.

If yes, how ?

Thanks

  • Martial

Sorry, you can’t run a Java program on the GPU, even if it’s embarrassingly parallel. You’ll need to write your GPU code in CUDA or OpenCL, but you could handle interfacing with CUDA via jCUDA if you want to use Java for that.

Sorry, you can’t run a Java program on the GPU, even if it’s embarrassingly parallel. You’ll need to write your GPU code in CUDA or OpenCL, but you could handle interfacing with CUDA via jCUDA if you want to use Java for that.

Thanks for your answer profquail,

Bye,

Thanks for your answer profquail,

Bye,

So there are bindings for Java that let you run CUDA kernels (written in C). There’s also a project I worked on (which I wouldn’t describe as production ready!) that compiles JVM bytecode for GPUs. You’ll need to add some annotations to your Java source code to mark embarrassingly parallel loops, and also have to switch on debugging information. You’ll end up writing things similar to:

@Parallel(loops = {"i"})

void compute(int[] x, int y[]) {

  for(int i = 0; i < x.length; i++) {

    x[i] += y[i];

  }

}

So if the loops are already there, it just means adding the annotation. There are some restrictions on what you can do in the loop body (associated with limitations of the hardware). You can download it at http://code.google.com/p/java-gpu/ and see whether it does what you need.

Cheers

Pete

So there are bindings for Java that let you run CUDA kernels (written in C). There’s also a project I worked on (which I wouldn’t describe as production ready!) that compiles JVM bytecode for GPUs. You’ll need to add some annotations to your Java source code to mark embarrassingly parallel loops, and also have to switch on debugging information. You’ll end up writing things similar to:

@Parallel(loops = {"i"})

void compute(int[] x, int y[]) {

  for(int i = 0; i < x.length; i++) {

    x[i] += y[i];

  }

}

So if the loops are already there, it just means adding the annotation. There are some restrictions on what you can do in the loop body (associated with limitations of the hardware). You can download it at http://code.google.com/p/java-gpu/ and see whether it does what you need.

Cheers

Pete