OpenCL 2.1 introduces C++ kernels

A couple of years ago I mentioned in passing about AMD’s static C++ extension for OpenCL and my hope that such an extension would make it into core OpenCL. It now looks like this will be the case as Khronos announces the provisional OpenCL 2.1 specification for public review which includes C++ as a supported kernel language. For me, this is the really big news in OpenCL 2.1 as the other features (sub-groups, clCloneKernel and low latency device timer queries) are simply adding polish to the OpenCL 2.0 specification as you’d expect from a point release. Adding C++ support is awesome news as it makes a whole range of kernels much simpler to write and allows developers to much more easily build up libraries of reusable code – containers and sorting spring immediately to mind.

The other fairly big piece of news is OpenCL gaining support for SPIR-V. At this moment in time it’s hard to say how big a deal this is as the other side of SPIR-V – its support in Vulkan – has yet to be publicly defined. From the Khronos press release “The use of SPIR-V by Vulkan and OpenCL will fundamentally reshape the graphics and compute ecosystem“. Whether this means a compiled OpenCL kernel can be used as a Vulkan compute shader and vice-versa or that both APIs will simply share the same binary container format is unclear.

The massive news that is the Vulkan announcement will have to be in another post 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *