Page MenuHomePhabricator

[HIP] Move std headers after device malloc/free
ClosedPublic

Authored by ashi1 on Jul 9 2021, 8:49 AM.

Details

Summary

Set the device malloc and free functions as weak,
and move the std headers after device malloc/free
to avoid issues with std malloc/free.

Diff Detail

Event Timeline

ashi1 requested review of this revision.Jul 9 2021, 8:49 AM
ashi1 created this revision.
ashi1 updated this revision to Diff 357599.Jul 9 2021, 12:29 PM

Thanks, added a test.

yaxunl added inline comments.Jul 9 2021, 1:27 PM
clang/test/Headers/hip-header.hip
29–34

can we reuse the first RUN line instead of adding a new one?

123

need to check definition of malloc for linkage and name mangling. same for free. we do not need to check test_malloc and test_free.

ashi1 updated this revision to Diff 357630.Jul 9 2021, 2:02 PM
ashi1 marked 2 inline comments as done.

Updated the checks in the hip test.

yaxunl accepted this revision.Jul 9 2021, 2:16 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 9 2021, 2:16 PM
This revision was landed with ongoing or failed builds.Jul 9 2021, 2:21 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2021, 2:21 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript