[SYCL] Add Support for Precompiled Headers#22357
Conversation
Remove the restriction of using PCH with SYCL. PCH files can be created with: clang -fsycl -c -x c++-header header.h This precompiles the header file header.h once for the device target, and once for the host. The individual pch files generated are then bundled to form a fat header.pchi binary. PCH files can be used with: clang -fsycl -c -include-pch header.pchi file.cpp This unbundles the fat header.pchi file into its respective target components and uses the unbundled pchi files in the device target and host compilations. In the old offload driver model, clang-offload-bundler is used for bundling and unbundling; in the new model, llvm-offload-binary is used.
|
There seems to be some testing issue with the original PR #21491 ; |
|
@mdtoguchi, I missed your review comments from earlier today in the other PR. |
|
@mdtoguchi, thanks again for your review comments in #21491. Unfortunately, due to stale bits, some tests fail there. I have addressed most of your comments in fd1a93e
There were three other places you commented on - I have added inline comments in this PR for those. |
| // WS_USE_OND: clang{{.*}} "-triple" "x86_64{{.*}}"{{.*}} "-fsycl-is-host" | ||
| // WS_USE_OND-SAME: "-include-pch" "[[PCHFILE1]]"{{.*}} | ||
|
|
||
| // Windows |
There was a problem hiding this comment.
| // Windows |
nit - you already marked 'Windows' above.
|
@intel/llvm-gatekeepers please consider merging |
Remove the restriction of using PCH with SYCL.
PCH files can be created with:
clang -fsycl -c -x c++-header header.h
This precompiles the header file header.h once for the device target,
and once for the host. The individual pch files generated are then
bundled to form a fat header.pchi binary.
PCH files can be used with:
clang -fsycl -c -include-pch header.pchi file.cpp
This unbundles the fat header.pchi file into its respective target components
and uses the unbundled pchi files in the device target and host compilations.
In the old offload driver model, clang-offload-bundler is used for bundling and
unbundling; in the new model, llvm-offload-binary is used.