From 54187dca65dd6e4b21ec5668c5a1b2b1503f5021 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 6 Dec 2023 21:24:55 -0600 Subject: [PATCH 1/4] Update to CCCL 2.2.0. --- CMakeLists.txt | 19 ++++++------------- .../{get_thrust.cmake => get_cccl.cmake} | 13 ++++++------- 2 files changed, 12 insertions(+), 20 deletions(-) rename cmake/thirdparty/{get_thrust.cmake => get_cccl.cmake} (71%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 928e7b7b7..baa9b5828 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,10 @@ #============================================================================= cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR) +set(rapids-cmake-repo bdice/rapids-cmake) +set(rapids-cmake-branch rapids_cpm_cccl) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUCO_RAPIDS.cmake) - file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.12/RAPIDS.cmake + file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/CUCO_RAPIDS.cmake) endif() include(${CMAKE_CURRENT_BINARY_DIR}/CUCO_RAPIDS.cmake) @@ -74,8 +76,7 @@ rapids_find_package( rapids_cpm_init() -include(cmake/thirdparty/get_thrust.cmake) -include(cmake/thirdparty/get_libcudacxx.cmake) +include(cmake/thirdparty/get_cccl.cmake) ################################################################################################### # - cuco target --------------------------------------------------------------------------------- @@ -84,7 +85,7 @@ add_library(cuco::cuco ALIAS cuco) target_include_directories(cuco INTERFACE INTERFACE $ $) -target_link_libraries(cuco INTERFACE libcudacxx::libcudacxx CUDA::toolkit $) +target_link_libraries(cuco INTERFACE libcudacxx::libcudacxx CUDA::toolkit $) target_compile_features(cuco INTERFACE cxx_std_17 cuda_std_17) ################################################################################################### @@ -128,21 +129,13 @@ structures tailored for efficient use with GPUs. ]=]) -set(code_string -[=[ -if(NOT TARGET cuco::Thrust) -thrust_create_target(cuco::Thrust FROM_OPTIONS) -endif() -]=]) - # build directory cuco-config generation rapids_export( BUILD cuco EXPORT_SET cuco-exports GLOBAL_TARGETS cuco NAMESPACE cuco:: - DOCUMENTATION doc_string - FINAL_CODE_BLOCK code_string) + DOCUMENTATION doc_string) if(INSTALL_CUCO) install(DIRECTORY include/cuco/ DESTINATION include/cuco) diff --git a/cmake/thirdparty/get_thrust.cmake b/cmake/thirdparty/get_cccl.cmake similarity index 71% rename from cmake/thirdparty/get_thrust.cmake rename to cmake/thirdparty/get_cccl.cmake index a79617807..27e7d81e3 100644 --- a/cmake/thirdparty/get_thrust.cmake +++ b/cmake/thirdparty/get_cccl.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -12,11 +12,10 @@ # the License. # ============================================================================= -# Use CPM to find or clone thrust -function(find_and_configure_thrust) - include(${rapids-cmake-dir}/cpm/thrust.cmake) - rapids_cpm_thrust(NAMESPACE cuco - BUILD_EXPORT_SET cuco-exports) +# Use CPM to find or clone CCCL +function(find_and_configure_cccl) + include(${rapids-cmake-dir}/cpm/cccl.cmake) + rapids_cpm_cccl(BUILD_EXPORT_SET cuco-exports) endfunction() -find_and_configure_thrust() +find_and_configure_cccl() From 69f0d8e4e7455daeb3ac2ecc897dd52a246e1c6d Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 8 Dec 2023 09:14:08 -0800 Subject: [PATCH 2/4] Remove testing branch. --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baa9b5828..bd94643b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,6 @@ #============================================================================= cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR) -set(rapids-cmake-repo bdice/rapids-cmake) -set(rapids-cmake-branch rapids_cpm_cccl) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUCO_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/CUCO_RAPIDS.cmake) From 8bed0e2f4b13a7b1cfc77dd7b32d03525ae3484e Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 8 Dec 2023 09:22:56 -0800 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Robert Maynard --- CMakeLists.txt | 2 +- cmake/thirdparty/get_cccl.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd94643b2..a47fbf65e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,7 @@ add_library(cuco::cuco ALIAS cuco) target_include_directories(cuco INTERFACE INTERFACE $ $) -target_link_libraries(cuco INTERFACE libcudacxx::libcudacxx CUDA::toolkit $) +target_link_libraries(cuco INTERFACE CCCL::CCCL CUDA::toolkit) target_compile_features(cuco INTERFACE cxx_std_17 cuda_std_17) ################################################################################################### diff --git a/cmake/thirdparty/get_cccl.cmake b/cmake/thirdparty/get_cccl.cmake index 27e7d81e3..6dcfef8a5 100644 --- a/cmake/thirdparty/get_cccl.cmake +++ b/cmake/thirdparty/get_cccl.cmake @@ -15,7 +15,7 @@ # Use CPM to find or clone CCCL function(find_and_configure_cccl) include(${rapids-cmake-dir}/cpm/cccl.cmake) - rapids_cpm_cccl(BUILD_EXPORT_SET cuco-exports) + rapids_cpm_cccl(INSTALL_EXPORT_SET cuco-exports BUILD_EXPORT_SET cuco-exports) endfunction() find_and_configure_cccl() From 76682af247bd8f8e98133e4897f0308186d086da Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 8 Dec 2023 11:23:10 -0600 Subject: [PATCH 4/4] Remove get_libcudacxx.cmake. --- cmake/thirdparty/get_libcudacxx.cmake | 28 --------------------------- 1 file changed, 28 deletions(-) delete mode 100644 cmake/thirdparty/get_libcudacxx.cmake diff --git a/cmake/thirdparty/get_libcudacxx.cmake b/cmake/thirdparty/get_libcudacxx.cmake deleted file mode 100644 index 672ce26bb..000000000 --- a/cmake/thirdparty/get_libcudacxx.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# ============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under -# the License. -# ============================================================================= - -# Use CPM to find or clone libcudacxx -function(find_and_configure_libcudacxx) - include(${rapids-cmake-dir}/cpm/libcudacxx.cmake) - - set(exports BUILD_EXPORT_SET cuco-exports) - if(INSTALL_CUCO) - list(APPEND exports INSTALL_EXPORT_SET cuco-exports) - endif() - - rapids_cpm_libcudacxx(${exports}) - set(LIBCUDACXX_INCLUDE_DIR "${libcudacxx_SOURCE_DIR}/include" PARENT_SCOPE) -endfunction() - -find_and_configure_libcudacxx()