Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,16 @@ find_package(rocprim REQUIRED CONFIG PATHS "/opt/rocm/rocprim")
# to be linked manually by user
target_link_libraries(<your_target> roc::rocprim)

# Includes rocPRIM headers and required HIP dependencies
target_link_libraries(<your_target> roc::rocprim_hip)
# Include rocPRIM headers and required HIP dependencies
# - If using HIP language support (USE_HIPCXX=ON):
target_link_libraries(<your_target> hip::host)

# - Otherwise:
target_link_libraries(<your_target> hip::device)
```

For more information on `hip::host` and `hip::device`, please see the [ROCm documentation](https://rocm.docs.amd.com/en/latest/conceptual/cmake-packages.html#consuming-the-hip-api-in-c-code).

## Running unit tests

Unit tests are implemented in terms of GoogleTest. Collections of tests are wrapped and invoked from
Expand Down
4 changes: 4 additions & 0 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ function(add_rocprim_benchmark BENCHMARK_SOURCE)
PRIVATE
$<IF:$<LINK_LANGUAGE:HIP>,hip::host,hip::device>
)
else()
target_link_libraries(${BENCHMARK_TARGET}
PRIVATE
hip::device)
endif()

target_compile_options(${BENCHMARK_TARGET}
Expand Down
4 changes: 4 additions & 0 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function(add_rocprim_example EXAMPLE_SOURCE)
PRIVATE
$<IF:$<LINK_LANGUAGE:HIP>,hip::host,hip::device>
)
else()
target_link_libraries(${EXAMPLE_TARGET}
PRIVATE
hip::device)
endif()
set_target_properties(${EXAMPLE_TARGET}
PROPERTIES
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ function(add_hip_test TEST_NAME TEST_SOURCES)
PRIVATE
$<IF:$<LINK_LANGUAGE:HIP>,hip::host,hip::device>
)
else()
target_link_libraries(${TEST_TARGET}
PRIVATE
hip::device)
endif()

target_compile_options(${TEST_TARGET}
Expand Down
4 changes: 4 additions & 0 deletions test/rocprim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function(add_rocprim_test_internal TEST_NAME TEST_SOURCES TEST_TARGET)
PRIVATE
$<IF:$<LINK_LANGUAGE:HIP>,hip::host,hip::device>
)
else()
target_link_libraries(${TEST_TARGET}
PRIVATE
hip::device)
endif()

target_compile_options(${TEST_TARGET}
Expand Down