Symbol export - #2056
Draft
yhmtsai wants to merge 21 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tries to export the symbols manually.
It is passed on enabled ref/omp from my side, but it was mostly to enable the symbol when the compilation report unresolved symbol.
Thus, there will still be another round to ensure having the same logic on all of them.
MSVC has different logic on export and import than GCC/CLANG.
Also, Ginkgo has complex setting especially in core. For example, OmpExecutor has different copy is implemented in different backends.
In most cases, instantiation follows the visibility when declaring export in the template declaration in GCC/CLANG. Some needs to export them in instantiation explicitly. In MSVC, we always need to export them in instantiation/definition, but we still need to have them in declaration for importing.
Thus, I go for export/import in declaration and definition in both cases.
vtable symbol sometimes needs explicitly exported in GCC/CLANG but no need in MSVC.
MSVC does not like export the class, which uses std member.
If exporting the entire class, the class inheriting from the base class requires the base class fully imported. This also makes some difficulty in the current ginkgo structure.
In short, we only have export class for GCC/CLANG, but still export function on both side.
I will take the necessary part from GenerateExportHeader with the optional export on class macro.