Fix TARGETS param of rocm_export_targets, use rocm_setup_version
MODIFY
.gitlab-ci.yml
.gitlab-ci.yml
@@ -119,6 +119,7 @@ test:rocm_install:
- rocm
variables:
SUDO_CMD: "sudo -E"
+ dependencies: []
script:
- mkdir build_only_install
- cd build_only_install

MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -30,7 +30,7 @@ else()
endif()
# Thrust project
-project(thrust VERSION 2.5.0.0 LANGUAGES CXX)
+project(rocthrust LANGUAGES CXX)
# CMake modules
list(APPEND CMAKE_MODULE_PATH
@@ -65,6 +65,17 @@ include(cmake/Dependencies.cmake)
# AMD targets
set(AMDGPU_TARGETS gfx803;gfx900;gfx906 CACHE STRING "List of specific machine types for library to target")
+# Setup VERSION
+set(VERSION_STRING "2.5.0.")
+
+# Check if BUILD_NUMBER is defined in a Jenkins environment
+if($ENV{BUILD_NUMBER})
+ string(CONCAT BUILD_VERSION ${VERSION_STRING} $ENV{BUILD_NUMBER})
+else()
+ string(CONCAT BUILD_VERSION ${VERSION_STRING} "0")
+endif()
+rocm_setup_version(VERSION ${BUILD_VERSION} NO_GIT_TAG_VERSION)
+
# Print configuration summary
include(cmake/Summary.cmake)
print_configuration_summary()
@@ -81,8 +92,8 @@ endif()
# Package
set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.5.18263), rocprim (>= 1.0)") # 1.5.18263 is HIP version in ROCm 1.8.2
-set(CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.5.18263, rocprim >= 1.0")
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.5.18263), rocprim (>= 2.5)") # 1.5.18263 is HIP version in ROCm 1.8.2
+set(CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.5.18263, rocprim >= 2.5")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
if(NOT CPACK_PACKAGING_INSTALL_PREFIX)
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

MODIFY
README.md
README.md
@@ -31,7 +31,7 @@ https://github.com/RadeonOpenCompute/ROCm/blob/master/README.md#supported-cpus
## Build And Install
-```
+```sh
git clone https://github.com/ROCmSoftwarePlatform/rocThrust
# Go to rocThrust directory, create and go to the build directory.
@@ -79,7 +79,7 @@ target_link_libraries(<your_target> rocthrust)
## Running Unit Tests
-```
+```sh
# Go to rocThrust build directory
cd rocThrust; cd build
@@ -92,7 +92,7 @@ ctest
## Documentation
-```
+```sh
# go to rocThrust doc directory
cd rocThrust

MODIFY
cmake/Dependencies.cmake
cmake/Dependencies.cmake
# For downloading, building, and installing required dependencies
include(cmake/DownloadProject.cmake)
-# Never update automatically from the remote repository
-if(CMAKE_VERSION VERSION_LESS 3.2)
- set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
-else()
- set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED TRUE")
-endif()
-
# GIT
find_package(Git REQUIRED)
if (NOT Git_FOUND)
@@ -48,8 +41,8 @@ message(STATUS "Downloading and building rocPRIM.")
set(ROCPRIM_ROOT ${CMAKE_CURRENT_BINARY_DIR}/rocPRIM CACHE PATH "")
download_project(
PROJ rocPRIM
- GIT_REPOSITORY https://projects.streamhpc.com/amd/rocPRIM.git
- GIT_TAG develop_stream
+ GIT_REPOSITORY https://github.com/ROCmSoftwarePlatform/rocPRIM.git
+ GIT_TAG master
INSTALL_DIR ${ROCPRIM_ROOT}
CMAKE_ARGS -DBUILD_TEST=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
LOG_DOWNLOAD TRUE
@@ -57,7 +50,7 @@ download_project(
LOG_BUILD TRUE
LOG_INSTALL TRUE
BUILD_PROJECT TRUE
- ${UPDATE_DISCONNECTED_IF_AVAILABLE}
+ UPDATE_DISCONNECTED TRUE
)
find_package(rocprim REQUIRED CONFIG PATHS ${ROCPRIM_ROOT})
@@ -77,7 +70,7 @@ if(BUILD_TEST)
LOG_BUILD TRUE
LOG_INSTALL TRUE
BUILD_PROJECT TRUE
- ${UPDATE_DISCONNECTED_IF_AVAILABLE}
+ UPDATE_DISCONNECTED TRUE
)
find_package(GTest REQUIRED)
endif()

MODIFY
extra/CMakeLists.txt
extra/CMakeLists.txt
@@ -37,14 +37,13 @@ include(VerifyCompiler)
include(DownloadProject)
# Download rocPRIM (only for ROCm platform)
-if(HIP_PLATFORM STREQUAL "hcc")
if(NOT DEFINED rocprim_DIR)
message(STATUS "Downloading and building rocPRIM.")
set(rocprim_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocprim" CACHE PATH "")
download_project(
PROJ rocprim
GIT_REPOSITORY https://github.com/ROCmSoftwarePlatform/rocPRIM.git
- GIT_TAG develop
+ GIT_TAG master
INSTALL_DIR ${rocprim_DIR}
CMAKE_ARGS -DBUILD_TEST=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
LOG_DOWNLOAD TRUE
@@ -52,11 +51,10 @@ if(HIP_PLATFORM STREQUAL "hcc")
LOG_BUILD TRUE
LOG_INSTALL TRUE
BUILD_PROJECT TRUE
- ${UPDATE_DISCONNECTED_IF_AVAILABLE}
+ UPDATE_DISCONNECTED TRUE
)
endif()
find_package(rocprim REQUIRED CONFIG PATHS "${rocprim_DIR}")
-endif()
# Find rocThrust
find_package(rocthrust REQUIRED CONFIG HINTS ${rocthrust_DIR} PATHS "/opt/rocm/rocthrust")
@@ -79,7 +77,7 @@ function(add_rocthrust_test TEST_NAME TEST_SOURCES)
add_executable(${TEST_TARGET} ${TEST_SOURCES})
target_link_libraries(${TEST_TARGET}
PRIVATE
- rocthrust
+ ${rocthrust_LIBRARIES} # rocthrust
)
foreach(amdgpu_target ${AMDGPU_TARGETS})
target_link_libraries(${TEST_TARGET}

MODIFY
thrust/CMakeLists.txt
thrust/CMakeLists.txt
@@ -41,7 +41,6 @@ target_include_directories(rocthrust
target_link_libraries(rocthrust
INTERFACE
roc::rocprim_hip
-# hip::device
)
# Installation
@@ -53,10 +52,6 @@ set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
# does not support header-only libraries (INTERFACE targets)
rocm_install_targets(
TARGETS rocthrust
- EXPORT rocthrust-targets
-# INCLUDE
-# ${CMAKE_SOURCE_DIR}/thrust
-# ${CMAKE_BINARY_DIR}/thrust
PREFIX rocthrust
)
if(CMAKE_VERSION VERSION_LESS 3.7)
@@ -82,8 +77,7 @@ install(
# Export targets
rocm_export_targets(
- TARGETS rocthrust-targets
- NAME rocthrust
+ TARGETS rocthrust
PREFIX rocthrust
)

MODIFY
thrust/rocthrust_version.hpp.in
thrust/rocthrust_version.hpp.in
///
/// For example, if ROCTHRUST_VERSION is 100500, then the major version is 1,
/// the minor version is 5, and the patch level is 0.
-#define ROCTHRUST_VERSION @thrust_VERSION_MAJOR@ * 100000 + @thrust_VERSION_MINOR@ * 100 + @thrust_VERSION_PATCH@
+#define ROCTHRUST_VERSION @rocthrust_VERSION_MAJOR@ * 100000 + @rocthrust_VERSION_MINOR@ * 100 + @rocthrust_VERSION_PATCH@
-#define ROCTHRUST_VERSION_MAJOR @thrust_VERSION_MAJOR@
-#define ROCTHRUST_VERSION_MINOR @thrust_VERSION_MINOR@
-#define ROCTHRUST_VERSION_PATCH @thrust_VERSION_PATCH@
+#define ROCTHRUST_VERSION_MAJOR @rocthrust_VERSION_MAJOR@
+#define ROCTHRUST_VERSION_MINOR @rocthrust_VERSION_MINOR@
+#define ROCTHRUST_VERSION_PATCH @rocthrust_VERSION_PATCH@
#endif // ROCTHRUST_VERSION_HPP_

Fix TARGETS param of rocm_export_targets, use rocm_setup_version