Author: hans Date: Thu Feb 16 11:10:08 2017 New Revision: 295340 URL: http://llvm.org/viewvc/llvm-project?rev=295340&view=rev Log: Merging r295313: ------------------------------------------------------------------------ r295313 | stulova | 2017-02-16 04:49:29 -0800 (Thu, 16 Feb 2017) | 9 lines
[OpenCL][Doc] Added OpenCL vendor extension description to user manual doc Added description of a new feature that allows to specify vendor extension in flexible way using compiler pragma instead of modifying source code directly (committed in clang@r289979). Review: D29829 ------------------------------------------------------------------------ Modified: cfe/branches/release_40/ (props changed) cfe/branches/release_40/docs/UsersManual.rst Propchange: cfe/branches/release_40/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Feb 16 11:10:08 2017 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291955,291963-291964,292032,292052,292183,292194,292247,292265,292497,292555,292558-292559,292561,292590,292800,292847,292874,292991,293043,293134,293360,293369,293596,293678,293787,294008,294800,294855,295149-295150 +/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291955,291963-291964,292032,292052,292183,292194,292247,292265,292497,292555,292558-292559,292561,292590,292800,292847,292874,292991,293043,293134,293360,293369,293596,293678,293787,294008,294800,294855,295149-295150,295313 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_40/docs/UsersManual.rst URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_40/docs/UsersManual.rst?rev=295340&r1=295339&r2=295340&view=diff ============================================================================== --- cfe/branches/release_40/docs/UsersManual.rst (original) +++ cfe/branches/release_40/docs/UsersManual.rst Thu Feb 16 11:10:08 2017 @@ -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 +<https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/EXTENSION.html>`_ +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 <https://www.khronos.org/registry/cl/specs/opencl-2.0-openclc.pdf#49>`_ -opencl_hint_unroll +opencl_unroll_hint ^^^^^^^^^^^^^^^^^^ The implementation of this feature mirrors the unroll hint for C. _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits