-
Notifications
You must be signed in to change notification settings - Fork 74
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
Precompiled Header Support #858
Comments
An earlier investigation of precompiled headers for alpaka: #383 |
Yes, but CMake's 3.16 support for PCH is very different from cotire, according to one CMake maintainers. Definitely worth trying again, especially since we already do unity builds anyway. |
Sounds good to me. Unfortunately, I'm not really familiar with CMake. I presented the idea of PCH in a meeting a few weeks earlier and checked if an implementation with CMake 3.16 could be useful. But if you say it could work, it's fine with me :-) |
I think we just need to add selected headers to our CMake target(s), as described here: |
Since this will likely be the next step of the efforts in #919: Which headers would we want to precompile? All of them? A subset? User's choice (= precompile individual concepts)? Since Alpaka is installable: Should there also be an option to install PCHs? As far as I understand they would be limited to a specific compiler. It might be more sensible to generate PCHs on the fly for the user's target. |
I do not think that installing precompiled headers is useful. |
I think precompiled headers will become obsolete in C++20, because we can just |
That's correct, but I think it will take some time, until we can move to c++ modules. Therefore, I think it is still useful to test PCH. |
Precompiled headers can reduce compilation time. It works like object files for cpp files. In special cases, templates should be accelerated because a compiled version of the generic template is stored in the precompiled header. Theoretically, it should reduce compilation time. Practically, I'm not sure, so someone has to test it.
CMake 3.16 supports PCH, so testing and integration should not be too difficult.
Implementation details:
https://clang.llvm.org/docs/PCHInternals.html
https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
https://docs.microsoft.com/en-us/cpp/build/creating-precompiled-header-files?view=vs-2019
https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-pch
The text was updated successfully, but these errors were encountered: