Skip to content

HIP: Remove ROMClang compiler id and use Clang directly

Brad King requested to merge brad.king/cmake:hip-no-hipcc into master

Since !6121 (merged), the separate ROCMClang compiler id for hipcc has caused a few problems:

  • The compiler id changed from behavior of CMake 3.20 and below, breaking projects that already built with hipcc treated as Clang.

  • The implementation of target_compile_features was incomplete for the ROCMClang identity.

  • Only hipcc was identified as ROCMClang, so after it is unwrapped to the underlying clang++, future runs of new CMake versions on an existing build tree would not repeat this.

  • Clang should be usable as a HIP compiler without the hipcc wrapper.

Remove the ROMClang compiler identity, and revise HIP language support to work directly with a Clang compiler.

Reject direct hipcc usage as a HIP compiler. For now it cannot be supported because it interferes with flags CMake needs to pass to Clang.

Also simplify detection of the HIP runtime CMake package. It only makes sense to use the CMake package from the same ROCm installation that the compiler uses. Ask the HIP compiler to report the location of the ROCm installation. Verify up front that it contains the expected CMake package file.

Fixes: #22536 (closed), #22460 (closed), #22593 (closed), #22457 (closed)
Backport: release

Edited by Brad King

Merge request reports