@@ -24,25 +24,19 @@ provide path to SYCL headers directory. Please, refer to you compiler manual
24
24
to learn about specific build options.
25
25
26
26
### Q: How are SYCL compilation phases different from those of a usual C++ compiler? Can I customize this flow for my applications?
27
- ** A:** Due to the fact that both host and device code need to be compiled and linked into the final binary, the following steps are
28
- added to the usual C++ compiler flow:
29
- 1 . Device code needs to be compiled separately to produce a separate device image. The toolchains invoked may slightly differ depending on whether
30
- you wish to compile the device kernels "ahead-of-time", or let the device code be JIT-compiled in runtime. Here, the greatest difference
31
- would be a device-specific BE compiler getting invoked in ahead-of-time compilation mode.
32
- 2 . To link host/device objects successfully, a so-called integration header needs to be generated. In nature, it is a usual C++ header file
33
- that makes use of OpenCL API. It is automatically produced by SYCL compiler after device code analysis. SYCL compiler mixes the integration
34
- header into the preprocessed host code, and only then compiles all relevant files into a host object (.o) file.
27
+ ** A:** Due to the fact that both host and device code need to be compiled and linked into the final binary, the compilation steps sequence
28
+ is more complicated compared to the usual C++ flow.
35
29
36
30
In general, we encourage our users to rely on SYCL Compiler for handling all of the compilation phases "under the hood". However, thorough
37
31
understanding of the above-described steps may allow you to customize your compilation by invoking different phases manually.
38
32
As an example, you could:
39
33
1 . preprocess your host code with another C++-capable compiler;
40
34
2 . turn to SYCL compiler for generating the integration header and compiling the device code for the needed target(s);
41
35
3 . use your preferred host compiler from 1) to compile your preprocessed host code and the integration header into a host object;
42
- 4 . use your preferred linker to link the host object and the device image(s) into the final executable.
36
+ 4 . link the host object and the device image(s) into the final executable.
43
37
44
- To learn more about the concepts mentioned , and the internals of SYCL compiler as such, we welcome you to study our
45
- [ SYCL Compiler and Runtime architecture design] ( SYCLCompilerAndRuntimeDesign.md )
38
+ To learn more about the concepts behind this flow , and the internals of SYCL compiler as such,
39
+ we welcome you to study our [ SYCL Compiler and Runtime architecture design] ( SYCLCompilerAndRuntimeDesign.md )
46
40
document.
47
41
48
42
0 commit comments