Skip to main content

Khronos Blog

OpenCL C to OpenCL C++ Porting Guidelines

On May 16, OpenCL 2.2 was released by Khronos Group. The most important part of the new OpenCL version is support for OpenCL C++ kernel language, which is defined as a static subset of the C++14 standard.  OpenCL C++ introduces long-awaited features such as classes, templates, lambda expressions, function and operator overloads, and several other constructs which increase parallel programming productivity through generic programming.

The question is how to quickly make use of it. Unfortunately most examples in the various SDKs are written in C, and are not yet translated to C++. To simplify the process, Jakub Szuppe of Stream HPC created a document with porting guidelines for developers who know OpenCL C but need to know the main differences between those two kernel languages.

The main focus is on exposing the most important differences between OpenCL C++ and OpenCL C, and also those which may cause hard-to-detect bugs when porting to OpenCL C++. Developers who are familiar with both OpenCL C and C++ should find OpenCL C++ easy to learn.

You can find the guidelines here, hosted on Github. We welcome feedback from the community - simply file a new issue with any comments.