Commit Graph

7 Commits

Author SHA1 Message Date
Gergely Meszaros
6021fa7928 HIP: Convert clang output to cmake style paths
On windows the location of the rocm root directory as reported by clang
might be in windows style (with backslashes) which breaks the cache.
2022-10-09 19:47:20 +02:00
Brad King
cb93f72624 HIP: Simplify detection of 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.
2021-09-16 15:33:53 -04:00
Brad King
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
Since commit bd844387df (ROCMClang: Add the ROCm toolkit derived clang
compiler to CMake, 2020-08-28, v3.21.0-rc1~66^2~6) and commit ff0d2858e1
(HIP: Extract clang compiler details from hipcc, 2020-10-21,
v3.21.0-rc1~66^2~5), 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.

Fixes: #22536, #22460, #22593
2021-09-16 15:33:47 -04:00
Brad King
b125e9809a HIP: Detect ROCm path earlier
Fail early if it is not found.

Use the detected location as a hint to find `rocm_agent_enumerator`.

Also remove the leading `_` prefix in case we want to document this
publicly later.
2021-09-16 14:45:07 -04:00
Zack Galbreath
735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES 2021-09-16 14:41:30 -04:00
Zack Galbreath
8514ee9b31 HIP: analyze output of hipcc to determine default GPU architecture 2021-06-07 19:25:34 +00:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00