Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to use CLEW

📅 2015-Dec-03 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ clew, glew, opencl, opengl ⬩ 📚 Archive

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.

$ git clone
$ mkdir build
$ cd build
$ cmake ..
$ make
$ 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.

Tried with: NVIDIA 352 drivers, NVIDIA GeForce GTX 750 Ti and Ubuntu 14.04

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email