@@ -3065,23 +3065,26 @@ Compiling to bitcode can be done as follows:
3065
3065
This will produce a file `test.bc ` that can be used in vendor toolchains
3066
3066
to perform machine code generation.
3067
3067
3068
- Note that if compiled to bitcode for generic targets such as SPIR,
3068
+ Note that if compiled to bitcode for generic targets such as SPIR/SPIR-V ,
3069
3069
portable IR is produced that can be used with various vendor
3070
3070
tools as well as open source tools such as `SPIRV-LLVM Translator
3071
3071
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator> `_
3072
3072
to produce SPIR-V binary. More details are provided in `the offline
3073
3073
compilation from OpenCL kernel sources into SPIR-V using open source
3074
3074
tools
3075
3075
<https://github.com/KhronosGroup/OpenCL-Guide/blob/main/chapters/os_tooling.md> `_.
3076
+ From clang 14 onwards SPIR-V can be generated directly as detailed in
3077
+ :ref: `the SPIR-V support section <spir-v >`.
3076
3078
3077
3079
Clang currently supports OpenCL C language standards up to v2.0. Clang mainly
3078
3080
supports full profile. There is only very limited support of the embedded
3079
3081
profile.
3080
- Starting from clang 9 a C++ mode is available for OpenCL (see
3082
+ From clang 9 a C++ mode is available for OpenCL (see
3081
3083
:ref: `C++ for OpenCL <cxx_for_opencl >`).
3082
3084
3083
3085
OpenCL v3.0 support is complete but it remains in experimental state, see more
3084
- details about the experimental features in :doc: `OpenCLSupport ` page.
3086
+ details about the experimental features and limitations in :doc: `OpenCLSupport `
3087
+ page.
3085
3088
3086
3089
OpenCL Specific Options
3087
3090
-----------------------
@@ -3137,7 +3140,7 @@ Example disabling double support for the 64-bit SPIR-V target:
3137
3140
3138
3141
.. code-block :: console
3139
3142
3140
- $ clang -target spirv64 -cl-ext=-cl_khr_fp64 test.cl
3143
+ $ clang -c - target spirv64 -cl-ext=-cl_khr_fp64 test.cl
3141
3144
3142
3145
Enabling all extensions except double support in R600 AMD GPU can be done using:
3143
3146
@@ -3214,8 +3217,6 @@ Generic Targets
3214
3217
however :option: `-cl-ext ` flag can be used to toggle individual extensions and
3215
3218
features.
3216
3219
3217
-
3218
-
3219
3220
.. _opencl_header :
3220
3221
3221
3222
OpenCL Header
@@ -3427,6 +3428,7 @@ Example of use:
3427
3428
.. code-block :: console
3428
3429
3429
3430
clang -cl-std=clc++1.0 test.clcpp
3431
+ clang -cl-std=clc++ -c -target spirv64 test.cl
3430
3432
3431
3433
3432
3434
By default, files with ``.clcpp `` extension are compiled with the C++ for
@@ -3640,7 +3642,7 @@ To generate SPIR-V binaries, Clang uses the external ``llvm-spirv`` tool from th
3640
3642
Prior to the generation of SPIR-V binary with Clang, ``llvm-spirv ``
3641
3643
should be built or installed. Please refer to `the following instructions
3642
3644
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator#build-instructions> `_
3643
- for more details. Clang will expects the ``llvm-spirv `` executable to
3645
+ for more details. Clang will expect the ``llvm-spirv `` executable to
3644
3646
be present in the ``PATH `` environment variable. Clang uses ``llvm-spirv ``
3645
3647
with `the widely adopted assembly syntax package
3646
3648
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator/#build-with-spirv-tools> `_.
@@ -3692,6 +3694,10 @@ installation instructions
3692
3694
3693
3695
$ clang -target spirv64 test1.cl test2.cl
3694
3696
3697
+ More information about the SPIR-V target settings and supported versions of SPIR-V
3698
+ format can be found in `the SPIR-V target guide
3699
+ <https://llvm.org/docs/SPIRVUsage.html> `__.
3700
+
3695
3701
.. _clang-cl :
3696
3702
3697
3703
clang-cl
0 commit comments