Visible to Intel only — GUID: GUID-A3170FF3-5CB0-49E0-A02A-4CBD5AE0F8E6
Visible to Intel only — GUID: GUID-A3170FF3-5CB0-49E0-A02A-4CBD5AE0F8E6
Single Source Compilation
The oneAPI programming model supports single source compilation. Single source compilation has several benefits compared to separate host and device code compilation. It should be noted that the oneAPI programming model also supports separate host and device code compilation as some users may prefer it. Advantages of the single source compilation model include:
Usability – programmers need to create fewer files and can define device code right next to the call site in the host code.
Extra safety – single source means one compiler can see the boundary code between host and device and the actual parameters generated by host compiler will match formal parameters of the kernel generated by the device compiler.
Optimization - the device compiler can perform additional optimizations by knowing the context from which a kernel is invoked. For instance, the compiler may propagate some constants or infer pointer aliasing information across the function call.