To support separate compile/link and linking across device IR in different source files,
a new HIP action builder is introduced. Basically it compiles/links host and device
code separately, and embed fat binary in host linking stage through linker script.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
Skip backend and assemmbler phases for amdgcn since it does not support linking of object files.
lib/Driver/Driver.cpp | ||
---|---|---|
2221 | for(auto Arch: GpuArchList) | |
2265–2272 | Please reformat. | |
2330–2332 | Single-statement for does not need braces. | |
2485–2493 | I'm not sure I understand what happens here and the comment does not help. Does the comment mean that *only in linking mode* do we need to add dependency on device actions? |
lib/Driver/Driver.cpp | ||
---|---|---|
2221 | will do | |
2265–2272 | will do | |
2330–2332 | will do | |
2485–2493 | Modified the comment to make it clearer. We only add dependency on device action at linking phase. HIP embeds device image in host image in host linking phase. Since we need to link all device actions, we cannot create link action here since we have not went through all device actions yet. We just save device actions to DeviceLinkerInputs and create device link action later in appendLinkDependences, where all device actions have been went through. |
One nit. LGTM otherwise.
test/Driver/cuda-phases.cu | ||
---|---|---|
15 | Please wrap long RUN lines in all tests. |
test/Driver/cuda-phases.cu | ||
---|---|---|
15 | will do when commit. Thanks! |
for(auto Arch: GpuArchList)