@@ -29,21 +29,36 @@ specific build options.
2929linked into the final binary, the compilation steps sequence is more
3030complicated 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