simplecl /

Filename Size Date modified Message
export
resources
src
test
123 B
32 B
2.2 KB
2.5 KB
522 B

simplecl

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.

Leiningen coordinates

[com.postspectacular/simplecl "0.1.4"]

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 /export sub-directory.

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:

  1. compute a 2d strange attractor
  2. apply a 2D distortion filter to all points
  3. map the result points onto the surface of a sphere and
  4. apply a 3D distortion filter to all points
  5. do a standard 3d > 2d camera-screen projection

A short video fragment too: attractor.mp4

More examples & documentation will be added ASAP.

License

Copyright © 2012 Karsten Schmidt / PostSpectacular Ltd.

Distributed under the Eclipse Public License, the same as Clojure.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.