Using OpenCL to speed up Web applications

Source: Internet
Author: User
Tags pack

Because the image processor (GPU) has a highly parallel infrastructure, it can perform some type of application faster than traditional central processing units (CPUs). The Open Computing Language (OPENCL) is one of the most popular languages to harness the power of the GPU. A typical example is the Adobe Premiere Pro CS6, which accelerates image and video processing by performing OpenCL routines on the user's GPU.

Many companies believe that GPU acceleration is a big help for browser-based applications, and a team has been set up to promote the technology. In May 2012, the Working group published the first draft of the Web Computing Language (WEBCL). As its home page describes, the WEBCL workgroup is designed to "support Web applications that harness GPU and multi-core CPU processing in web browsers."

Two companies have released related extensions that support the call to WEBCL functionality from within the browser. Samsung has released WEBCL to extend WebKit, an engine that provides powerful functionality for Apple Safari browsers on Mac OS X. Nokia has released a Mozilla Firefox WEBCL plug-in that can run on Windows and 32-bit Linux operating systems. Because of its extensive developer base, this article will focus on the implementation of Nokia. This article will explain how to install WEBCL and also introduce the basics of WEBCL encoding. Then demonstrate how to use WEBCL to search the entire text at a high speed.

Install WEBCL

The WEBCL application requires three components: the OPENCL Software Development Kit (SDK), the Firefox browser, and the Nokia Firefox plugin.

Get OpenCL SDK

The WEBCL application invokes the OpenCL feature on the host. Therefore, you must install OpenCL before running the WEBCL application. The OpenCL Development Toolkit is device-and OS-specific, so to run the routine on a Windows computer with an Nvidia GPU, you need to install an Nvidia OpenCL SDK that applies to Windows. Although it is not possible to provide a guide for all OpenCL SDK installations, this article can point you in the right direction:

The AMD Accelerated Parallel Processing (APP) SDK needs to be downloaded by executing routines on the AMD CPU or GPU.

To perform routines on the NVIDIA GPU, you need to download the nvidia GPU Computing SDK.

To perform routines on the Intel CPU, you need to download the Intel SDK for OpenCL.

You can install multiple OpenCL SDK on a single computer, and there is no conflict.


The modern CPU consists of several processing elements called cores. Each core has its own processing channel and data storage, and communication between the cores is implemented using a method similar to direct access to memory. Programming for multi-core CPUs is like leading a well-trained small spy team: Each member can perform complex tasks on its own, but the entire process works well as a team.

In contrast, GPU processing is performed by work items that are limited to memory and processing resources. Work items are not good at making decisions, and the coordination of their own tasks is worse. The advantage of the GPU, however, is that it can execute thousands of work items at the same time. As a result, programming for GPU is like leading a zombie corps. Although the command is simple, it can do a lot of work.

Install WEBCL on Firefox

After the OpenCL SDK is installed, the installation WEBCL is very simple, as shown in the following steps:

Download Firefox from the Mozilla website.

In Firefox, login to Nokia's WEBCL website. Click the Nokia WEBCL expansion pack.

If necessary, support the download support Firefox expansion pack (a *.xpi file). In the Software Installation dialog box, click Install Now, and then restart the browser.

To test the installation, please login to Nokia's WEBCL website and choose click here to check this have WEBCL enabled (click here to see if you support WEBCL).

If it appears to be a dialog box, excellent! Your system does support WEBCL (very good!) Your system supports WEBCL), it means that WEBCL was installed successfully. If the dialog box shows that unfortunately your system does not support WEBCL (sorry that your system does not support WEBCL), you may need to reinstall the expansion pack or access WEBCL on another computer.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.