diff --git a/cmake/Findthrust.cmake b/cmake/Findthrust.cmake index 70399fb97..817d421d5 100644 --- a/cmake/Findthrust.cmake +++ b/cmake/Findthrust.cmake @@ -7,6 +7,8 @@ find_path(THRUST_INCLUDE_DIR NAMES "thrust/version.h") +list(APPEND THRUST_INCLUDE_DIR_VARS THRUST_INCLUDE_DIR) + if(THRUST_INCLUDE_DIR) file(STRINGS "${THRUST_INCLUDE_DIR}/thrust/version.h" THRUST_VERSION_STRING @@ -20,19 +22,48 @@ if(THRUST_INCLUDE_DIR) unset(THRUST_VERSION_STRING) set(THRUST_VERSION "${THRUST_VERSION_MAJOR}.${THRUST_VERSION_MINOR}.${THRUST_VERSION_PATCH}") + + + if(THRUST_VERSION VERSION_GREATER_EQUAL "2.0.0") + find_path(LIBCUDACXX_INCLUDE_DIR + HINTS + "${THRUST_INCLUDE_DIR}/../libcudacxx/include" + ${STDGPU_THRUST_PATHS} + NAMES + "cuda/std/version") + + find_path(CUB_INCLUDE_DIR + HINTS + "${THRUST_INCLUDE_DIR}/../cub" + ${STDGPU_THRUST_PATHS} + NAMES + "cub/version.cuh") + + list(APPEND THRUST_INCLUDE_DIR_VARS LIBCUDACXX_INCLUDE_DIR CUB_INCLUDE_DIR) + + mark_as_advanced(LIBCUDACXX_INCLUDE_DIR + CUB_INCLUDE_DIR) + endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(thrust - REQUIRED_VARS THRUST_INCLUDE_DIR + REQUIRED_VARS ${THRUST_INCLUDE_DIR_VARS} VERSION_VAR THRUST_VERSION) if(thrust_FOUND) + foreach(inc IN LISTS THRUST_INCLUDE_DIR_VARS) + list(APPEND THRUST_INCLUDE_DIRS "${${inc}}") + endforeach() + list(REMOVE_DUPLICATES THRUST_INCLUDE_DIRS) + add_library(thrust::thrust INTERFACE IMPORTED) - set_target_properties(thrust::thrust PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${THRUST_INCLUDE_DIR}") + set_target_properties(thrust::thrust PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${THRUST_INCLUDE_DIRS}") mark_as_advanced(THRUST_INCLUDE_DIR + THRUST_INCLUDE_DIR_VARS + THRUST_INCLUDE_DIRS THRUST_VERSION THRUST_VERSION_MAJOR THRUST_VERSION_MINOR diff --git a/tools/backend/check_install_openmp.sh b/tools/backend/check_install_openmp.sh index babacd7cd..bc73cab18 100644 --- a/tools/backend/check_install_openmp.sh +++ b/tools/backend/check_install_openmp.sh @@ -13,5 +13,5 @@ sh tools/backend/helper/create_empty_directory.sh build_install_test # Compile dependent project cmake -E cmake_echo_color --blue ">>>>> Check installation ($CONFIG)" -cmake -B build_install_test -S tests/install_test -DCMAKE_BUILD_TYPE=$CONFIG -Dstdgpu_ROOT=bin -Dthrust_ROOT=external/thrust $@ +cmake -B build_install_test -S tests/install_test -DCMAKE_BUILD_TYPE=$CONFIG -Dstdgpu_ROOT=bin -Dthrust_ROOT=external/cccl/thrust $@ cmake --build build_install_test --config ${CONFIG} --parallel 13 diff --git a/tools/backend/configure_openmp.sh b/tools/backend/configure_openmp.sh index e1c07b781..5eb326d0c 100644 --- a/tools/backend/configure_openmp.sh +++ b/tools/backend/configure_openmp.sh @@ -12,4 +12,4 @@ fi sh tools/backend/helper/create_empty_directory.sh build # Configure project -sh tools/backend/helper/configure.sh $CONFIG -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/thrust -DCMAKE_VERIFY_INTERFACE_HEADER_SETS=ON $@ +sh tools/backend/helper/configure.sh $CONFIG -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/cccl/thrust -DCMAKE_VERIFY_INTERFACE_HEADER_SETS=ON $@ diff --git a/tools/backend/configure_openmp_clang_tidy.sh b/tools/backend/configure_openmp_clang_tidy.sh index d099ba158..d04b80a1b 100644 --- a/tools/backend/configure_openmp_clang_tidy.sh +++ b/tools/backend/configure_openmp_clang_tidy.sh @@ -5,4 +5,4 @@ set -e sh tools/backend/helper/create_empty_directory.sh build # Configure project -sh tools/backend/helper/configure.sh Debug -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_ANALYZE_WITH_CLANG_TIDY=ON -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/thrust +sh tools/backend/helper/configure.sh Debug -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_ANALYZE_WITH_CLANG_TIDY=ON -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/cccl/thrust diff --git a/tools/backend/configure_openmp_cppcheck.sh b/tools/backend/configure_openmp_cppcheck.sh index aa014d1e2..7726aebb9 100644 --- a/tools/backend/configure_openmp_cppcheck.sh +++ b/tools/backend/configure_openmp_cppcheck.sh @@ -5,4 +5,4 @@ set -e sh tools/backend/helper/create_empty_directory.sh build # Configure project -sh tools/backend/helper/configure.sh Debug -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_ANALYZE_WITH_CPPCHECK=ON -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/thrust +sh tools/backend/helper/configure.sh Debug -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_ANALYZE_WITH_CPPCHECK=ON -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/cccl/thrust diff --git a/tools/backend/configure_openmp_documentation.sh b/tools/backend/configure_openmp_documentation.sh index 211244908..212fbfa61 100644 --- a/tools/backend/configure_openmp_documentation.sh +++ b/tools/backend/configure_openmp_documentation.sh @@ -5,4 +5,4 @@ set -e sh tools/backend/helper/create_empty_directory.sh build # Configure project -sh tools/backend/helper/configure.sh Release -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_BUILD_DOCUMENTATION=ON -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/thrust +sh tools/backend/helper/configure.sh Release -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_BUILD_DOCUMENTATION=ON -DSTDGPU_COMPILE_WARNING_AS_ERROR=ON -Dthrust_ROOT=external/cccl/thrust diff --git a/tools/backend/configure_openmp_lcov.sh b/tools/backend/configure_openmp_lcov.sh index c6b88cf96..5ba0533a4 100644 --- a/tools/backend/configure_openmp_lcov.sh +++ b/tools/backend/configure_openmp_lcov.sh @@ -5,4 +5,4 @@ set -e sh tools/backend/helper/create_empty_directory.sh build # Configure project -sh tools/backend/helper/configure.sh Debug -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_BUILD_TEST_COVERAGE=ON -Dthrust_ROOT=external/thrust +sh tools/backend/helper/configure.sh Debug -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_BUILD_TEST_COVERAGE=ON -Dthrust_ROOT=external/cccl/thrust diff --git a/tools/dev/download_thrust.sh b/tools/dev/download_thrust.sh index dbc5fa9cd..bbff1a02c 100644 --- a/tools/dev/download_thrust.sh +++ b/tools/dev/download_thrust.sh @@ -2,6 +2,6 @@ set -e cmake -E cmake_echo_color --blue ">>>>> Download thrust" -cmake -E chdir external git clone https://github.com/NVIDIA/thrust -cmake -E chdir external/thrust git fetch --all --tags --prune -cmake -E chdir external/thrust git checkout tags/1.17.2 +cmake -E chdir external git clone https://github.com/NVIDIA/cccl +cmake -E chdir external/cccl git fetch --all --tags --prune +cmake -E chdir external/cccl git checkout tags/v2.2.0