SPOC is a set of tools for GPGPU programming with OCaml.
The SPOC library enables the detection and use of GPGPU devices with OCaml using Cuda and OpenCL. There is also a camlp4 syntax extension to handle external Cuda or OpenCL kernels, as well as a DSL (called Sarek) to express GPGPU kernels from the OCaml code.
This work was part of my PhD thesis (UPMC-LIP6 laboratory, Paris, France) and was partially funded by the OpenGPU project. I continued this project in 2014-2015 in the Verimag laboratory (Grenoble, France) and then from 2015 to 2018 in the LIFO laboratory in Orléans, France. I currently work at Nomadic Labs
It has currently been tested on multiple architectures and systems, mostly 64-bit Linux and 64-bit OSX systems. It should work with Windows too.
To be able to use SPOC, you’ll need a computer capable of running OCaml (obviously) but also compatible with either OpenCL or Cuda. For Cuda you only need a current proprietary NVidia driver while for OpenCL you need to install the correct OpenCL implementation for your system. SPOC should compile anyway as everything is dynamically linked, but you’ll need Cuda/OpenCL eventually to run your programs.
SPOC comes with some examples and I strongly advise anyone interested to look into the slides and papers. For basic tutorials, you should look into our live demos.
Spoc and Sarek are still in development, here is a list of features we plan to add (bold ones are currently in development) :
Sadly WebCL development seems stopped, [WebGPU]https://github.com/gpuweb/gpuweb/wiki/Implementation-Status) might be an alternative…
This has been tested with Firefox 26-34 and this plugin under Windows 8.1 (32bit or 64bit), multiple Linux distributions (32bit and 64 bit) and Mac OS/X Mavericks and Yosemite.
Of course, you’ll also need to have OpenCL on your system.
You should install/have :
* ocaml >= 4.01.0 (mainly tested with ocaml 4.02.1) * camlp4 * ocamlfind * camlp4-extra (for ubuntu) * m4
For cuda compilation :
SPOC and Sarek should be in the opam repository.
For development releases (more up to date but maybe instable), simply add our repository :
opam repository add spoc_repo https://github.com/mathiasbourgoin/opam_repo_dev.git
opam update spoc_repo opam install spoc
To compile SPOC:
cd Spoc make make install
From the sources :
Will build the ocamldoc html pages in the Spoc/docs directory
The “Samples” directory contains few programs using SPOC.
To compile those programs:
cd Samples make
Binaries will be located in the Samples/build folder
The “SpocLibs” directory contains few libraries based on Spoc.
The Sample directory contains few samples using those libraries
LIFO - Bâtiment IIIA
Rue Léonard de Vinci
F-45067 ORLEANS Cedex 2
Mathias.Bourgoin (at) univ-orleans.fr