path: root/docs/UsersManual.rst
diff options
authorDimitry Andric <dim@FreeBSD.org>2017-02-17 19:36:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-02-17 19:36:19 +0000
commiteb2854521a26d3f186018f1b119761ca7bb90dc2 (patch)
tree8cb7e2fc50b6c6580827cc26dc7c9a5921b4bdb2 /docs/UsersManual.rst
parent3bae5253046bf2859f76e3d0d22f47a5fc0844c7 (diff)
Vendor import of clang release_40 branch r295380:vendor/clang/clang-release_40-r295380
Notes: svn path=/vendor/clang/dist/; revision=313883 svn path=/vendor/clang/clang-release_40-r295380/; revision=313884; tag=vendor/clang/clang-release_40-r295380
Diffstat (limited to 'docs/UsersManual.rst')
1 files changed, 38 insertions, 1 deletions
diff --git a/docs/UsersManual.rst b/docs/UsersManual.rst
index 04023dd20602..6c8355776b7b 100644
--- a/docs/UsersManual.rst
+++ b/docs/UsersManual.rst
@@ -2056,6 +2056,8 @@ can be given manually.
In this case the kernel code should contain ``#include <opencl-c.h>`` just as a
regular C include.
+.. _opencl_cl_ext:
.. option:: -cl-ext
Disables support of OpenCL extensions. All OpenCL targets provide a list
@@ -2177,6 +2179,41 @@ To enable modules for OpenCL:
$ 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
+OpenCL Extensions
+All of the ``cl_khr_*`` extensions from `the official OpenCL specification
+up to and including version 2.0 are available and set per target depending on the
+support available in the specific architecture.
+It is possible to alter the default extensions setting per target using
+``-cl-ext`` flag. (See :ref:`flags description <opencl_cl_ext>` for more details).
+Vendor extensions can be added flexibly by declaring the list of types and
+functions associated with each extensions enclosed within the following
+compiler pragma directives:
+ .. code-block:: c
+ #pragma OPENCL EXTENSION the_new_extension_name : begin
+ // declare types and functions associated with the extension here
+ #pragma OPENCL EXTENSION the_new_extension_name : end
+For example, parsing the following code adds ``my_t`` type and ``my_func``
+function to the custom ``my_ext`` extension.
+ .. code-block:: c
+ #pragma OPENCL EXTENSION my_ext : begin
+ typedef struct{
+ int a;
+ }my_t;
+ void my_func(my_t);
+ #pragma OPENCL EXTENSION my_ext : end
+Declaring the same types in different vendor extensions is disallowed.
OpenCL Metadata
@@ -2215,7 +2252,7 @@ does not have any effect on the IR. For more details reffer to the specification
The implementation of this feature mirrors the unroll hint for C.