-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[Flang][FlangRT][Runtime] Add RT_OFFLOAD_API_GROUP_BEGIN to missing symbols on AMDGPU #147612
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
Conversation
…ymbols on AMDGPU After the recent move to work queues, in certain cases when linking in the fortran runtime built for offload on AMDGPU as required in certain cases, we'll get missing symbols when linking. This PR tries to address this issue by encompassing more of the library in RT_OFFLOAD_API_GROUP_BEGIN, which has the affect of compiling these functions for AMDGPU, resolving the missing symbols.
There's possibly a less intrusive/simpler way of resolving this, if so please don't hesitate to suggest it! :-) |
Thank you for the changes! I wish clang supported I guess a less intrusive way would be to expand |
If I understand correctly, this is related to #145888 - can you please add a reference into the description? |
Yes, I actually thought we already had the implicit marking in Clang C++/OpenMP, but it seems to not be the case, or at least it doesn't handle more complicated cases unfortunately! :-) So sadly need to be a bit more generous with the RT_OFFLOAD_API_GROUP_BEGIN macros, which isn't the prettiest or best thing for compile times long term I imagine.
I'd personally prefer to keep it as close to OpenMP standard acceptable as possible, mainly so other OpenMP compilers can come along and compile the runtime if they'd like to (I do think OpenMP does support the attribute specifier syntax in the more recent standard, but I may be misremembering) ! But happy to make this change if you feel it'd be better! :-) |
I didn't actually notice this issue, I ran into the problem separately in some map tests I have! Thank you for pointing me to it, yes, I do believe this would fix that issue, at least the symbols referenced look similar, if it doesn't fix them all I'd be happy to create a subsequent PR to fix the rest. I'll alter the description just now to add the issue, thank you again :-)! |
I second this. Let's keep this PR as-is. It would be worth "fixing" clang to apply |
Sounds good! :-)
It would indeed, I am unfortunately not the best person to do it I think unfortunately, aware of how it works in Flang, but not Clang as of yet... but I can bring it up internally and maybe someone will have the bandwidth to look at it. Thank you very much for the review @vzakhari |
After the recent move to work queues, in certain cases when linking in the fortran runtime built for offload on AMDGPU as required in certain cases, we'll get missing symbols when linking. This PR tries to address this issue by encompassing more of the library in RT_OFFLOAD_API_GROUP_BEGIN, which has the affect of compiling these functions for AMDGPU, resolving the missing symbols.
This PR should address the following issue: #145888