aboutsummaryrefslogtreecommitdiff
path: root/clang/docs/OpenCLSupport.rst
diff options
context:
space:
mode:
authorAnton Zabaznov <anton.zabaznov@intel.com>2021-05-21 14:07:23 +0300
committerAnton Zabaznov <anton.zabaznov@intel.com>2021-05-21 15:01:19 +0300
commit826905787ae4c8540bb8a2384fac59c606c7eaff (patch)
treef737da042402f518e458d3ce1a09dc1cdbd8fd6c /clang/docs/OpenCLSupport.rst
parent469833f418e1704331f8dccb06ccd391f8d726e1 (diff)
downloadllvm-826905787ae4c8540bb8a2384fac59c606c7eaff.zip
llvm-826905787ae4c8540bb8a2384fac59c606c7eaff.tar.gz
llvm-826905787ae4c8540bb8a2384fac59c606c7eaff.tar.bz2
[OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64
There already exists cl_khr_fp64 extension. So OpenCL C 3.0 and higher should use the feature, earlier versions still use the extension. OpenCL C 3.0 API spec states that extension will be not described in the option string if corresponding optional functionality is not supported (see 4.2. Querying Devices). Due to that fact the usage of features for OpenCL C 3.0 must be as follows: ``` $ clang -Xclang -cl-ext=+cl_khr_fp64,+__opencl_c_fp64 ... $ clang -Xclang -cl-ext=-cl_khr_fp64,-__opencl_c_fp64 ... ``` e.g. the feature and the equivalent extension (if exists) must be set to the same values Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D96524
Diffstat (limited to 'clang/docs/OpenCLSupport.rst')
-rw-r--r--clang/docs/OpenCLSupport.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/clang/docs/OpenCLSupport.rst b/clang/docs/OpenCLSupport.rst
index fa719c8..dbfb67f 100644
--- a/clang/docs/OpenCLSupport.rst
+++ b/clang/docs/OpenCLSupport.rst
@@ -339,7 +339,24 @@ Missing features or with limited support
.. _opencl_300:
-OpenCL 3.0 Implementation Status
+OpenCL C 3.0 Usage
+================================
+
+OpenCL C 3.0 language standard makes most OpenCL C 2.0 features optional. Optional
+functionality in OpenCL C 3.0 is indicated with the presence of feature-test macros
+(list of feature-test macros is `here <https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#features>`_).
+Command-line flag :ref:`-cl-ext <opencl_cl_ext>` can be used to override features supported by a target.
+
+For cases when there is an associated extension for a specific feature (fp64 and 3d image writes)
+user should specify both (extension and feature) in command-line flag:
+
+ .. code-block:: console
+
+ $ clang -cc1 -cl-std=CL3.0 -cl-ext=+cl_khr_fp64,+__opencl_c_fp64 ...
+ $ clang -cc1 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64,-__opencl_c_fp64 ...
+
+
+OpenCL C 3.0 Implementation Status
================================
The following table provides an overview of features in OpenCL C 3.0 and their