PDA

View Full Version : OpenCL bindings for Java & Scala



olivier.chafik
09-28-2009, 11:00 AM
Hello,

Hope this is an appropriate place for such announcements...
I've created the OpenCL4Java project (http://code.google.com/p/nativelibs4java/wiki/OpenCL), which provides Java bindings for OpenCL using JNA (https://jna.dev.java.net/) + JNAerator (http://code.google.com/p/jnaerator/).
It was tested on MacOS X 10.6 and was reported to work on Windows with NVidia beta drivers.

I've also created an experimental Scala DSL dubbed ScalaCL that makes it trivial to evaluate simple expressions in parallel from Scala :


class VectAdd(i: Dim) extends Program(i) {
val a = FloatsVar // buffer of floats
val b = FloatsVar
var output = FloatsVar
content = output := a + b
}
var n = 1000;
var prog = new MyProg(n)
prog.a.write(1 to n)
prog.b.write(prog.a)
prog ! // executes the program


For some introduction to using them, I've blogged about the OpenCL4Java bindings (http://ochafik.free.fr/blog/?p=190) and ScalaCL (http://ochafik.free.fr/blog/?p=207).

Any feedback is welcome :-)

Cheers and happy parallel computing !