-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[Flang-new][OpenMP] Add bitcode files for AMD GPU OpenMP #96742
Merged
DominikAdamski
merged 10 commits into
llvm:main
from
DominikAdamski:flang_mlink_builtin_bitcode
Jul 29, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5b487aa
[Flang-new][OpenMP] Add offload related flags for AMDGPU
DominikAdamski 8f50d61
Merge branch 'upstream_main' into flang_mlink_builtin_bitcode
DominikAdamski 8252dbe
Fixes after #96909
DominikAdamski efd4056
apply nogpulib only for AMD GPU tests
DominikAdamski 223bf97
Merge branch 'main' into flang_mlink_builtin_bitcode
DominikAdamski f2e362e
Revert "Fixes after #96909"
DominikAdamski 7bddef7
Revert "Revert "Fixes after #96909""
DominikAdamski 1135e32
Merge branch 'main' into flang_mlink_builtin_bitcode
DominikAdamski d78721f
Merge branch 'main' into flang_mlink_builtin_bitcode
DominikAdamski 8f194d2
Merge branch 'main' into flang_mlink_builtin_bitcode
DominikAdamski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
Should there be some kind of warning if these flags are used not with AMDGPU? I don't have a strong opinion here as it is only an fc1 flag.
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.
+1 to having better diagnostics
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.
Hi,
thanks for the feedback. I would like to share my observations with you:
mlink-builtin-bitcode
option for OpenMP Nvidia GPU as well .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.
Does that mean that this change would also lead to adding these flags when building for Nvidia GPU with flang?
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.
No. My change does not imply any changes for Nvidia GPUs support.
Flang and Clang share the same LLVM backend which consumes generated LLVM IR. For AMD GPU we need to embed bitcode definitions of GPU math functions. AMD toolchain adds all required options to the compiler invocation for AMD GPU and IMO can be reused between Flang and Clang.
I don't know if Nvidia also want to reuse their toolchain between Clang and Flang to fully support OpenMP offloading.
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.
It's OK to make Flang "stricter" if we believe that's the right thing to do ;-) (I think that generating useful error/warning messages like "don't mix these flags - that's not supporter" would be a good thing)
Are there any plans to extract that logic and share it somewhere?
Who could be the right person to ask?
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.
Shall I extend #94763 ? I don't use
-fcuda-is-device
anymore. Now, I'm only adding-mlink-builtin-bitcode
flags toflang-new -fc1
command. The-mlink-builtin-bitcode
option was introduced by #94763Not yet (at least from my side). I can return to this topic if there is need to support Clang option by Flang for AMD GPU.
I don't know. Open-source LLVM Flang meetings can be good place to ask this question.
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.
Yes, please.
Did you ask? What feedback did you get?
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.
I asked question on flang-compiler slack (openmp/openacc channel). If I get no response, I will raise question on Flang technical community call on Monday.