From 2451ff57be0423d71f79349af5b12c1d99d24882 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Thu, 21 May 2020 17:14:35 -0700 Subject: [PATCH 1/4] fetch thrust/cub from github --- CMakeLists.txt | 4 +++- benchmarks/CMakeLists.txt | 4 +++- tests/CMakeLists.txt | 2 ++ thirdparty/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 832678910..145432726 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,9 @@ endif(BUILD_BENCHMARKS) ################################################################################################### # - include paths --------------------------------------------------------------------------------- -include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}" +include_directories("${CUB_INCLUDE_DIR}" + "${THRUST_INCLUDE_DIR}" + "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}" "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/include/rmm" "${CMAKE_CURRENT_SOURCE_DIR}/src" diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 79d54e39d..fbf1f14fc 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -18,7 +18,9 @@ endfunction(ConfigureBench) ################################################################################################### # - include paths --------------------------------------------------------------------------------- -include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}" +include_directories("${CUB_INCLUDE_DIR}" + "${THRUST_INCLUDE_DIR}" + "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}" "${CMAKE_BINARY_DIR}/include" "${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 75c36ed60..bfc891ade 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,6 +39,8 @@ endfunction(ConfigureTest) # - include paths --------------------------------------------------------------------------------- include_directories("${GTEST_INCLUDE_DIR}" + "${CUB_INCLUDE_DIR}" + "${THRUST_INCLUDE_DIR}" "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}" "${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/include/rmm" diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index a4ef320ad..cdc6c07f5 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -18,6 +18,23 @@ endif() set(CNMEM_INCLUDE_DIR "${cnmem_SOURCE_DIR}/include" PARENT_SCOPE) set(CNMEM_SOURCE_DIR "${cnmem_SOURCE_DIR}/src" PARENT_SCOPE) +################################################################################################### +# - cub ------------------------------------------------------------------------------------------- + +FetchContent_Declare( + cub + GIT_REPOSITORY https://github.com/thrust/cub + GIT_TAG 1.9.10 + GIT_SHALLOW true +) + +FetchContent_GetProperties(cub) +if(NOT cub_POPULATED) + FetchContent_Populate(cub) + # We are not using the cub CMake targets, so no need to call `add_subdirectory()`. +endif() +set(CUB_INCLUDE_DIR "${cub_SOURCE_DIR}" PARENT_SCOPE) + ################################################################################################### # - spdlog ---------------------------------------------------------------------------------------- @@ -34,3 +51,20 @@ if(NOT spdlog_POPULATED) # We are not using the spdlog CMake targets, so no need to call `add_subdirectory()`. endif() set(SPDLOG_INCLUDE_DIR "${spdlog_SOURCE_DIR}/include" PARENT_SCOPE) + +################################################################################################### +# - thrust ---------------------------------------------------------------------------------------- + +FetchContent_Declare( + thrust + GIT_REPOSITORY https://github.com/thrust/thrust + GIT_TAG 1.9.10 + GIT_SHALLOW true +) + +FetchContent_GetProperties(thrust) +if(NOT thrust_POPULATED) + FetchContent_Populate(thrust) + # We are not using the thrust CMake targets, so no need to call `add_subdirectory()`. +endif() +set(THRUST_INCLUDE_DIR "${thrust_SOURCE_DIR}" PARENT_SCOPE) From 30ede02c4a55cfa86a7876775a1a720c30691edf Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Thu, 21 May 2020 17:19:28 -0700 Subject: [PATCH 2/4] add to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afc363453..2f2774b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ## Improvements +- PR #378 Use CMake `FetchContent` to obtain latest release of `cub` and `thrust` - PR #372 Use CMake `FetchContent` to obtain `cnmem` instead of git submodule ## Bug Fixes From 3b3cd82959e6aede05fce507c7a9bfa3d99554cd Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Thu, 28 May 2020 19:01:48 -0700 Subject: [PATCH 3/4] update cmake required version --- benchmarks/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index ad349cc66..403c1b246 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) project(RMM_BENCHS LANGUAGES C CXX CUDA) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6db7b1c3c..221058631 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) project(RMM_TESTS LANGUAGES C CXX CUDA) From 33b9d68ae4cf7b667fb8b9253c050042aa4afe0b Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Fri, 29 May 2020 14:34:28 -0700 Subject: [PATCH 4/4] add .git --- thirdparty/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 64d9d7a90..aa7891777 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -5,7 +5,7 @@ include(FetchContent) FetchContent_Declare( cnmem - GIT_REPOSITORY https://github.com/NVIDIA/cnmem + GIT_REPOSITORY https://github.com/NVIDIA/cnmem.git GIT_TAG 37896cc9bfc6536a8c878a1e675835c22d827821 GIT_SHALLOW true ) @@ -23,7 +23,7 @@ set(CNMEM_SOURCE_DIR "${cnmem_SOURCE_DIR}/src" PARENT_SCOPE) FetchContent_Declare( cub - GIT_REPOSITORY https://github.com/thrust/cub + GIT_REPOSITORY https://github.com/thrust/cub.git GIT_TAG 1.9.10 GIT_SHALLOW true ) @@ -56,7 +56,7 @@ endif() FetchContent_Declare( thrust - GIT_REPOSITORY https://github.com/thrust/thrust + GIT_REPOSITORY https://github.com/thrust/thrust.git GIT_TAG 1.9.10 GIT_SHALLOW true )