Page MenuHomePhabricator

[HIP] Remove the assertion on match between host/device names.
AbandonedPublic

Authored by hliao on Jun 6 2019, 11:57 AM.

Details

Reviewers
yaxunl
tra
Summary
  • Under different ABIs, it's obvious that assertion is too strong. Even under the same ABI, once there are unnamed type not required to follow ODR rule, host- and device-side mangling may still get different names. As both the host- and device-side compilation always observe the same AST tree, even with different names, we still could associate the correct pairs, i.e., we don't use (mangled) names to linkage host- and device-side globals. There's no need to have this assertion.

Event Timeline

hliao created this revision.Jun 6 2019, 11:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2019, 11:57 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yaxunl added a reviewer: tra.Jun 6 2019, 12:43 PM

LGTM. It seems no reason to assume the mangled name to be same on host and device side once anonymous types are mangled differently in host and device code. On windows, kernel has totally different names on host and device side without issues.

hliao added a comment.Jun 6 2019, 12:55 PM

a little explanation of the test case and what's issue is.

hliao marked 2 inline comments as done.Jun 6 2019, 12:58 PM
hliao added inline comments.
clang/test/CodeGenCUDA/unnamed-types.cu
5

device-side mangled name, notice that $_0 refers to the unnamed closure in f1.

24

the registration of host-side stub function to the device-side function name, which is defined in @0. Notice that the host-side stub function has $_1, which refers to the closure in f1 as there's another closure (host-only) in f0.

hliao added a comment.Jun 6 2019, 1:12 PM

I took this back. I fab a case where anonymous type IDs mismatch between the device-side name between host-compilation and device-compilation.

hliao abandoned this revision.Jun 6 2019, 1:13 PM