mesa
18.3.3
About: Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics (main library code). Latest release.
![]() ![]() |
For many large applications C++ is the language of choice and so it seems reasonable to define C++ bindings for OpenCL.
The interface is contained with a single C++ header file cl.hpp and all definitions are contained within the namespace cl. There is no additional requirement to include cl.h and to use either the C++ or original C bindings it is enough to simply include cl.hpp.
The bindings themselves are lightweight and correspond closely to the underlying C API. Using the C++ bindings introduces no additional execution overhead.
For detail documentation on the bindings see:
The OpenCL C++ Wrapper API 1.1 (revision 04) http://www.khronos.org/registry/cl/specs/opencl-cplusplus-1.1.pdf
The following example shows a general use case for the C++ bindings, including support for the optional exception feature and also the supplied vector and string classes, see following sections for decriptions of these features.