Installation
Build for HIP/ROCm
Download dependencies
If pkg tool is not avaiable on you system, we can run this script to download packages.
./scripts/dl_deps.sh
If pkg tool is used for manager dependency packages, you use following commands to download dependencies:
pkg fetch --features=rocm
pkg install
Build without benchmark features
- DTK/HIP
- ROCm/HIP
- CUDA
- MUSA
For DTK environment of Hygon DCU, use the CMake preset rocm-dcc (use dcc as compiler).
e.g. to build on DCU without benchmark feature, run:
cmake --preset=rocm-dcc
cmake --build --preset=rocm-dcc
For ROCm environment, use the CMake preset rocm-hipcc (use hipcc as compiler).
cmake --preset=rocm-hipcc
cmake --build --preset=rocm-hipcc
For CUDA environment, use the CMake preset cuda-hipcc (use nvcc as compiler).
cmake --preset=cuda-hipcc
cmake --build --preset=cuda-hipcc
For MUSA environment, use the CMake preset musa-clang (use clang/mcc as compiler).
cmake --preset=cuda-hipcc
cmake --build --preset=cuda-hipcc
Build with benchmark features
To enable benchmark features, you can use the following commands to build usparse with benchmark.
- DTK/HIP
- ROCm/HIP
- CUDA
- MUSA
For DTK environment of Hygon DCU, use the CMake preset rocm-dcc-benchmark (use dcc as compiler).
e.g. to build on DCU with benchmark feature, run:
cmake --preset=rocm-dcc-benchmark
cmake --build --preset=rocm-dcc-benchmark
For ROCm environment, use the CMake preset rocm-hipcc-benchmark (use hipcc as compiler).
cmake --preset=rocm-hipcc-benchmark
cmake --build --preset=rocm-hipcc-benchmark
For CUDA environment, use the CMake preset cuda-nvcc-benchmark (use nvcc as compiler).
cmake --preset=cuda-nvcc-benchmark
cmake --build --preset=cuda-nvcc-benchmark
For MUSA environment, use the CMake preset musa-clang-benchmark (use clang/mcc as compiler).
cmake --preset=musa-clang-benchmark
cmake --build --preset=musa-clang-benchmark
Note: When pkg tool is used, you can change cmake option USPARSE_BUILD_DEP_BY_PKG to ON to enable HOLA benchmarking.