Skip to content

Commit 7f245a1

Browse files
committed
Adjust documentation for aliases and make sure -Xsycl-target* applies
1 parent 7234777 commit 7f245a1

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void SYCLToolChain::TranslateTargetOpt(const llvm::opt::ArgList &Args,
671671
OptNoTriple = A->getOption().matches(Opt);
672672
if (A->getOption().matches(Opt_EQ)) {
673673
// Passing device args: -X<Opt>=<triple> -opt=val.
674-
if (A->getValue() != getTripleString())
674+
if (getDriver().MakeSYCLDeviceTriple(A->getValue()) != getTriple())
675675
// Provided triple does not match current tool chain.
676676
continue;
677677
} else if (!OptNoTriple)

clang/test/Driver/sycl-offload.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,9 @@
820820
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice \
821821
// RUN: -Xsycl-target-backend=spir64_gen-unknown-unknown-sycldevice "-device skl -cl-opt-disable" -Xsycl-target-linker=spir64-unknown-unknown-sycldevice "-cl-denorms-are-zero" %s 2>&1 \
822822
// RUN: | FileCheck -check-prefixes=CHK-TOOLS-MULT-OPTS,CHK-TOOLS-MULT-OPTS-NEG %s
823+
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64,spir64_gen \
824+
// RUN: -Xsycl-target-backend=spir64_gen "-device skl -cl-opt-disable" -Xsycl-target-linker=spir64 "-cl-denorms-are-zero" %s 2>&1 \
825+
// RUN: | FileCheck -check-prefixes=CHK-TOOLS-MULT-OPTS,CHK-TOOLS-MULT-OPTS-NEG %s
823826
// CHK-TOOLS-MULT-OPTS: clang-offload-wrapper{{.*}} "-link-opts=-cl-denorms-are-zero"{{.*}} "-target=spir64"
824827
// CHK-TOOLS-MULT-OPTS: ocloc{{.*}} "-device" "skl"{{.*}} "-cl-opt-disable"
825828
// CHK-TOOLS-MULT-OPTS-NEG-NOT: clang-offload-wrapper{{.*}} "-compile-opts=-device skl -cl-opt-disable"{{.*}} "-target=spir64"

sycl/doc/GetStartedGuide.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,19 +490,21 @@ clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda-sycldevice \
490490
```
491491
492492
To build simple-sycl-app ahead of time for GPU, CPU or Accelerator devices,
493-
specify the target architecture:
493+
specify the target architecture. The examples provided use a supported
494+
alias for the target, representing a full triple. Additional details can
495+
be found in the [Users Manual](UsersManual.md#generic-options).
494496
495-
```-fsycl-targets=spir64_gen-unknown-unknown-sycldevice``` for GPU,
496-
```-fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice``` for CPU,
497-
```-fsycl-targets=spir64_fpga-unknown-unknown-sycldevice``` for Accelerator.
497+
```-fsycl-targets=spir64_gen``` for GPU,
498+
```-fsycl-targets=spir64_x86_64``` for CPU,
499+
```-fsycl-targets=spir64_fpga``` for Accelerator.
498500
499501
Multiple target architectures are supported.
500502
501503
E.g., this command builds simple-sycl-app for GPU and CPU devices in
502504
ahead of time mode:
503505
504506
```bash
505-
clang++ -fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice,spir64_x86_64-unknown-unknown-sycldevice simple-sycl-app.cpp -o simple-sycl-app-aot.exe
507+
clang++ -fsycl -fsycl-targets=spir64_gen,spir64_x86_64 simple-sycl-app.cpp -o simple-sycl-app-aot.exe
506508
```
507509
508510
Additionally, user can pass specific options of AOT compiler to

sycl/doc/UsersManual.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ and not recommended to use in production environment.
3131
Intel FPGA;
3232
* spir64_gen-unknown-unknown-sycldevice - generate code ahead of time for
3333
Intel Processor Graphics;
34+
Shorter aliases of the above triples can also be used:
35+
* spir64, spir64_x86_64, spir64_fpga, spir64_gen
3436
Available in special build configuration:
3537
* nvptx64-nvidia-cuda-sycldevice - generate code ahead of time for CUDA
3638
target;

0 commit comments

Comments
 (0)