This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Ensure wrapper headers are included on both host and device
ClosedPublic

Authored by jhuber6 on Aug 8 2023, 1:38 PM.

Details

Summary

For the in-progress GPU libc project we are relying on overlay headers to
handle the interfacing between the libc project and the host libc.
We need this to be included on both the host and device so they agree
one what is present on the device, otherwise we will end up with random
errors. For whatever reason this was not being included on the host
although it previously worked. This patch ensures that it's included on
both.

Diff Detail

Event Timeline

jhuber6 created this revision.Aug 8 2023, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 1:38 PM
Herald added a subscriber: guansong. · View Herald Transcript
jhuber6 requested review of this revision.Aug 8 2023, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 1:38 PM
arsenm added a subscriber: arsenm.Aug 8 2023, 2:22 PM
arsenm added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
1190–1193

can we do something better than this NVPTX||AMDGCN checks

jhuber6 added inline comments.Aug 8 2023, 2:23 PM
clang/lib/Driver/ToolChains/Clang.cpp
1190–1193

This is more or less "Are we one of the GPUs libc supports". This is for cross-compiling so there's no existing infrastructure.

yaxunl added inline comments.Aug 8 2023, 2:55 PM
clang/lib/Driver/ToolChains/Clang.cpp
1190–1193

maybe add a variable bool HasGPULibC as it is also used in other places below

jhuber6 added inline comments.Aug 8 2023, 3:00 PM
clang/lib/Driver/ToolChains/Clang.cpp
1190–1193

I think this is the only use right now.

yaxunl accepted this revision.Aug 8 2023, 3:08 PM

LGTM. Thanks

This revision is now accepted and ready to land.Aug 8 2023, 3:08 PM
This revision was landed with ongoing or failed builds.Aug 8 2023, 5:08 PM
This revision was automatically updated to reflect the committed changes.