-
Notifications
You must be signed in to change notification settings - Fork 808
[SYCL RTC] Introduce --auto-pch
support
#20226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
92d3176
to
fdabb7f
Compare
fdabb7f
to
91a06f2
Compare
91a06f2
to
d1ff0c3
Compare
d1ff0c3
to
73d087b
Compare
73d087b
to
14cc5df
Compare
14cc5df
to
aa66cf5
Compare
aa66cf5
to
193d044
Compare
193d044
to
960f581
Compare
--auto-pch
support--auto-pch
support
960f581
to
ae02915
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! This seems like a great feature. I have some comments / questions on the documentation and exact behavior, though. See below.
sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc
Outdated
Show resolved
Hide resolved
@tahonermann I assume your team is the one investigating this? I think this needs to be fixed before we can make a release with the |
Compilation of
#include <sycl/sycl.hpp>
is slow and that's especially problematic for SYCL RTC (run-time compilation). One way to overcome this is fine-grained includes that are being pursued separately. Another way is to employ clang's precompiled headers support which this PR is doing. Those two approaches can be combined, and this PR addstest-e2e/PerformanceTests/KernelCompiler/auto-pch.cpp
that gives some idea of the PCH impact. The test shows PCH benefits when compiling some of the fine-grained includes on top of absolute minimum required to compiled SYCL RTC's "Hello world". From one of the CI runs:It misses
sycl/sycl.hpp
line because that currently crashes FE when reading the generated PCH, the crash is being investigated/fixed separately.Implementation-wise I'm reusing existing upstream
clang::PrecompiledPreamble
with one minor modification. It seems thatPrecompiledPreamble
's main usage is for things likeclangd
so it ignores errors in the code. I've modified it so that those errors would break pch-generation the same way normal compilation would break. I'm also not sure if we'd want that long-term, because it seems that making such "auto-pch" persistent would deviate from the upstream version ofPrecompiledPreamble
even more. I can imagine that in some near future we'd need to "fork" it into a separate utility. Still, seems to be fine for the first step.Driver modifications are for the
--auto-pch
option support that should only be present on the SYCL RTC path and not for the regularclang
invocations from the command line. I'm relatively confident those will stay in future.