This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][GPU] Add target arguments to SerializeToHsaco
ClosedPublic

Authored by krzysz00 on Nov 17 2021, 10:30 AM.

Details

Summary

Compiling code for AMD GPUs requires knowledge of which chipset is
being targeted, especially if the code uses chipset-specific
intrinsics (which is the case in a downstream convolution generator).
This commit adds target, chipset and features arguments to the
SerializeToHsaco constructor to enable passing in this required
information.

It also amends the ROCm integration tests to pass in the target
chipset, which is set to the chipset of the first GPU on the system
executing the tests.

Diff Detail

Event Timeline

krzysz00 created this revision.Nov 17 2021, 10:30 AM
krzysz00 requested review of this revision.Nov 17 2021, 10:30 AM

Looks good overall, just one question inline

mlir/test/Integration/GPU/ROCM/lit.local.cfg
13

Can this be done in CMake and encoded in lit.site.cfg.in with the rest of the config, instead of doing this on every invocation of lit?

krzysz00 updated this revision to Diff 388054.Nov 17 2021, 3:56 PM
  • Move the chipset detection into CMake
krzysz00 added inline comments.Nov 17 2021, 3:59 PM
mlir/test/Integration/GPU/ROCM/lit.local.cfg
13

Yep, we can do that.

mehdi_amini accepted this revision.Nov 17 2021, 4:29 PM
This revision is now accepted and ready to land.Nov 17 2021, 4:29 PM

Nice, let us know if you need helping landing

This revision was automatically updated to reflect the committed changes.