-
Notifications
You must be signed in to change notification settings - Fork 34
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
♻️ Move templated function and methods to header files for reuse in dd sim #856
base: main
Are you sure you want to change the base?
♻️ Move templated function and methods to header files for reuse in dd sim #856
Conversation
… for reuse in other packages
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #856 +/- ##
=======================================
- Coverage 92.3% 92.3% -0.1%
=======================================
Files 137 136 -1
Lines 13619 13618 -1
Branches 2104 2104
=======================================
- Hits 12575 12570 -5
- Misses 1044 1048 +4
🚀 New features to boost your workflow:
|
45cc0d7
to
cf80f8a
Compare
…eader file for use in other packages
cf80f8a
to
a338162
Compare
the linter errors, that |
Hm. That's a strange one. But I suppose this is somewhat due to the functions being templated so they are essentially inlined in the compilation units where they are needed. Clang-tidy does not really perform that well with templates like these. // NONLINTNEXTLINE(misc-include-cleaner) right before the probalematic import. I believe you could technically make the code compile by removing the include in the header file and adding it to the source file where the I have a more general idea though. If I am not mistaken that would reduce this PR to removing that one In the long-run, I truly hope that we can completely eliminate the templates and just switch to a runtime config for the various compute and unique tables. That needs proper benchmarking though, as it also means that we have to switch from Does that make sense? |
As far as i know, explicit instantiation only work in the same file. Also tried it with a small example and count not get it to compile with template definitions in source files and explicit instantiation in another file. Am i missing something? I think compile times are not that bad atm, It probably could be improved if containers (e.g. UniqueTable) are type agnostic. |
I can fist start working on making the MemoryManager and UniqueTable less templated to improve compile times. Then, only FunctionalityConstruction would be affected by more code in header files. Would this be an acceptable solution? |
Hm. I remember getting that to work somehow. But maybe I am just misremembering.
That sounds very reasonable. |
Description
Moved several templated function definitions with explicit instantiation in source files to the header files. This is the first step for moving the deterministic noise simulation from core to mqt-ddsim, allowing the other repo to reuse much of the code when moving
dNode
anddEdge
.Checklist: