Clojure wrapper & highlevel processing pipeline ops for JOCL/OpenCL
Simplecl intends to enable a somewhat declarative interop approach between Clojure and OpenCL compute kernels. It provides thin wrappers for basic OpenCL data structures (contexts, devices, buffers, programs, kernels), as well as an highlevel API to define & configure multi-kernel & multi-program workflows and transforming data between Clojure's data structures and their native OpenCL representation as byte buffers.
Simplecl is still a young project, but has been sucessfully used in production in several projects and is already (fairly) well documented.
Usage & examples
Please see the extensive doc strings, Marginalia docs and the 2D Verlet physics demo for a complete & visual example use case:
Verlet cloth sim
Running the command below will run a basic 2d cloth simulation with 40,000 particles & 80,000 springs and generate an image sequence of 120 PNGs in the
lein with-profile test run -m simplecl.verlet-test
A video of three different variations is here: verlet-cloth-sim.mp4
This demo is also showcasing usage & integration of the structgen partner library to ease the task of aligning nested data structures in an OpenCL compatible way.
3D Strange attractor
A sneak peak of an upcoming example kernel pipeline to:
- compute a 2d strange attractor
- apply a 2D distortion filter to all points
- map the result points onto the surface of a sphere and
- apply a 3D distortion filter to all points
- do a standard 3d > 2d camera-screen projection
A short video fragment too: attractor.mp4
More examples & documentation will be added ASAP.
Copyright © 2012 Karsten Schmidt / PostSpectacular Ltd.
Distributed under the Eclipse Public License, the same as Clojure.