Add CMake HIP language support
Build Instructions
- Install ROCm 4.5.2
- Install CMake 3.21.3 or later
- Install libnuma and kmod (so that
rocm_agent_enumeratorworks) - Build rocRAND:
HIPCXX=/opt/rocm/llvm/bin/clang++ \
CXX=/opt/rocm/llvm/bin/clang++ \
CC=/opt/rocm/llvm/bin/clang \
cmake -S. -Bbuild -GNinja \
-DBUILD_HIPRAND=OFF \
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
-DROCRAND_CMAKE_HIP_LANGUAGE=ON
With these changes, the above command will build a version of the library compatible with the system it's running on. If you want specific GPU architectures, append -DCMAKE_HIP_ARCHITECTURES='gfx906:xnack-;gfx1030' (replacing the example gfx906:xnack-;gfx1030 values with your chosen semi-colon delimited list of AMDGPU target ids).
Related CMake Documentation
HI! rocRAND developer here, thank you for getting this off the ground. I believe cmake HIP support for rocRAND would simplify many projects that depend on rocRAND. I added a few comments, and will try this out soon.
I think I can help answer some questions regarding the project if you need anything.
This has been sitting around for a while. Should it be resurrected?
This has been sitting around for a while. Should it be resurrected?
Maybe, but I don't have the bandwidth to do that quite yet.
The official Linux and Windows builds now both use CMake 3.22, so if this PR were finished, we could begin to use the CMake HIP language support in our official builds.