WebCL Tutorial

This series of lessons will introduce you to WebCL programming, starting from the basics like WebCL context creation and kernel compilation. In order to walk through the examples you will need WebCL on your computer. Click here to check if you already have WebCL enabled.

If you did not have WebCL support yet, you should install our WebCL extension for Firefox by clicking here. As a prerequisite you need to have OpenCL supported on your platform (that is, up-to-date GPU drivers with OpenCL support, or alternatively a CPU implementation; see Resources on the sidebar).

Lesson 1: Hello WebCL!

This lesson is a simple "Hello WebCL" program. It shows how to obtain a WebCL platform and create a WebCL context. A popup window is showing whether this is succeeded or not.

Lesson 2: WebCL Device Info Query

This lesson shows how to obtain a list of available platforms and query information from the platforms and devices. In this example, the information is just printed out.

Lesson 3: Kernel Compilation

This lesson shows how to compile, link and run a simple OpenCL kernel that computes the sum of two vectors.

Lesson 4: Simple Image Processing

The lesson describes how to do image processing like grayscaling with WebCL. In the example canvas data is passed for WebCL processing, which returns image data back to canvas.