Skip to content

Commit

Permalink
Fallback to Thrust/CUB for CTK <12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jul 23, 2024
1 parent 0d2bcf0 commit 170bbd6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,17 @@ if(USE_CUDA)
find_package(CUDAToolkit REQUIRED)
find_package(CCCL CONFIG)
if(NOT CCCL_FOUND)
message(STATUS "Standalone CCCL not found. Attempting to use CCCL from CTK...")
find_package(CCCL REQUIRED CONFIG
message(STATUS "Standalone CCCL not found. Attempting to use CCCL from CUDA Toolkit...")
find_package(CCCL CONFIG
PATHS ${CUDAToolkit_LIBRARY_DIR}/cmake/cccl)
if(NOT CCCL_FOUND)
message(STATUS "Could not locate CCCL from CUDA Toolkit. Using Thrust and CUB from CUDA Toolkit...")
find_package(Thrust CONFIG REQUIRED)
find_package(CUB CONFIG REQUIRED)
find_package(libcudacxx CONFIG REQUIRED)
add_library(CCCL::CCCL INTERFACE IMPORTED GLOBAL)
target_link_libraries(CCCL::CCCL INTERFACE Thrust::Thrust CUB::CUB libcudacxx::libcudacxx)
endif()
endif()
endif()

Expand Down

0 comments on commit 170bbd6

Please sign in to comment.