Anastasia created this revision. Anastasia added reviewers: Topotuna, svenvh. Herald added subscribers: Naghasan, ebevhan, yaxunl. Anastasia requested review of this revision.
This patch contains an update of C++ for OpenCL 2021 support status along with other misc updates: - OpenCL 3.0 - Bugzilla -> Github issues https://reviews.llvm.org/D116271 Files: clang/docs/OpenCLSupport.rst clang/docs/UsersManual.rst
Index: clang/docs/UsersManual.rst =================================================================== --- clang/docs/UsersManual.rst +++ clang/docs/UsersManual.rst @@ -41,8 +41,8 @@ variants depending on base language. - :ref:`C++ Language <cxx>` - :ref:`Objective C++ Language <objcxx>` -- :ref:`OpenCL Kernel Language <opencl>`: OpenCL C v1.0, v1.1, v1.2, v2.0, - plus C++ for OpenCL. +- :ref:`OpenCL Kernel Language <opencl>`: OpenCL C 1.0, 1.1, 1.2, 2.0, 3.0, + and C++ for OpenCL 1.0 and 2021. In addition to these base languages and their dialects, Clang supports a broad variety of language extensions, which are documented in the @@ -3303,20 +3303,25 @@ <https://www.khronos.org/registry/OpenCL/specs/2.2/pdf/OpenCL_Cxx.pdf>`_ and there is no plan to support it in clang in any new releases in the near future. - -Clang currently supports C++ for OpenCL v1.0. +Clang currently supports C++ for OpenCL 1.0 and 2021. For detailed information about this language refer to the C++ for OpenCL Programming Language Documentation available in `the latest build <https://www.khronos.org/opencl/assets/CXX_for_OpenCL.html>`_ or in `the official release -<https://github.com/KhronosGroup/OpenCL-Docs/releases/tag/cxxforopencl-v1.0-r2>`_. +<https://github.com/KhronosGroup/OpenCL-Docs/releases/tag/cxxforopencl-docrev2021.12>`_. To enable the C++ for OpenCL mode, pass one of following command line options when -compiling ``.cl`` file ``-cl-std=clc++``, ``-cl-std=CLC++``, ``-cl-std=clc++1.0``, -``-cl-std=CLC++1.0``, ``-std=clc++``, ``-std=CLC++``, ``-std=clc++1.0`` or -``-std=CLC++1.0``. +compiling ``.clcpp`` file: + +- C++ for OpenCL 1.0: ``-cl-std=clc++``, ``-cl-std=CLC++``, ``-cl-std=clc++1.0``, + ``-cl-std=CLC++1.0``, ``-std=clc++``, ``-std=CLC++``, ``-std=clc++1.0`` or + ``-std=CLC++1.0``. + +- C++ for OpenCL 2021: ``-cl-std=clc++2021``, ``-cl-std=CLC++2021``, + ``-std=clc++2021``, ``-std=CLC++2021``. +Example of use: .. code-block:: c++ template<class T> T add( T x, T y ) @@ -3333,15 +3338,27 @@ .. code-block:: console - clang -cl-std=clc++ test.cl + clang -cl-std=clc++1.0 test.clcpp + -Alternatively, files with ``.clcpp`` extension are compiled with the C++ for OpenCL -mode. +By default, files with ``.clcpp`` extension are compiled with the C++ for +OpenCL 1.0 mode. .. code-block:: console clang test.clcpp +For backward compatibility files with ``.cl`` extensions can also be compiled +in C++ for OpenCL mode but the desirable language mode must be activated with +a flag. + + .. code-block:: console + + clang -cl-std=clc++ test.cl + +Support of C++ for OpenCL 2021 is currently in experimental phase, refer to +:doc:`OpenCLSupport` for more details. + C++ for OpenCL kernel sources can also be compiled online in drivers supporting `cl_ext_cxx_for_opencl <https://www.khronos.org/registry/OpenCL/extensions/ext/cl_ext_cxx_for_opencl.html>`_ Index: clang/docs/OpenCLSupport.rst =================================================================== --- clang/docs/OpenCLSupport.rst +++ clang/docs/OpenCLSupport.rst @@ -18,15 +18,16 @@ ================== Clang has complete support of OpenCL C versions from 1.0 to 2.0. +There is an ongoing work to support :ref:`OpenCL 3.0 <opencl_300>`. Clang also supports :ref:`the C++ for OpenCL kernel language <cxx_for_opencl_impl>`. -There is an ongoing work to support :ref:`OpenCL 3.0 <opencl_300>`. - -There are also other :ref:`new and experimental features <opencl_experimenal>` available. +There are also other :ref:`new and experimental features <opencl_experimenal>` +available. -For general issues and bugs with OpenCL in clang refer to `Bugzilla -<https://bugs.llvm.org/buglist.cgi?component=OpenCL&list_id=172679&product=clang&resolution=--->`__. +For general issues and bugs with OpenCL in clang refer to `the following Github issue +list +<https://github.com/llvm/llvm-project/issues?q=is%3Aopen+is%3Aissue+label%3Aopencl>`__. Internals Manual ================ @@ -127,7 +128,7 @@ .. code-block:: console - $ clang -target spir-unknown-unknown -c -emit-llvm -Xclang -finclude-default-header -fmodules -fimplicit-module-maps -fm odules-cache-path=<path to the generated module> test.cl + $ clang -target spir-unknown-unknown -c -emit-llvm -Xclang -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=<path to the generated module> test.cl Another way to circumvent long parsing latency for the OpenCL builtin declarations is to use mechanism enabled by :ref:`-fdeclare-opencl-builtins @@ -319,24 +320,32 @@ C++ for OpenCL Implementation Status ==================================== -Clang implements language version 1.0 published in `the official +Clang implements language version 1.0 and 2021 published in `the official release of C++ for OpenCL Documentation -<https://github.com/KhronosGroup/OpenCL-Docs/releases/tag/cxxforopencl-v1.0-r2>`_. +<https://github.com/KhronosGroup/OpenCL-Docs/releases/tag/cxxforopencl-docrev2021.12>`_. Limited support of experimental C++ libraries is described in the :ref:`experimental features <opencl_experimenal>`. -Bugzilla bugs for this functionality are typically prefixed +Github issues for this functionality are typically prefixed with '[C++4OpenCL]' - click `here -<https://bugs.llvm.org/buglist.cgi?component=OpenCL&list_id=204139&product=clang&query_format=advanced&resolution=---&short_desc=%5BC%2B%2B4OpenCL%5D&short_desc_type=allwordssubstr>`__ +<https://github.com/llvm/llvm-project/issues?q=is%3Aissue+is%3Aopen+%5BC%2B%2B4OpenCL%5D>`__ to view the full bug list. Missing features or with limited support ---------------------------------------- -- IR generation for global destructors is incomplete (See: +- Support of C++ for OpenCL 2021 is currently in experimental phase. Refer to + :ref:`OpenCL 3.0 status <opencl_300>` for details of common missing + functionality from OpenCL 3.0. + +- IR generation for non-trivial global destructors is incomplete (See: `PR48047 <https://llvm.org/PR48047>`_). +- Support of `destrutors with non-default address spaces + <https://www.khronos.org/opencl/assets/CXX_for_OpenCL.html#_construction_initialization_and_destruction>`_ + is incomplete (See: `D109609 <https://reviews.llvm.org/D109609>`_). + .. _opencl_300: OpenCL C 3.0 Usage @@ -408,8 +417,8 @@ Clang provides the following new WIP features for the developers to experiment and provide early feedback or contribute with further improvements. Feel free to contact us on `cfe-dev -<https://lists.llvm.org/mailman/listinfo/cfe-dev>`_ or via `Bugzilla -<https://bugs.llvm.org/>`__. +<https://lists.llvm.org/mailman/listinfo/cfe-dev>`_ or file `a Github issue +<https://github.com/llvm/llvm-project/issues/new>`_. .. _opencl_experimental_cxxlibs:
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits