How to use rocThrust in a CMake project

How to use rocThrust in a CMake project#

To use rocThrust in your own project, add the following lines to your CMakeLists file:

# On ROCm rocThrust requires rocPRIM
find_package(rocprim REQUIRED CONFIG PATHS "/opt/rocm/rocprim")

# "/opt/rocm" - default install prefix
find_package(rocthrust REQUIRED CONFIG PATHS "/opt/rocm/rocthrust")

[...]

# include rocThrust headers and roc::rocprim_hip target
target_link_libraries(<your_target> roc::rocthrust)