Skip to content

Commit

Permalink
Switch from Thrust to NVIDIA CCCL
Browse files Browse the repository at this point in the history
Thrust is deprecated, and has been replaced by CCCL.
  • Loading branch information
stephenswat committed Jul 30, 2024
1 parent 969c54e commit 724382a
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 37 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if( TRACCC_SETUP_EIGEN3 )
endif()
endif()

# Set up Thrust.
# Set up CCCL.
option( TRACCC_SETUP_THRUST
"Set up the Thrust target(s) explicitly" TRUE )
option( TRACCC_USE_SYSTEM_THRUST
Expand All @@ -127,7 +127,7 @@ if( TRACCC_SETUP_THRUST )
if( TRACCC_USE_SYSTEM_THRUST )
find_package( Thrust REQUIRED )
else()
add_subdirectory( extern/thrust )
add_subdirectory( extern/cccl )
endif()
endif()
# Set up an IMPORTED library on top of the Thrust library/libraries. One that
Expand Down
46 changes: 46 additions & 0 deletions extern/cccl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# TRACCC library, part of the ACTS project (R&D line)
#
# (c) 2021-2024 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

# CMake include(s).
cmake_minimum_required( VERSION 3.14 )
include( FetchContent )

# Silence FetchContent warnings with CMake >=3.24.
if( POLICY CMP0135 )
cmake_policy( SET CMP0135 NEW )
endif()

# Tell the user what's happening.
message( STATUS "Building CCCL as part of the TRACCC project" )

# Declare where to get Thrust from.
set( TRACCC_CCCL_SOURCE
"GIT_REPOSITORY;https://github.com/stephenswat/cccl.git;GIT_TAG;build/allow_installing_when_downstream"
CACHE STRING "Source for CCCL, when built as part of this project" )
mark_as_advanced( TRACCC_CCCL_SOURCE )
FetchContent_Declare( CCCL ${TRACCC_CCCL_SOURCE} )

# There are a few things to configure here... May not all be necessary but
# can't hurt.
set ( CCCL_ENABLE_INSTALL_RULES ON CACHE BOOL "Install CCCL as part of traccc." )
set ( THRUST_ENABLE_INSTALL_RULES ON CACHE BOOL "Install Thrust as part of traccc." )
set ( CUB_ENABLE_INSTALL_RULES ON CACHE BOOL "Install CUB as part of traccc." )
set ( libcudacxx_ENABLE_INSTALL_RULES ON CACHE BOOL "Install libcudacxx as part of traccc." )
set ( CCCL_ENABLE_LIBCUDACXX ON CACHE BOOL "Disable libcudacxx" )
set ( CCCL_ENABLE_CUB ON CACHE BOOL "Enable CUB" )
set ( CCCL_ENABLE_THRUST ON CACHE BOOL "Enable Thrust" )
set ( CCCL_ENABLE_TESTING OFF CACHE BOOL "Disable CCCL tests" )
set ( CCCL_ENABLE_EXAMPLES OFF CACHE BOOL "Disable CCCL examples" )
set ( CCCL_ENABLE_BENCHMARKS OFF CACHE BOOL "Disable CCCL benchmarks" )
set ( THRUST_ENABLE_TESTING OFF CACHE BOOL "Disable Thrust tests" )
set ( THRUST_ENABLE_EXAMPLES OFF CACHE BOOL "Disable Thrust examples" )
set ( THRUST_ENABLE_HEADER_TESTING OFF CACHE BOOL "Disable Thrust header testing" )
set ( CUB_ENABLE_TESTING OFF CACHE BOOL "Disable CUB tests" )
set ( CUB_ENABLE_EXAMPLES OFF CACHE BOOL "Disable CUB examples" )
set ( CUB_ENABLE_HEADER_TESTING OFF CACHE BOOL "Disable CUB header testing" )

# Get it into the current directory.
FetchContent_MakeAvailable( CCCL )
4 changes: 4 additions & 0 deletions extern/cccl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build Recipe for CCCL

This directory holds a build recipe for building
[CCCL](https://github.com/NVIDIA/cccl) for this project.
31 changes: 0 additions & 31 deletions extern/thrust/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions extern/thrust/README.md

This file was deleted.

0 comments on commit 724382a

Please sign in to comment.