Ten reasons to love OpenCL

Ten reasons to love OpenCL


Amdahl software has posted an interesting article about why they think programmers should like OpenCL, which has quite useful insights. Some of the reasons are direct criticism to CUDA (without explicitly naming it). OpenCL has advantages in some aspects but it also has drawbacks considering CUDA’s maturity is undeniably higher and that CUDA can be specifically tuned (since it only targets NVidia GPUs anyway).

Here are their thoughts with a brief comment of ours: (bold letters are theirs, regular writing are our thoughts – we agree with every aspect pointed out)

1 – OpenCL can accelerate code by a factor 10 or more – without too much trouble for a C programmer. If the code is finely tuned we’re looking at 40-300x speedup.
2 – OpenCL is an open standard – good because any manufacturer can comply; the drawback is that it limits optimizations.
3 – OpenCL can help save power – true, and often taken for granted.
4 – OpenCL can save you hardware cost – well… not that we have too many CPU and GPU manufacturers… let’s hope for some FPGAs and handheld OpenCL soon.
5 – OpenCL adoption is ramping up rapidly – although there’s a LOT of ground to cover. The hardware and programmer sides are going well but there aren’t very many softwares around using it.
6 – OpenCL may be used as the basis for generating custom hardware – unquestionable.
7 – The OpenCL C99 language is based on C – this is good news for C programmers alright.
8 – OpenCL can be used from a variety of host languages – but you’re still stuck with OpenCL C99 for the kernels…
9 – It is easy to start with OpenCL – as long as you already know parallel patterns, which is the major difficulty when learning CUDA, MPI, Cilk, Microsoft.Parallel etc.
10 – OpenCL is platform independent – and we hope to see it available in many more platforms very soon.

We’d like to add a 11-th: OpenCL can compile code during execution time

HiPEAC 2013

HiPEAC 2013


The 8th conference on High Performance and Embedded Architectures and Compilers will take place in Berlin. This might be a good chance to discuss heterogeneous systems, especially since professor Hwu, who is offering the online course of Heterogeneous Computing, will be delivering one of the keynote talks:


Keynote Monday, January 21st

8:45-9:45: Scalability, Portability, and Numerical Stability in Many-core Parallel Libraries (Wen-Mei Hwu, University of Illinois at Urbana-Champaign)


Conference webpage: http://www.hipeac.net/conference/berlin/keynotes

Happy 2013

Happy 2013


We at CMSoft would like to wish Happy New Year to all the parallel programming and computational math community. 2012 has been interesting and 2013 promises to be even more so considering GPUs and OpenCL are expected to arrive for mobile devices. This year we intend to bring OpenCL tutorials focused on processing Kinect data with OpenCL and double-precision computation.

Happy 2013!


OpenCLTemplate updated

OpenCLTemplate updated


We’ve updated OpenCLTemplate to Visual C# 2010 and to include the following functions:

Program.LoadFromSource() – loads a file into a string. Useful to load .CL files containing source to be compiled.

Variable and Image2D empty constructors to create OpenCL buffers without copying any content:

CLCalc.Program.Image2D emptyimage = new CLCalc.Program.Image2D(Cloo.ComputeImageChannelType.UnsignedInt8, width, height);
CLCalc.Program.Variable emptyarray = new CLCalc.Program.Variable(typeof(float),count);

Thanks to K Barni for this contribution.


Updating OpenCLTemplate to Visual C# 2010 will allow us to use .NET framwork’s Parallel instructions to optimize implentations in the near future.


Download OpenCLTemplate

Heterogeneous Computing Online Course

Heteronegenous Computing Online Course


Those interested in learning more about heterogeneous computing models (such as OpenCL and CUDA) should definitely take part or at least take a look at the Cousera Heterogeneous Parallel Programming Course, taught by Dr. Wen-mei W. Hwu at University of Illinois.

This is a great opportunity to learn the foundations of the architecture and get acquainted with basic CUDA commands. We at CMSoft will be taking part as well, and we’d be glad to join all of you online to create OpenCL content that goes beyond the programming assignments.

Intel Xeon Phi Supports OpenCL 1.2

Intel Xeon Phi Supports OpenCL 1.2


Intel Xeon Phi Coprocessor, consisting of various smaller, lower-power Intel cores (as per Intel’s own description), will support OpenCL 1.2 programmability (click to read more). It is possible that it will provide unbeatable performance on algorithms that are parallel to a coarser level, provided that the OpenCL programmer can balance the workload correctly.

Correctly exploiting the parallelism of algorithms is still a challenge, as James Reinders, Intel summarizes: “Most applications in the world have not been structured to exploit parallelism. This leaves a wealth of capabilities untapped on nearly every computer system.”

Intel Webinar and OpenCL

Intel Webinar and OpenCL


One of the greatest strengths of OpenCL as a heterogeneous programming tool is its capability to target multiple devices. While it’s normal to associate OpenCL, CUDA and massive parallel processing with GPUs, there are tasks which have coarser parallelism and can be better handled by CPUs.

In this upcoming Intel webinar they promise to demonstrate how to use the computing power of Intel hardware using OpenCL. This could be very useful if they discuss which types of algorithms are best suited for OpenCL targeting GPUs, OpenCL targeting CPUs and multithreading for CPUs with work stealing (like Microsoft’s Parallel.For or Intel’s own Silk developed at MIT).

CMSoft at AMD hcInnovators

CMSoft at AMD hcInnovators


We are proud to report that our work with OpenCL GL interop and simulation of heat transfer was recognized by the prestigious AMD Developer Central hcInnovators as relevant work in the field of heterogeneous computing.

Read our interview at AMD hcInnovator Spotlight.


Watch our video tutorial about Heat Transfer simulation:


Go to CMSoft Case Study: heat transfer simulation

Heat transfer simulation result


Watch on YouTube:

01 – Heat transfer simulation demonstration (05:38)
02 – Prerequisites and heat equation overview (07:48)
03 – Discretization of the heat equation (13:59)
04 – Sharing OpenGL textures with OpenCL (12:11)
05 – Mapping intensity to color using OpenCL (08:42)
06 – Simulating the heat equation system (28:49)
07 – Conclusion and wrap-up (06:14)



OpenCL Kinect Pottery

Virtual Pottery using Kinect and OpenCL/GL interop


The video below is a preview of CMSoft research in OpenCL OpenGL interoperation to create interactive virtual environments using Kinect.

In this demonstration, we create interactive deformation of a virtual mud body. Stay tuned for the upcoming tutorial on Using C# and OpenCL / GL Interop to Manipulate Kinect Data!