-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[flang][cuda] Enable cuda with -x cuda option #84944
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
! Test -fcuda option | ||
! RUN: %flang -fc1 -cpp -fcuda -fdebug-unparse %s -o - | FileCheck %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a RUN line without enabling CUDA? Otherwise it's hard to see what's being tested and what the impact of enabling CUDA is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without it, it would just fail during parsing. Do you want a run line that check the failure? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
|
||
program main | ||
#if _CUDA | ||
integer :: var = _CUDA | ||
#endif | ||
integer, device :: dvar | ||
end program | ||
|
||
! CHECK-LABEL: PROGRAM main | ||
! CHECK: INTEGER :: var = 1 | ||
! CHECK: INTEGER, DEVICE :: dvar |
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 wonder if we also want to wire it to clang's
-x cuda
option. It might be good to use the same flags for clang/flang in makefiles/cmake. Though, I am not sure if the meaning of the two options is exactly the same. Maybe someone else knows.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 don't quite understand what actually
-fcuda
enables. Could the flag be more descriptive and the help text expanded? Also, what's the equivalent in Clang? We ought to keep both drivers in sync.In particular, if this is something specific to Flang then I would avoid generic names like
-fcuda
.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 switch to use the
-x cuda
option which has a similar meaning.