From 221cda3719bf550afdcf72be42555b444b339805 Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Wed, 30 Jun 2021 20:13:37 +0300 Subject: [PATCH 1/3] [SYCL][Doc] Update docs to reflect new compiler features Signed-off-by: Artem Gindinson --- sycl/doc/CompilerAndRuntimeDesign.md | 17 ++++++++++------- sycl/doc/FAQ.md | 22 ++++++++++++++-------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/sycl/doc/CompilerAndRuntimeDesign.md b/sycl/doc/CompilerAndRuntimeDesign.md index 444d767ced69a..148f414969bf6 100644 --- a/sycl/doc/CompilerAndRuntimeDesign.md +++ b/sycl/doc/CompilerAndRuntimeDesign.md @@ -317,13 +317,16 @@ used: The driver passes the `-device skl` parameter directly to the Gen device backend compiler `ocloc` without parsing it. -**TBD:** Having multiple code forms for the same target in the fat binary might -mean invoking device compiler multiple times. Multiple invocations are not -needed if these forms can be dumped at various compilation stages by the single -device compilation, like SPIR-V → visa → ISA. But if e.g. `gen9:visa3.2` and -`gen9:visa3.3` are needed at the same time, then some mechanism is needed. -Should it be a dedicated target triple for each needed visa version or Gen -generation? +`ocloc` is also capable of offline compilation for several ISA +versions/Gen architectures. For example, to make the device binary +compatible with all Intel Gen9 GPU platforms, one could use: + +`-fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice +-Xsycl-target-backend "-device gen9"` + +For more details on supported platforms and argument syntax, refer to +the GPU offline compiler manual by detecting your local `ocloc` +installation and running `ocloc compile --help`. #### Separate Compilation and Linking diff --git a/sycl/doc/FAQ.md b/sycl/doc/FAQ.md index fd3c86d5c2ddf..418156d639c49 100644 --- a/sycl/doc/FAQ.md +++ b/sycl/doc/FAQ.md @@ -30,16 +30,22 @@ linked into the final binary, the compilation steps sequence is more complicated compared to the usual C++ flow. In general, we encourage our users to rely on the DPC++ Compiler for handling -all of the compilation phases "under the hood". However, thorough understanding -of the above-described steps may allow you to customize your compilation by -invoking different phases manually. As an example, you could: -1. preprocess your host code with another C++-capable compiler; -2. turn to the DPC++ compiler for generating the integration header and +all of the compilation phases "under the hood". However, certain use-cases +may involve third-party compiler usage for host-side compilation. The DPC++ +compiler provides the `-fsycl-host-compiler=` option, which +allows one to specify the desired third-party compiler name. Usage example: + +`clang++ -fsycl -fsycl-host-compiler=g++ -fsycl-host-compiler-options="-g" test.cpp` + +Implicitly, the above command would: +1. turn to the DPC++ compiler for generating the integration header and compiling the device code for the needed target(s); -3. use your preferred host compiler from 1) to compile your preprocessed host -code and the integration header into a host object file; -4. link the host object file and the device image(s) into the final executable. +2. detect your preferred host compiler (`g++`, in this case) and use it to +compile your host code and the integration header from 1) into a host object file; +3. link the host object file and the device image(s) into the final executable. +To learn more about the compiler options mentioned, and the DPC++ compiler CLI +in general, please refer to the [DPC++ Compiler User Manual](UsersManual.md). To learn more about the concepts behind this flow, and the DPC++ Compiler internals as such, we welcome you to study our [DPC++ Compiler and Runtime architecture design](CompilerAndRuntimeDesign.md) From a0f4fc406b087b9f0a98770ea754b6c52e225a46 Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Wed, 30 Jun 2021 20:51:33 +0300 Subject: [PATCH 2/3] Address review comments Signed-off-by: Artem Gindinson --- sycl/doc/FAQ.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sycl/doc/FAQ.md b/sycl/doc/FAQ.md index 418156d639c49..f75ffca096666 100644 --- a/sycl/doc/FAQ.md +++ b/sycl/doc/FAQ.md @@ -38,14 +38,15 @@ allows one to specify the desired third-party compiler name. Usage example: `clang++ -fsycl -fsycl-host-compiler=g++ -fsycl-host-compiler-options="-g" test.cpp` Implicitly, the above command would: -1. turn to the DPC++ compiler for generating the integration header and -compiling the device code for the needed target(s); -2. detect your preferred host compiler (`g++`, in this case) and use it to -compile your host code and the integration header from 1) into a host object file; -3. link the host object file and the device image(s) into the final executable. - -To learn more about the compiler options mentioned, and the DPC++ compiler CLI -in general, please refer to the [DPC++ Compiler User Manual](UsersManual.md). +1. turn to the DPC++ compiler for compiling the device code for the needed +target(s) and generating dependencies ("integration files") for the host side; +2. detect your preferred host compiler (`g++`, in this case), then use it to +compile your host code and the dependency files from 1) into host object file(s); +3. link the device image(s) from 1) and the host object(s) from 2) into +the final executable. + +To learn more about the compiler options mentioned, and the DPC++ compiler +command-line interface in general, please refer to the [DPC++ Compiler User Manual](UsersManual.md). To learn more about the concepts behind this flow, and the DPC++ Compiler internals as such, we welcome you to study our [DPC++ Compiler and Runtime architecture design](CompilerAndRuntimeDesign.md) From 6096745e4df10d3a7dd14dd9b54825d228b50bdc Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Wed, 30 Jun 2021 21:09:01 +0300 Subject: [PATCH 3/3] Limit line length to 80 characters Signed-off-by: Artem Gindinson --- sycl/doc/CompilerAndRuntimeDesign.md | 6 ++-- sycl/doc/FAQ.md | 46 ++++++++++++++++------------ 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/sycl/doc/CompilerAndRuntimeDesign.md b/sycl/doc/CompilerAndRuntimeDesign.md index 148f414969bf6..44874cfbde60f 100644 --- a/sycl/doc/CompilerAndRuntimeDesign.md +++ b/sycl/doc/CompilerAndRuntimeDesign.md @@ -321,8 +321,10 @@ compiler `ocloc` without parsing it. versions/Gen architectures. For example, to make the device binary compatible with all Intel Gen9 GPU platforms, one could use: -`-fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice --Xsycl-target-backend "-device gen9"` +``` +-fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice +-Xsycl-target-backend "-device gen9" +``` For more details on supported platforms and argument syntax, refer to the GPU offline compiler manual by detecting your local `ocloc` diff --git a/sycl/doc/FAQ.md b/sycl/doc/FAQ.md index f75ffca096666..3d0bdab941b4a 100644 --- a/sycl/doc/FAQ.md +++ b/sycl/doc/FAQ.md @@ -29,28 +29,36 @@ specific build options. linked into the final binary, the compilation steps sequence is more complicated compared to the usual C++ flow. -In general, we encourage our users to rely on the DPC++ Compiler for handling -all of the compilation phases "under the hood". However, certain use-cases -may involve third-party compiler usage for host-side compilation. The DPC++ -compiler provides the `-fsycl-host-compiler=` option, which -allows one to specify the desired third-party compiler name. Usage example: +In general, we encourage our users to rely on the DPC++ Compiler for +handling all of the compilation phases "under the hood". However, +certain use-cases may involve third-party compiler usage for host-side +compilation. The DPC++ compiler provides the +`-fsycl-host-compiler=` option, which allows one to +specify the desired third-party compiler name. Usage example: + +``` +clang++ -fsycl -fsycl-host-compiler=g++ +-fsycl-host-compiler-options="-g" test.cpp +``` -`clang++ -fsycl -fsycl-host-compiler=g++ -fsycl-host-compiler-options="-g" test.cpp` Implicitly, the above command would: -1. turn to the DPC++ compiler for compiling the device code for the needed -target(s) and generating dependencies ("integration files") for the host side; -2. detect your preferred host compiler (`g++`, in this case), then use it to -compile your host code and the dependency files from 1) into host object file(s); -3. link the device image(s) from 1) and the host object(s) from 2) into -the final executable. - -To learn more about the compiler options mentioned, and the DPC++ compiler -command-line interface in general, please refer to the [DPC++ Compiler User Manual](UsersManual.md). -To learn more about the concepts behind this flow, and the DPC++ Compiler -internals as such, we welcome you to study our -[DPC++ Compiler and Runtime architecture design](CompilerAndRuntimeDesign.md) -document. +1. turn to the DPC++ compiler for compiling the device code for the +needed target(s) and generating dependencies ("integration files") for +the host side; +2. detect your preferred host compiler (`g++`, in this case), then use +it to compile your host code and the dependency files from 1) into +host object file(s); +3. link the device image(s) from 1) and the host object(s) from 2) +into the final executable. + +To learn more about the compiler options mentioned, and the DPC++ +compiler command-line interface in general, please refer to the +[DPC++ Compiler User Manual](UsersManual.md). +To learn more about the concepts behind this flow, and the DPC++ +Compiler internals as such, we welcome you to study our +[DPC++ Compiler and Runtime architecture design]( +CompilerAndRuntimeDesign.md) document. ## Using applications built with DPC++