Skip to content

Commit 807fdae

Browse files
author
Artem Gindinson
authored
[SYCL][Doc] Update docs to reflect new compiler features (#4030)
* Documented ocloc case for chosen GEN architecture compatibility * Updated recommendation for 3rd party host compiler use Signed-off-by: Artem Gindinson <[email protected]>
1 parent db20bab commit 807fdae

File tree

2 files changed

+42
-22
lines changed

2 files changed

+42
-22
lines changed

sycl/doc/CompilerAndRuntimeDesign.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,18 @@ used:
317317
The driver passes the `-device skl` parameter directly to the Gen device backend
318318
compiler `ocloc` without parsing it.
319319

320-
**TBD:** Having multiple code forms for the same target in the fat binary might
321-
mean invoking device compiler multiple times. Multiple invocations are not
322-
needed if these forms can be dumped at various compilation stages by the single
323-
device compilation, like SPIR-V → visa → ISA. But if e.g. `gen9:visa3.2` and
324-
`gen9:visa3.3` are needed at the same time, then some mechanism is needed.
325-
Should it be a dedicated target triple for each needed visa version or Gen
326-
generation?
320+
`ocloc` is also capable of offline compilation for several ISA
321+
versions/Gen architectures. For example, to make the device binary
322+
compatible with all Intel Gen9 GPU platforms, one could use:
323+
324+
```
325+
-fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice
326+
-Xsycl-target-backend "-device gen9"
327+
```
328+
329+
For more details on supported platforms and argument syntax, refer to
330+
the GPU offline compiler manual by detecting your local `ocloc`
331+
installation and running `ocloc compile --help`.
327332

328333
#### Separate Compilation and Linking
329334

sycl/doc/FAQ.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,36 @@ specific build options.
2929
linked into the final binary, the compilation steps sequence is more
3030
complicated compared to the usual C++ flow.
3131

32-
In general, we encourage our users to rely on the DPC++ Compiler for handling
33-
all of the compilation phases "under the hood". However, thorough understanding
34-
of the above-described steps may allow you to customize your compilation by
35-
invoking different phases manually. As an example, you could:
36-
1. preprocess your host code with another C++-capable compiler;
37-
2. turn to the DPC++ compiler for generating the integration header and
38-
compiling the device code for the needed target(s);
39-
3. use your preferred host compiler from 1) to compile your preprocessed host
40-
code and the integration header into a host object file;
41-
4. link the host object file and the device image(s) into the final executable.
42-
43-
To learn more about the concepts behind this flow, and the DPC++ Compiler
44-
internals as such, we welcome you to study our
45-
[DPC++ Compiler and Runtime architecture design](CompilerAndRuntimeDesign.md)
46-
document.
32+
In general, we encourage our users to rely on the DPC++ Compiler for
33+
handling all of the compilation phases "under the hood". However,
34+
certain use-cases may involve third-party compiler usage for host-side
35+
compilation. The DPC++ compiler provides the
36+
`-fsycl-host-compiler=<compiler_name>` option, which allows one to
37+
specify the desired third-party compiler name. Usage example:
38+
39+
```
40+
clang++ -fsycl -fsycl-host-compiler=g++
41+
-fsycl-host-compiler-options="-g" test.cpp
42+
```
43+
44+
45+
Implicitly, the above command would:
46+
1. turn to the DPC++ compiler for compiling the device code for the
47+
needed target(s) and generating dependencies ("integration files") for
48+
the host side;
49+
2. detect your preferred host compiler (`g++`, in this case), then use
50+
it to compile your host code and the dependency files from 1) into
51+
host object file(s);
52+
3. link the device image(s) from 1) and the host object(s) from 2)
53+
into the final executable.
54+
55+
To learn more about the compiler options mentioned, and the DPC++
56+
compiler command-line interface in general, please refer to the
57+
[DPC++ Compiler User Manual](UsersManual.md).
58+
To learn more about the concepts behind this flow, and the DPC++
59+
Compiler internals as such, we welcome you to study our
60+
[DPC++ Compiler and Runtime architecture design](
61+
CompilerAndRuntimeDesign.md) document.
4762

4863

4964
## Using applications built with DPC++

0 commit comments

Comments
 (0)