This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Support hipRTC in header
ClosedPublic

Authored by yaxunl on Apr 16 2021, 7:59 AM.

Details

Summary

hipRTC compiles HIP device code at run time. Since the system may not
have development tools installed, when a HIP program is compiled through
hipRTC, there is no standard C or C++ header available. As such, the HIP
headers should not depend on standard C or C++ headers when used
with hipRTC. Basically when hipRTC is used, HIP headers only provides
definitions of HIP device API functions. This is in line with what nvRTC does.

This patch adds support of hipRTC to HIP headers in clang. Basically hipRTC
defines a macro __HIPCC_RTC__ when compile HIP code at run time. When
this macro is defined, HIP headers do not include standard C/C++ headers.

Diff Detail

Event Timeline

yaxunl requested review of this revision.Apr 16 2021, 7:59 AM
yaxunl created this revision.
yaxunl edited the summary of this revision. (Show Details)
tra accepted this revision.Apr 16 2021, 9:26 AM
This revision is now accepted and ready to land.Apr 16 2021, 9:26 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2021, 8:35 AM