OpenCL Extension Wrangler Library (CLEW) does to OpenCL what GLEW does to OpenGL. It takes out all the pain of dealing with OpenCL libraries from different vendors and on different platforms. The best part is that your code will compile and run even on a computer without a OpenCL device or library. Only when it calls a OpenCL call does it fail.
- Get the CLEW code from Github:
$ git clone https://github.com/martijnberger/clew.git
- Compile CLEW:
$ mkdir build $ cd build $ cmake .. $ make
- Test if CLEW works:
$ clewTest/clewTest num platforms: 1
If you have an OpenCL device and OpenCL library installed, then the number of platforms reported will be greater than zero.
- For your own code, include the
clew.hheader file and link with the
libclew.solibrary file. Call
clewInitat the beginning. After that you can follow with any OpenCL calls.
Tried with: NVIDIA 352 drivers, NVIDIA GeForce GTX 750 Ti and Ubuntu 14.04