Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

OpenCL binding for Erlang

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 c_src
Octocat-spinner-32 doc
Octocat-spinner-32 ebin
Octocat-spinner-32 examples
Octocat-spinner-32 include
Octocat-spinner-32 priv
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYRIGHT
Octocat-spinner-32 README
Octocat-spinner-32 rebar.config
Octocat-spinner-32 rebar.config.script
Octocat-spinner-32 vsn.mk
README
Welcome to the Erlang OpenCL binding

To get started you need erlang, preferably R16B. 
You also need 'rebar' and a 'C' compiler, i.e. 
GCC (or CL.EXE) and a machine with OpenCL installed. 

To build: just run rebar compile

To build examples: Goto the examples directory and run make.

Make sure erlang finds the cl/ebin directory.
For example if this file is /home/username/src/cl/README
set ERL_LIBS=/home/username/src/

Windows Users: 
The scripts look for the OpenCL files in /opt/local/ by default.
You can also set the environment variable OPENCL_DIR to point
to another location.

This is an example of howto set up the building env:
I'm assuming you got an mingw environment.

Download a development kit from Nvidia, ATI or Intel:
e.g. http://software.intel.com/en-us/vcsource/tools/opencl-sdk-2013
cp -R /c/Intel SDK/lib /opt/local/
cp -R /c/Intel SDK/include /opt/local/

Example building 64b from CMD:
------------------------------
Setup windows build environment

c:\src\cl> "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"

Setup the paths

c:\src\cl> set PATH="c:\Program Files\erl5.10.1\bin";%PATH%
c:\src\cl> set PATH="c:\tools\git\cmd";%PATH%
c:\src\cl> set OPENCL_DIR="c:\Intel~1\"

And build

c:\src\cl> ..\rebar\rebar.cmd compile

If you want to build with mingw gcc use:
CC=gcc rebar compile

NOTE: That mingw64-gcc can not be linked with MSVC libs, see
http://sourceforge.net/apps/trac/mingw-w64/wiki/Answer%2064%20bit%20MSVC-generated%20x64%20.lib
Follow the steps there to make a libOpenCL.dll.a and it should work.

NOTE: OpenCL with ATI drivers for CPU usage don't work when erlang
is started within a mingw shell but does if you start it from
a Windows CMD.exe shell.  (This may depend on the AMD driver version)

Something went wrong with that request. Please try again.