Update rocPRIM dependency handle
MODIFY
CMakeLists.txt
CMakeLists.txt
# ########################################################################
-# Copyright 2019 Advanced Micro Devices, Inc.
+# Copyright 2019-2020 Advanced Micro Devices, Inc.
# ########################################################################
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
@@ -27,7 +27,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOLEAN "Add paths to linker search and installed rpath")
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "Add paths to linker search and installed rpath")
# Verify that hcc compiler is used on ROCM platform
include(cmake/VerifyCompiler.cmake)
@@ -40,6 +40,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-function")
# Build options
option(BUILD_TEST "Build tests" OFF)
+option(DOWNLOAD_ROCPRIM "Download rocPRIM and do not search for rocPRIM package" OFF)
# Get dependencies
include(cmake/Dependencies.cmake)

MODIFY
README.md
README.md
@@ -40,6 +40,7 @@ cd rocThrust; mkdir build; cd build
# Configure rocThrust, setup options for your system.
# Build options:
# BUILD_TEST - ON by default,
+# DOWNLOAD_ROCPRIM - OFF by default and at ON the rocPRIM will be downloaded to build folder,
#
# ! IMPORTANT !
# On ROCm platform set C++ compiler to HCC. You can do it by adding 'CXX=<path-to-hcc>'

MODIFY
cmake/Dependencies.cmake
cmake/Dependencies.cmake
@@ -19,24 +19,26 @@ if (NOT Git_FOUND)
endif()
# rocPRIM (https://github.com/ROCmSoftwarePlatform/rocPRIM)
-if(NOT DEFINED ROCPRIM_ROOT)
- message(STATUS "Downloading and building rocPRIM.")
- set(ROCPRIM_ROOT ${CMAKE_CURRENT_BINARY_DIR}/rocPRIM CACHE PATH "")
+if(NOT DOWNLOAD_ROCPRIM)
+ find_package(rocprim)
+endif()
+if(NOT rocprim_FOUND)
+ message(STATUS "Downloading and building rocprim.")
download_project(
- PROJ rocPRIM
+ PROJ rocprim
GIT_REPOSITORY https://github.com/ROCmSoftwarePlatform/rocPRIM.git
- GIT_TAG 5fa0c79fbb199f83c5202d9e218311a78335a1f4
- INSTALL_DIR ${ROCPRIM_ROOT}
+ GIT_TAG a6ce0b9ce6e68eaf219bace8f6d532fb81ca5d9e
+ INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/rocprim
CMAKE_ARGS -DBUILD_TEST=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=/opt/rocm
LOG_DOWNLOAD TRUE
LOG_CONFIGURE TRUE
LOG_BUILD TRUE
LOG_INSTALL TRUE
BUILD_PROJECT TRUE
- UPDATE_DISCONNECTED TRUE
+ UPDATE_DISCONNECTED TRUE # Never update automatically from the remote repository
)
+ find_package(rocprim REQUIRED CONFIG PATHS ${CMAKE_CURRENT_BINARY_DIR}/deps/rocprim)
endif()
-find_package(rocprim REQUIRED CONFIG PATHS ${ROCPRIM_ROOT})
# Test dependencies
if(BUILD_TEST)

Update rocPRIM dependency handle