Page MenuHomePhabricator

WIP: AMDGPU: Teach toolchain to link rocm device libs
Needs ReviewPublic

Authored by arsenm on Mar 13 2019, 1:22 PM.



This is pending finalization of what the device library build path/names are. I'm also not sure if some of the standard default library control flags should be used for these purposes, or if new ones are necessary

Diff Detail

Event Timeline

arsenm created this revision.Mar 13 2019, 1:22 PM
yaxunl added inline comments.Apr 3 2019, 11:34 AM
25 ↗(On Diff #190487)

I don't think we should detect ROCm installation here. We are compiling code for amdgpu not only on ROCm, but also on amdgpu-pro and windows. Many cases, people want to compile code for amdgpu on systems without ROCm installed.

Compiilng code for amdgpu does not really depend on ROCm. We only depend on device library.

It makes more sense to have a AMDGPUDeviceLibDetector which works on ROCm, amdgpu-pro, and windows. Also we need an option -amdgpu-device-lib-path to override the default amdgpu device lib path.

arsenm marked an inline comment as done.Apr 3 2019, 1:28 PM
arsenm added inline comments.
25 ↗(On Diff #190487)

Being able to cross compile without a rocm installation is one of my primary goals here. I don't know what the install paths look like for those other drivers. It would be best if everything could agree on a single default install location for these to search, which is mostly a naming problem. In the patch as-is, the rocm-path is serving as -amdgpu-device-lib-path, but this is a naming question

arsenm marked an inline comment as done.Nov 19 2019, 11:00 PM
arsenm added inline comments.
25 ↗(On Diff #190487)

Except we don't have an omni-purpose bitcode library set. It's the ROCm-Device-Libs. rocm is the only semi-coherently defined platform at the moment

Add Scott since this may affect comgr. Probably need to add -nodefaultlibs in comgr after this change.

yaxunl added inline comments.Nov 20 2019, 1:51 PM

debugging code needs to be removed