Today Khronos has released OpenCL 2.2 with SPIR-V 1.2.
The most important changes are:
This is what we said about the release:
“We are very excited and happy to see OpenCL C++ kernel language being a part of the OpenCL standard,” said Vincent Hindriksen, founder and managing director of StreamHPC. “It’s a great achievement, and it shows that OpenCL keeps progressing. After developing conformance tests for OpenCL 2.2 and helping finalizing OpenCL C++ specification, we are looking forward to work on first projects with OpenCL 2.2 and the new kernel language. My team believes that using OpenCL C++ instead of OpenCL C will result in improved software quality, reduced maintenance effort and faster time to market. We expect SPIR-V to heavily impact the compiler ecosystem and bring several new OpenCL kernel languages.”
We’ve written a guide to port C-kernels to C++-kernels. The guidelines are a set of guidelines for developers who know OpenCL C and plan to port their kernels to OpenCL C++, and therefore they need to know the main differences. As some differences may cause hard-to-detect bugs when porting to OpenCL C++, it’s important to read the document carefully. Developers who are familiar with OpenCL C and C++ should find OpenCL C++ easy to learn.
We put it on Github, so you can send a MR if you see mistakes or omissions.
A lot of work already has been done, but there is enough room for improvement. This is what you can do:
Due to success with open sourcing almost anything with Vulkan, OpenCL follows its lead. At the Khronos Github, you’ll find the following repos:
Outside Khronos’s Github you’ll also find OpenCL.2.0 support in LLVM Clang. This means that with the existing open source backends (like AMDGPU and NVPTX) the open source OpenCL compiler POCL could be made.
You might have heard we upgraded the OpenCL Compiler Conformance Tests to 2.2. Besides the upgrade, we also put efforts in cleaning up the code together with the OpenCL working-group – all to prepare for the open sourcing of the tests.
All is under an Apache license. This goes two ways: easier testing and easier fixing. Khronos invites everybody to send merge requests for test they have developed. I think Mikael Lepistö and the CLSmith team are very pleased.
You can find the tests here. There is also a testing framework by the University of Windsor that eases the building of the tests. It downloads all tests, builds itself, and then builds conformance tests. You can get it here.
Important: only Khronos can label your product as conformant.
The conformance tests are tightly connected to the specifications. A problem in one is a problem in the other.
What if the specification is unclear and needs extra clarification? What if a test has been added, but the specification is less or more restrictive? You can now create a pull request on Github to get it solved.
The documentation files are here.
Imagination Technologies was ready in time to get the full 2.2 implemented as of today. On their new PowerVR Series8XT GPUs it will be possible to run OpenCL 2.2 C++ kernels or any other SPIR-V 1.2 frontend.
We’re waiting for the rest to come up with their (beta) OpenCL 2.2 drivers.