diff --git a/sycl/doc/design/OffloadDesign.md b/sycl/doc/design/OffloadDesign.md index 6d64a53b4e4e6..35a86d2184ea2 100644 --- a/sycl/doc/design/OffloadDesign.md +++ b/sycl/doc/design/OffloadDesign.md @@ -251,6 +251,21 @@ The `--device-compiler` option uses the format `--device-compiler=[:][` and `` are matched against the current compilation target. Only arguments that match both the offloading kind and target triple will be passed to the backend compiler. If `` is not specified, the arguments will match any offloading kind; if `` is not specified, the arguments will match any target triple; and if neither is specified, the arguments will be applied to all targets. +To support multiple device architectures, a new `--device-compiler` option must be specified for each device. For example, to compile for Ponte Vecchio (PVC) and Skylake (SKL) architectures and put them in a fat binary, the user must add the following two `--device-compiler` options: + +`--device-compiler=sycl:spir64_gen-unknown-unknown=-device pvc -options ...` + +`--device-compiler=sycl:spir64_gen-unknown-unknown=-device skl -options ...` + +Device specific options for each of the device architectures should be specified after `-device `. + +Here is an example of a clang-linker-wrapper invocation where ther user wants to create a fat binary with PVC and SKL architectures to be run on a x86_64 Linux host. In addition, they would like to enable aggressive mathematical optimizations and are tolerant for slightly imprecise floating-point values just for SKL, that is, use the `-cl-unsafe-math-optimizations` flag. For PVC, they would like to enable the multiply and add instruction usage (`-cl-mad-enable`). The source binaries are called host.o and kernel.o and the output should be called out.exe. + +`clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu + --device-compiler=sycl:spir64_gen-unknown-unknown=-device pvc -options "-cl-mad-enable" + --device-compiler=sycl:spir64_gen-unknown-unknown=-device skl -options "-cl-unsafe-math-optimizations" -- /usr/bin/ld +host.o kernel.o -o out.exe` + #### Other Supported Options To complete the support needed for the various targets using the `clang-linker-wrapper` as the main interface, a few additional options will