[cfe-dev] RFC: Adding support for an OpenCL 3.0 compatible C++ for OpenCL 2021

Ole Marius Strohm via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 4 04:55:54 PDT 2021


Hi, all!

As OpenCL C 3.0 is getting support in clang there is a wish to expand C++ for
OpenCL to be compatible with OpenCL 3.0 as well. Being able to support OpenCL
3.0 is important in making C++ for OpenCL a viable option for as many platforms
as possible.

Arm is therefore proposing adding a new version of C++ for OpenCL which will
add support for OpenCL 3.0. This version will aim to be backwards compatible
with OpenCL C 3.0.  This will involve a new language version of C++ for OpenCL,
currently called C++ for OpenCL 2021 in the draft of the new documentation [1].

----- Implementation Details -----

As the biggest changes in OpenCL 3.0 are making some 2.0 features optional, and
a lot of work as already been done in clang to support OpenCL C 3.0 [2] there
shouldn't be a need for any big conceptual changes in clang as a result of this
work. Our hope is to reuse the work done for OpenCL C 3.0 and apply similar
logic to C++ mode.

Most of the work is expected to be related to making the 'generic' address space
optional. Currently this address space is used for several implicitly generated
constructors and operators, so these will need to be adjusted.

This should still be able to leverage work done for OpenCL C 3.0. For example
this has already dealt with detecting when the 'generic' address space is
available. This can then be used to adjust the current C++ for OpenCL
implementation without requiring large scale changes.

----------------------------------

As mentioned, the linked documentation is only a draft and will be revised and
finalized along with the implementation.

If you have any thoughts or comments, please make contact.

Thanks,
Ole

[1] https://github.com/KhronosGroup/OpenCL-Docs/pull/616
[2] https://lists.llvm.org/pipermail/cfe-dev/2020-September/066883.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210804/6addd948/attachment.html>


More information about the cfe-dev mailing list