O'Reilly logo

Seven Concurrency Models in Seven Weeks by Paul Butcher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Day 3: OpenCL and OpenGL—Keeping It on the GPU

Today we’ll put together a complete OpenCL application that both runs and visualizes a simple physics simulation. In the process, we’ll see not only how to create a kernel that executes the simulation in parallel but also how to integrate OpenCL with OpenGL and avoid the overhead of buffer copies by keeping everything on the GPU.

Water Ripples

The simulation we’re going to create is of water ripples. It’s not going to be a hyperaccurate physical simulation, but it will be good enough to look convincing as a graphical effect in a game—to simulate, for example, the surface of a pond during a rain shower.

LWJGL

We’re going to move away from C for this example and instead use Java together with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required