This is an archive of the discontinued LLVM Phabricator instance.

Enable CUDA Fortran support to bbc with -fcuda
AcceptedPublic

Authored by wangzpgi on Jul 20 2023, 2:29 PM.

Details

Summary

Enable CUDA Fortran support to bbc with -fcuda

Diff Detail

Event Timeline

wangzpgi created this revision.Jul 20 2023, 2:29 PM
Herald added a project: Restricted Project. · View Herald Transcript
wangzpgi requested review of this revision.Jul 20 2023, 2:29 PM
This revision is now accepted and ready to land.Jul 20 2023, 2:37 PM
wangzpgi updated this revision to Diff 542681.Jul 20 2023, 2:43 PM

Using "git show HEAD -U999999 > mypatch.patch" to show more context of the file.

razvanlupusoru added inline comments.Jul 20 2023, 3:00 PM
flang/tools/bbc/bbc.cpp
422

I don't think you need the change to define _CUDA. The preprocessor entry for this should be enabled solely by enabling the language feature. (parsing.cpp does it).

Since there is no language versioning, I don't think you need to do it the same as _OPENACC. This is required for _OPENACC because the tool sets the desired language level. And this macro must be defined as part of OpenACC spec.

Please add a test.

wangzpgi updated this revision to Diff 543661.Jul 24 2023, 11:39 AM

Remove definition of _CUDA 1.

wangzpgi marked an inline comment as done.Jul 24 2023, 11:42 AM

Please add a test.

Currently CUDA Fortran is not supported in FIR, there is no correct FIR to check at this moment. So I will add a test later once the support is there.

Please add a test.

Currently CUDA Fortran is not supported in FIR, there is no correct FIR to check at this moment. So I will add a test later once the support is there.

I think I am going to add a test in Driver for testing the switch bbc -fcuda. Please stay tuned. Thanks

wangzpgi updated this revision to Diff 546651.Aug 2 2023, 5:08 PM

Add a test for testing the -fcuda option for bbc.

wangzpgi updated this revision to Diff 546656.Aug 2 2023, 5:33 PM
wangzpgi added a reviewer: PeteSteinfeld.

Modified the test so that it's not tied to the value of _CUDA, which is not the intention of this test.
This test is to test that -fcuda option works for bbc.

clementval accepted this revision.Aug 2 2023, 5:35 PM

Still LGTM

razvanlupusoru accepted this revision.Aug 2 2023, 5:49 PM

Looks good to me. Thank you!

awarzynski accepted this revision.Aug 3 2023, 12:48 AM

Thanks for adding a test, LGTM!

Please add a test.

Currently CUDA Fortran is not supported in FIR, there is no correct FIR to check at this moment. So I will add a test later once the support is there.

Perhaps this flag should be added when FIR is updated to support CUDA?

PeteSteinfeld accepted this revision.Aug 3 2023, 7:43 AM

All builds and tests correctly and looks good.

Congratulations on your first patch!