You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake's native HIP support has become the recommended way to add HIP
code into a project (see
[here](https://rocm.docs.amd.com/en/docs-6.0.0/conceptual/cmake-packages.html#using-hip-in-cmake)).
This PR makes the following changes:
1. The environment variable `HIPCXX` or CMake option `CMAKE_HIP_COMPILER`
should be used to specify the HIP compiler. Notably this shouldn't be
`hipcc`, but ROCm's clang, which usually resides in
`$ROCM_PATH/llvm/bin/clang`. Previously this was control by
`CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER`.
2. CMake option `CMAKE_HIP_ARCHITECTURES` is used to control the GPU
architectures to build for. Previously this was controled by
`GPU_TARGETS`.
The most important part about this PR is that this separation of HIP
compiler and the C/C++ compiler allows user to choose a different C/C++
compiler if desired, compared to the current situation where when
building for ROCm, everything must be built with ROCm's clang.
Makefile is unchanged. Please let me know if we want to be consistent on
variables' naming because Makefile still uses `GPU_TARGETS` to control
architectures to build for, but I feel like setting
`CMAKE_HIP_ARCHITECTURES` is a bit awkward when you're calling `make`.
Signed-off-by: Gavin Zhao <[email protected]>
0 commit comments