This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in complex wrapper headers.
ClosedPublic

Authored by fodinabor on Oct 29 2020, 12:17 PM.

Details

Summary

This is very similar to 7f1e6fcff942, just fixing a left-over.
With this, it should be possible to use both, -x cuda and -fopenmp in the same invocation,
enabling to use both OpenMP, targeting CPU, and CUDA, targeting the GPU.

Diff Detail

Event Timeline

fodinabor created this revision.Oct 29 2020, 12:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2020, 12:17 PM
fodinabor requested review of this revision.Oct 29 2020, 12:17 PM
fodinabor edited the summary of this revision. (Show Details)Oct 29 2020, 12:19 PM
fodinabor added reviewers: hfinkel, tra.
jdoerfert accepted this revision.Oct 29 2020, 1:06 PM

You need to define & undefine the macro around the includes of __clang_cuda_complex_builtins.h in clang/lib/Headers/openmp_wrappers/complex and clang/lib/Headers/openmp_wrappers/complex.h. (see also rG7f1e6fcff942) That should fix the tests. Assuming the tests pass, LGTM.

For release 11, can you file a bug and prepare a patch that applies to the relevant branch?

This revision is now accepted and ready to land.Oct 29 2020, 1:06 PM
fodinabor updated this revision to Diff 301726.Oct 29 2020, 1:23 PM
fodinabor edited the summary of this revision. (Show Details)

Add missing macro definitions.

Thanks, will land it later.

For the bug see: https://bugs.llvm.org/show_bug.cgi?id=48014
Do I have to create a new phabricator review, too?
I'm currently building the release/11.x branch with the patch cherry-picked (which worked flawlessly).

This revision was landed with ongoing or failed builds.Oct 29 2020, 3:25 PM
This revision was automatically updated to reflect the committed changes.

Thanks, will land it later.

For the bug see: https://bugs.llvm.org/show_bug.cgi?id=48014
Do I have to create a new phabricator review, too?
I'm currently building the release/11.x branch with the patch cherry-picked (which worked flawlessly).

CC tstellar@redhat.com in the bug and ask for it to be merged. Attach the patch file to the bug. At least that is (one way) how it works I think.