@@ -3305,8 +3305,8 @@ to the target, for example:
3305
3305
3306
3306
.. code-block :: console
3307
3307
3308
- $ clang -target nvptx64-unknown-unknown test.cl
3309
- $ clang -target amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3308
+ $ clang -- target= nvptx64-unknown-unknown test.cl
3309
+ $ clang -- target= amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3310
3310
3311
3311
Compiling to bitcode can be done as follows:
3312
3312
@@ -3390,13 +3390,13 @@ Some extra options are available to support special OpenCL features.
3390
3390
3391
3391
.. code-block :: console
3392
3392
3393
- $ clang -c -target spirv64 -cl-ext=-cl_khr_fp64 test.cl
3393
+ $ clang -c -- target= spirv64 -cl-ext=-cl_khr_fp64 test.cl
3394
3394
3395
3395
Enabling all extensions except double support in R600 AMD GPU can be done using:
3396
3396
3397
3397
.. code-block :: console
3398
3398
3399
- $ clang -target r600 -cl-ext=-all,+cl_khr_fp16 test.cl
3399
+ $ clang -- target= r600 -cl-ext=-all,+cl_khr_fp16 test.cl
3400
3400
3401
3401
Note that some generic targets e.g. SPIR/SPIR-V enable all extensions/features in
3402
3402
clang by default.
@@ -3417,13 +3417,13 @@ There is a set of concrete HW architectures that OpenCL can be compiled for.
3417
3417
3418
3418
.. code-block :: console
3419
3419
3420
- $ clang -target amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3420
+ $ clang -- target= amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3421
3421
3422
3422
- For Nvidia architectures:
3423
3423
3424
3424
.. code-block :: console
3425
3425
3426
- $ clang -target nvptx64-unknown-unknown test.cl
3426
+ $ clang -- target= nvptx64-unknown-unknown test.cl
3427
3427
3428
3428
3429
3429
Generic Targets
@@ -3433,8 +3433,8 @@ Generic Targets
3433
3433
3434
3434
.. code-block :: console
3435
3435
3436
- $ clang -target spirv32 -c test.cl
3437
- $ clang -target spirv64 -c test.cl
3436
+ $ clang -- target= spirv32 -c test.cl
3437
+ $ clang -- target= spirv64 -c test.cl
3438
3438
3439
3439
More details can be found in :ref: `the SPIR-V support section <spir-v >`.
3440
3440
@@ -3445,8 +3445,8 @@ Generic Targets
3445
3445
3446
3446
.. code-block :: console
3447
3447
3448
- $ clang -target spir test.cl -emit-llvm -c
3449
- $ clang -target spir64 test.cl -emit-llvm -c
3448
+ $ clang -- target= spir test.cl -emit-llvm -c
3449
+ $ clang -- target= spir64 test.cl -emit-llvm -c
3450
3450
3451
3451
Clang will generate SPIR v1.2 compatible IR for OpenCL versions up to 2.0 and
3452
3452
SPIR v2.0 for OpenCL v2.0 or C++ for OpenCL.
@@ -3678,7 +3678,7 @@ Example of use:
3678
3678
.. code-block :: console
3679
3679
3680
3680
clang -cl-std=clc++1.0 test.clcpp
3681
- clang -cl-std=clc++ -c -target spirv64 test.cl
3681
+ clang -cl-std=clc++ -c -- target= spirv64 test.cl
3682
3682
3683
3683
3684
3684
By default, files with ``.clcpp `` extension are compiled with the C++ for
@@ -3926,8 +3926,8 @@ Example usage for OpenCL kernel compilation:
3926
3926
3927
3927
.. code-block :: console
3928
3928
3929
- $ clang -target spirv32 -c test.cl
3930
- $ clang -target spirv64 -c test.cl
3929
+ $ clang -- target= spirv32 -c test.cl
3930
+ $ clang -- target= spirv64 -c test.cl
3931
3931
3932
3932
Both invocations of Clang will result in the generation of a SPIR-V binary file
3933
3933
`test.o ` for 32 bit and 64 bit respectively. This file can be imported
@@ -3944,7 +3944,7 @@ the command line.
3944
3944
3945
3945
.. code-block :: console
3946
3946
3947
- $ clang -target spirv32 -fintegrated-objemitter -c test.cl
3947
+ $ clang -- target= spirv32 -fintegrated-objemitter -c test.cl
3948
3948
3949
3949
Note that only very basic functionality is supported at this point and therefore
3950
3950
it is not suitable for arbitrary use cases. This feature is only enabled when clang
@@ -3959,7 +3959,7 @@ installation instructions
3959
3959
3960
3960
.. code-block :: console
3961
3961
3962
- $ clang -target spirv64 test1.cl test2.cl
3962
+ $ clang -- target= spirv64 test1.cl test2.cl
3963
3963
3964
3964
More information about the SPIR-V target settings and supported versions of SPIR-V
3965
3965
format can be found in `the SPIR-V target guide
0 commit comments