HIP: Remove ROMClang compiler id and use Clang directly
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 asClang
. -
The implementation of
target_compile_features
was incomplete for theROCMClang
identity. -
Only
hipcc
was identified asROCMClang
, so after it is unwrapped to the underlyingclang++
, 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