This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Do not unbundle object files for -fno-gpu-rdc
ClosedPublic

Authored by yaxunl on Mar 4 2019, 12:00 PM.

Details

Summary

When -fno-gpu-rdc is set, device code is compiled, linked, and assembled into fat binary
and embedded as string in object files. The object files are normal object files which
can be linked by host linker. In the linking stage, the object files should not be unbundled
when -fno-gpu-rdc is set since they are normal object files, not bundles. The object files
only need to be unbundled when -fgpu-rdc is set.

Currently clang always unbundles object files, disregarding -fgpu-rdc option.

This patch fixes that.

Diff Detail

Event Timeline

yaxunl created this revision.Mar 4 2019, 12:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2019, 12:00 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
tra added a subscriber: ABataev.Mar 4 2019, 1:13 PM

The change looks OK as far as regular CUDA is concerned.
That said, I'm not quite familiar with the use of bundling/unbundling actions and you should probably get someone who uses/depends on them to take a look. I think OpenMP uses them. Perhaps @ABataev would be the right person.

ABataev accepted this revision.Mar 5 2019, 6:29 AM

LG with a nit

lib/Driver/Driver.cpp
2298

Set the default initializer for the field

This revision is now accepted and ready to land.Mar 5 2019, 6:29 AM
yaxunl marked an inline comment as done.Mar 5 2019, 7:00 AM
yaxunl added inline comments.
lib/Driver/Driver.cpp
2298

will do. thanks.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2019, 8:09 AM