Skip to content
Go OpenCL (GOCL) Binding
Go C Other
Find file
Latest commit 9de888f Jan 25, 2016 @rainliu Merge pull request #6 from eddytrex/master
Manage Events slice when numEvents is 0


Go OpenCL (GOCL) Binding (

Library documentation:

In order to build this, make sure you have the required drivers and SDK installed for your graphics card. You will need at least opencl.lib from Intel/AMD/NVIDIA:

The locations of the library and include file can be supplied by way of environment variables, for example:

export CGO_LDFLAGS=-L$OPENCLSDKROOT/lib/x86 (or null for NVIDIA and Mac OSX)

export CGO_CFLAGS=-I$GOPATH/src/gocl/android/include (gocl/android/include/CL have the latest OpenCL 2.0 include files from

To build OpenCL 1.1/1.2/2.0 compliance C-style binding (replacing "clxx" with "cl11"/"cl12"/"cl20"):

go build -tags="clxx" gocl/cl

go test -v -tags="clxx" gocl/cl_test

go install -tags="cl11" gocl/cl_demo/opencl11/ch(x) (Examples in "OpenCL in Action")

go install -tags="cl12" gocl/cl_demo/opencl12/chapter(x) (Examples in "Heterogeneous Computing with OpenCL, 2nd Edition")

go install -tags="cl20" gocl/cl_demo/opencl20/x (Examples in "AMDAPPSDK and INTELOCLSDK")

To build OpenCL 1.1/1.2/2.0 compliance OO-style binding (replacing "clxx" with "cl11"/"cl12"/"cl20"):

go build -tags="clxx" gocl/ocl

go test -v -tags="clxx" gocl/ocl_test

Something went wrong with that request. Please try again.