WebCL Widget for WordPress

webcl-widget-adminSee the widget at the right showing if your browser+computer supports WebCL?

It is available under the GPL 2.0 license and based on code from WebCL@NokiaResearch (thanks guys for your great Firefox-plugin!)

Download from WordPress.org and unzip in /wp-content/plugins/. Or (better), search for a new plugin: “WebCL”. Feedback can be given in the comments.

I’d like to get your feedback what features you would like to see in the next version.

In case you want to make it for other CMS-platforms, here’s the main code of version 1.0:

<div id="webclwidget_detected"></div>
<div id="webclwidget_devices"></div>

<script type="text/javascript">// <![CDATA[
function webclwidget_detectCL() {
  // First check if the WebCL extension is installed at all
  if (window.WebCL == undefined) {
    return "Your system does not support WebCL.";
  try {
    var platforms = WebCL.getPlatformIDs();
    var devices = [];
    for (var i in platforms) {
      var plat = platforms[i];
      devices[i] = plat.getDeviceIDs(WebCL.CL_DEVICE_TYPE_ALL);
    return "Your system supports WebCL!";
  } catch (e) {
    return "WebCL is installed, but not working correctly.";
function webclwidget_setDetectCL(elem) {
  obj = document.getElementById(elem);
  obj.innerHTML = webclwidget_detectCL();
function webclwidget_get_devices() {
  s = "These are your devices: <ul>";
  try {
    var platforms = WebCL.getPlatformIDs ();
    for (var i in platforms) {
      var plat = platforms[i];
      var devices = plat.getDeviceIDs (WebCL.CL_DEVICE_TYPE_ALL);
      for (var j in devices) {
        var dev = devices[j];
        s += "<li>" + dev.getDeviceInfo(WebCL.CL_DEVICE_NAME) + "</li>";
  } catch (e) {
    return "";
  return s + "";
function webclwidget_setDevices(elem) {
  obj = document.getElementById(elem);
  obj.innerHTML = webclwidget_get_devices();
// ]]></script>

If you want to use it, you probably get cleaner code from the zip-file. Let me know if you created a plugin for another CMS.

Why put this on your site?

So you can help promote WebCL and OpenCL. If WebGL and WebCL become mainstream, then the web will look different – you can help speed it up a little. Remember that a lot of littles makes a lot.

Also if you are having a bitcoins-site, a tech-site or want to use WebCL. With the widget you easily help your visitors show if they have WebCL installed.

Feedback is very welcome – put them in the comments or send me an email.

Related Posts


Improving FinanceBench for GPUs Part II – low hanging fruit

We found a finance benchmark for GPUs and wanted to show we could speed its algorithms up. Like a lot! Following the initial work done in porting  ...


The Art of Benchmarking

How fast is your software? The simpler the software setup, the easier to answer this question. The more complex the software, the more the answer will ...


Birthday present! Free 1-day Online GPGPU crash course: CUDA / HIP / OpenCL

Stream HPC is 10 years old on 1 April 2020. Therefore we offer our one day GPGPU crash course for free that whole month. Now Corona (and fear for i ...


Problem solving tactic: making black boxes smaller

We are a problem solving company first, specialised in HPC - building software close to the processor. The more projects we finish, the more it's clea ...