Are Java 8 Lambda expressions using GPU? -


i got in touch java 8 , i'm trying learn lambda expressions. want graphics calculations, code far:

    intstream.range(0, (screensize.width * screensize.height)).parallel().foreach(id -> {          int x = id % screensize.width;         int y = ((id-x) / screensize.width);         /*look color pixel is.*/     }); 

now code graphics, basic math (plus, minus, multiply, modulo), except bufferedimage.getrgb(x, y) , operations java.awt.color, , can done each pixel seperately.

now question: possible run on gpu? or automatically gpu-based? (i remember reading somewhere, i'm not sure)

the javavm implementation free implement java bytecode interpretation wants long results correct. free run on gpu when wants to. however, don't know of java implementation currently. there project add gpu acceleration openjdk (project sumatra), , guessed correctly: focuses on stream api because designed write code can parallelized. far production-ready , doesn't seem there working on it.

when want run computations on gpu java program today, need library wraps gpu computing api opencl using java native interface (for opencl there jocl). prepared learn new programming language, because every gpu computing api takes instructions in different language , none of them similar java.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -