Monday 29 March 2010

Easy OpenCL Library Makes Feeding Babies More Difficult Than Writing OpenCL

Ha ha! Yeah, right! It's interesting to see libraries become available for OpenCL. I've seen two so far. That's Simplified OpenCL (SOCL) from Matt Reilly and libstdcl from Brown Deer Technology. Both these are linked from the AMD page here .

How useful are these? I have to confess I don't know. I want to get to grips with the nuts and bolts of OpenCL and parallel programming before I give into temptation and use other libraries.

The other thing is that it's easy to get confused. You have to learn the wrapper library. If you do that without understanding what's going on under the hood, it just makes solving problems more difficult.

So I think I'll get to the point where I really feel comfortable with the OpenCL APIs. At that stage, when things start to feel a bit repetitive and tiresome, I'll checkout those libraries to see how they can make life easier.

There's another point I'd like to make. Libraries are undoubtably useful to perform standard tasks. For example, NVIDIA provide for CUDA the CUDPP library. That could do everything I want in the scan example. After all, I just want to add a few numbers together. But for other tasks, if you want to make the most out of the acceleration you can get from the GPU, it seems to me that there is no easy option. You have to think deeply about your problem.

Imagine that you are the manager at a distribution centre. Until now you have one worker assigned to you. One day, your boss arrives and tells you that the investment capital they always dreamed of is now available. Six thousand workers will be assigned under your control. Helping them realise their potential will require careful consideration.

Parallel computing is a new paradigm. You now have thousands of hardware threads at your disposal. But that doesn't mean you can just do thousands of the same thing the same old way at the same time. Instead, you have to reconsider everything. The resources available and the problem at hand are inextricably linked in realising the optimal solution. Libraries are another tool - albeit a very useful one - in your OpenCL arsenal.

And in any case, who said feeding babies was easy?

No comments:

Post a Comment