Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] fetch thrust/cub from github #378

Merged
merged 5 commits into from
Jun 5, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Improvements

- PR #378 Use CMake `FetchContent` to obtain latest release of `cub` and `thrust`
- PR #377 A better way to fetch `spdlog`
- PR #372 Use CMake `FetchContent` to obtain `cnmem` instead of git submodule
- PR #382 Rely on NumPy arrays for out-of-band pickling
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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}"
Expand Down
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -40,6 +40,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"
Expand Down
36 changes: 35 additions & 1 deletion thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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
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 ----------------------------------------------------------------------------------------

Expand All @@ -33,3 +50,20 @@ if(NOT spdlog_POPULATED)
FetchContent_Populate(spdlog)
add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

###################################################################################################
# - thrust ----------------------------------------------------------------------------------------

FetchContent_Declare(
thrust
GIT_REPOSITORY https://github.com/thrust/thrust.git
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)