Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.81 KB

README.org

File metadata and controls

57 lines (40 loc) · 1.81 KB

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 (although it’s was originally created in 2012, it has been dormant for a while), yet has been sucessfully used in production in several projects and is fairly well documented.

Recent additions include adding support for image operations in OpenCL.

Leiningen coordinates

[simplecl "0.2.3"]

Usage & examples

Please see the extensive doc strings in the source and the examples below:

Hello CL example

TODO: WARNING: Hello CL example is currently broken.

A trivial “Hello world” style example is located in this namespace. It defines a kernel to factor two float arrays and shows the required steps to run this on either CPU or GPU devices (by default the most performant is chosen automatically):

;; chooses max performance device
lein trampoline run -m simplecl.test.hello

;; or force usage of given device type
lein trampoline run -m simplecl.test.hello gpu
lein trampoline run -m simplecl.test.hello cpu

Image processing CL example

A simple image processing example if located in this namespace. It defines a kernel that inverts an image.

License

Copyright © 2012 - 2015 Karsten Schmidt Copyright © 2016 Dan McCabe

Distributed under the Apache Software License 2.0