Web browsers in most cases cannot use the full power of your computer or mobile device. The code they run tends to run in a sandbox that is abstracted from your hardware and does not allow the browser full access. For example, while your desktop software can use all the cores of your computer and uses a modern graphics processor for parallel processing to speed up an image filter, the JavaScript code in your browser cannot. But that will change soon.
Khronos Group, the industry consortium responsible for standards such as WebGL, OpenGL and COLLADA, today announced the ratification and public release of the WebCL 1.0 specifications. WebCL is the browser version of OpenCL and allows Web developers to take advantage of GPU and multi-core processing from within the Web browser.
The WebCL standard is based on OpenCL, which provides a similar number of features on the desktop.
As Neil Trevett, the chair of the WebCL working group, recently announced, he expects that once browser vendors adopt this specification, developers will use these capabilities to develop things like physics engines for WebGL games, real-time video, image and photo editing tools with advanced filters in the browser.
Basically, any application that needs to run code in parallel can also run in the browser. The standard itself is agnostic anyway, although one can assume that games and photo processing will be among the first applications to use these features.
Since the bottleneck for such applications is not the browser, there is hardly any performance loss for developers when they execute this code from the browser.
At the moment JavaScript with asm.js on Firefox is about the fastest you can run natively in your browser without having to resort to things like Chrome`s Native Client or a plug-in. Even though asm.js may come close to native speeds, it is not designed for parallel processing, so there is really no way for developers to get this kind of performance for their apps. However, as Trevett noted, asm.js and WebCL are free, and since WebGL offers JavaScript bindings, developers could always call WebCL from their asm.js based applications.
Because WebCL is so similar to OpenCL, developers should be able to port their code fairly easily.
However, the closer the code runs on bare metal, the more security issues are also present in the form of WebCL. That`s why, says Trevett, the team omitted some features available in OpenCL because could not be guaranteed. As part of this process, the team developed an open source kernel validator, and Trevett emphasized that working on WebCL also motivated the OpenCL community to become more secure.
For web developers, this opens up a whole new set of opportunities and could bring new categories of applications to the Web. At the same time, this is also very uncharted territory for many of you. Trevett expects that just as the WebGL ecosystem is now dominated by relatively easy-to-use frameworks that abstract most of the tedious work, WebCL will experience a similar development. Just as developers familiar with graphics began working on the WebGL middleware, he expects that engineers now working in parallel processing will do something similar for WebCL.
It is still unclear when browsers will offer this feature. The standard has been in progress since 2011 and the companies involved in the process include industry giants such as Adobe, AMD, Nvidia, ARM, Intel, Opera Software, Mozilla, Google Samsung and Qualcomm. Nokia however, offers a WebCL extension for Firefox, so if you really want to try it, this is probably the best way to go right now.
Thank you for your visit.
Leave A Comment