. .

Tag: c++


CozyCL: a comfortable OpenCL library


CozyCL is a very simple, minimalist OpenCL library. You can run programs on your graphics card pretty easily with it, without the need to know anything about the data types of the base libraries (at least for the host program). When I started to learn about GPU programming in the previous weeks, I found even the most handy C++ bindings pretty time-consuming for a beginner, who is mostly interested in getting positive feedback and sense of achievement after a couple of initial attempts.


Multi-threaded Buddhabrot fractal rendering in C++ for 16 bit/channel post-processing


I’ve written the major part of this Buddhabrot rendering program in last August, and after a six months break I carried on with it again this weekend to close the project finally. But before going into details, let`s see what it does:


An easy-to-use Simplex solver class


Few days ago I decided to create a C++ implementation of the Simplex algorithm, which is a tool for solving Linear Programming problems. One of my motivations could have been my recent encounter with the Eigen linear algebra library, which really surprised me with its beautiful syntax and easy usage.  So I wanted to gain a little experience with Eigen, although some factorization-related project might have suited this purpose better. Another motivational factor was a not yet published project of mine, which might get finished in 1 or 2 months, and would give LP a real application.


Exception class with printf-like parameters for C++

When raising exceptions it is good to make their error texts as detailed as possible. Usually this isn’t an easy task, cause it involves type conversions and string operations. This is why I’ve implemented this class, which can be instantiated by printf-like parameters as easily as this line: throw(new FException("Invalid tag: ‘%s’. At line: %d.", tag, line));


Threading events and Intel Building Blocks

The Intel Threading Building Blocks library (TBB) is a useful cross-platform C++ library, which contains many high and low level tools for developing multi-threaded applications. One feature I required but couldn’t find in TBB is a class similar to AutoResetEvent in the .NET framework. That class allows simple synchronization of two threads. One of them is waiting the event to be triggered, while the other triggers the event at a point. I have implemented this class in C++, using atomic operations from TBB, which guaranties that if the two threads are running on different cores, then their caches get synced