Packages for tests and benchmark executable on all supported OSes using CPack.
MODIFY
CHANGELOG.md
CHANGELOG.md
Full documentation for rocThrust is available at [https://rocthrust.readthedocs.io/en/latest/](https://rocthrust.readthedocs.io/en/latest/)
+## (Unreleased) rocThrust 2.15.0 for ROCm 5.2
+### Added
+- Packages for tests and benchmark executable on all supported OSes using CPack.
+
## (Unreleased) rocThrust 2.14.0 for ROCm 5.1
### Added
- Updated to match upstream Thrust 1.15.0

MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -40,7 +40,8 @@ include( ROCMCreatePackage )
include( ROCMInstallTargets )
include( ROCMPackageConfigHelpers )
include( ROCMInstallSymlinks )
-include( ROCMCheckTargetIds OPTIONAL )
+include( ROCMCheckTargetIds )
+include( ROCMClients )
# Detect compiler support for target ID
# This section is deprecated. Please use rocm_check_target_ids for future use.
@@ -136,8 +137,13 @@ print_configuration_summary()
# Thrust (with HIP backend)
add_subdirectory(thrust)
+if(BUILD_TEST OR BUILD_BENCHMARKS)
+ rocm_package_setup_component(clients)
+endif()
+
# Tests
if(BUILD_TEST)
+ rocm_package_setup_client_component(tests)
if (ENABLE_UPSTREAM_TESTS)
enable_testing()
endif()
@@ -166,10 +172,10 @@ set(THRUST_OPTIONS_RELEASE ${THRUST_OPTIONS_WARNINGS})
# Package
set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "rocprim-dev (>= 2.10.1)") # 1.5.18263 is HIP version in ROCm 1.8.2
+rocm_package_add_deb_dependencies(DEPENDS "rocprim-dev >= 2.10.1")
+rocm_package_add_rpm_dependencies(DEPENDS "rocprim-devel >= 2.10.1")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "hip-thrust, thrust")
set(CPACK_RPM_PACKAGE_CONFLICTS "hip-thrust, thrust")
-set(CPACK_RPM_PACKAGE_REQUIRES "rocprim-devel >= 2.10.1")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0")

MODIFY
cmake/Dependencies.cmake
cmake/Dependencies.cmake
@@ -58,7 +58,7 @@ if(BUILD_TEST)
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
INSTALL_DIR ${GTEST_ROOT}
- CMAKE_ARGS -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+ CMAKE_ARGS -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
LOG_DOWNLOAD TRUE
LOG_CONFIGURE TRUE
LOG_BUILD TRUE

MODIFY
cmake/FindROCMCmake.cmake
cmake/FindROCMCmake.cmake
@@ -17,7 +17,7 @@ if(NOT ROCM_PATH)
set(ROCM_PATH /opt/rocm)
endif()
-find_package(ROCM 0.6 CONFIG QUIET PATHS ${ROCM_PATH} /opt/rocm)
+find_package(ROCM 0.7.3 CONFIG QUIET PATHS ${ROCM_PATH} /opt/rocm)
if(NOT ROCM_FOUND)
set(rocm_cmake_tag "master" CACHE STRING "rocm-cmake tag to download")
set(rocm_cmake_url "https://github.com/RadeonOpenCompute/rocm-cmake/archive/${rocm_cmake_tag}.zip")
@@ -44,6 +44,6 @@ if(NOT ROCM_FOUND)
execute_process( COMMAND ${CMAKE_COMMAND} --build rocm-cmake-${rocm_cmake_tag} --target install
WORKING_DIRECTORY ${PROJECT_EXTERN_DIR})
- find_package( ROCM 0.6 REQUIRED CONFIG PATHS ${PROJECT_EXTERN_DIR}/rocm-cmake )
+ find_package( ROCM 0.7.3 REQUIRED CONFIG PATHS ${PROJECT_EXTERN_DIR}/rocm-cmake )
endif()

MODIFY
internal/benchmark/CMakeLists.txt
internal/benchmark/CMakeLists.txt
@@ -26,6 +26,7 @@ function(add_thrust_benchmark BENCHMARK)
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/benchmarks/"
)
+ rocm_install(TARGETS ${BENCHMARK_TARGET} COMPONENT benchmarks)
endfunction()
# ****************************************************************************

MODIFY
test/CMakeLists.txt
test/CMakeLists.txt
@@ -44,8 +44,8 @@ function(add_rocthrust_test TEST)
add_executable(${TEST_TARGET} ${TEST_SOURCE})
target_include_directories(${TEST_TARGET} SYSTEM BEFORE
PUBLIC
- ${GTEST_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR}
+ $<BUILD_INTERFACE:${GTEST_INCLUDE_DIRS}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
target_link_libraries(${TEST_TARGET}
PRIVATE
@@ -81,6 +81,7 @@ function(add_rocthrust_test TEST)
LABELS "hip"
)
endif()
+ rocm_install(TARGETS ${TEST_TARGET} COMPONENT tests)
if (WIN32 AND NOT DEFINED DLLS_COPIED)
set(DLLS_COPIED "YES")
set(DLLS_COPIED ${DLLS_COPIED} PARENT_SCOPE)

MODIFY
testing/CMakeLists.txt
testing/CMakeLists.txt
@@ -7,8 +7,8 @@ target_include_directories(testing_common
SYSTEM
BEFORE
INTERFACE
- ${GTEST_INCLUDE_DIRS}
- .
+ $<BUILD_INTERFACE:${GTEST_INCLUDE_DIRS}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
)
target_link_libraries(testing_common
INTERFACE
@@ -105,6 +105,7 @@ function(add_thrust_test TEST)
LABELS upstream
)
endif()
+ rocm_install(TARGETS ${TEST_TARGET} COMPONENT tests)
endfunction()
# ****************************************************************************

MODIFY
testing/unittest/CMakeLists.txt
testing/unittest/CMakeLists.txt
@@ -16,6 +16,6 @@ foreach(thrust_target IN LISTS THRUST_TARGETS)
add_library(${framework_target} STATIC ${framework_srcs})
target_link_libraries(${framework_target} PUBLIC ${thrust_target})
- target_include_directories(${framework_target} PRIVATE "${Thrust_SOURCE_DIR}/testing")
+ target_include_directories(${framework_target} PRIVATE $<BUILD_INTERFACE:"${Thrust_SOURCE_DIR}/testing">)
thrust_clone_target_properties(${framework_target} ${thrust_target})
endforeach()

Packages for tests and benchmark executable on all supported OSes using CPack. (#225)