From f80316a4798d3c7847ce9d005973abd4ee9fc411 Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Tue, 28 Feb 2023 18:14:40 +0400 Subject: [PATCH 1/5] Ignore vscode directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 93835e48c..37d8ba566 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ discrete_voronoi.pgm *build*/ .idea/ +.vscode From c3ddc5fad4ac1a9669fb622f991726304b1bd2fa Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Mon, 27 Feb 2023 17:37:40 +0400 Subject: [PATCH 2/5] Fix clang / nvcc CI build --- CMakeLists.txt | 17 +++++++++++++++++ cmake/ThrustHeaderTesting.cmake | 2 ++ examples/CMakeLists.txt | 1 + internal/benchmark/CMakeLists.txt | 1 + testing/CMakeLists.txt | 2 ++ testing/cuda/copy_if.cu | 1 - testing/cuda/stream_per_thread.cmake | 2 ++ testing/fix_clang_nvcc_11.5.h | 24 ++++++++++++++++++++++++ testing/unittest/CMakeLists.txt | 3 +++ 9 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 testing/fix_clang_nvcc_11.5.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 606426b60..f45a707d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,23 @@ else() set(THRUST_TOPLEVEL_PROJECT OFF) endif() +## thrust_fix_clang_nvcc_build_for +# +# Modifies the given target to include a fix for the clang host compiler case. +# The fix consists of force-including a header into each compilation unit. +# +function(thrust_fix_clang_nvcc_build_for target) + if (UNIX) + # Path to the header containing the fix for clang + nvcc < 11.6. For more info, + # check the content of this header. + set(clang_fix_header_path "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/testing/fix_clang_nvcc_11.5.h") + + # Only affects host compiler + target_compile_options(${target} PRIVATE + $<$:-include"${clang_fix_header_path}">) + endif() +endfunction() + # This must be done before any languages are enabled: if (THRUST_TOPLEVEL_PROJECT) include(cmake/ThrustCompilerHacks.cmake) diff --git a/cmake/ThrustHeaderTesting.cmake b/cmake/ThrustHeaderTesting.cmake index 1c4ee003d..3b3e00ca8 100644 --- a/cmake/ThrustHeaderTesting.cmake +++ b/cmake/ThrustHeaderTesting.cmake @@ -133,6 +133,8 @@ foreach(thrust_target IN LISTS THRUST_TARGETS) ) endif() + thrust_fix_clang_nvcc_build_for(${headertest_target}) + add_dependencies(thrust.all.headers ${headertest_target}) add_dependencies(${config_prefix}.all ${headertest_target}) endforeach() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8acee075d..306ecb7a3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -95,6 +95,7 @@ function(thrust_add_example target_name_var example_name example_src thrust_targ target_link_libraries(${example_target} ${thrust_target}) target_include_directories(${example_target} PRIVATE "${Thrust_SOURCE_DIR}/examples") thrust_clone_target_properties(${example_target} ${thrust_target}) + thrust_fix_clang_nvcc_build_for(${example_target}) # Add to the active configuration's meta target add_dependencies(${config_meta_target} ${example_target}) diff --git a/internal/benchmark/CMakeLists.txt b/internal/benchmark/CMakeLists.txt index 86d5175bf..8c59747b8 100644 --- a/internal/benchmark/CMakeLists.txt +++ b/internal/benchmark/CMakeLists.txt @@ -23,6 +23,7 @@ foreach(thrust_target IN LISTS THRUST_TARGETS) target_link_libraries(${bench_target} PRIVATE ${thrust_target}) target_include_directories(${bench_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") thrust_clone_target_properties(${bench_target} ${thrust_target}) + thrust_fix_clang_nvcc_build_for(${bench_target}) add_dependencies(thrust.all.bench ${bench_target}) add_dependencies(${config_prefix}.all ${bench_target}) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index d12fbc2de..0f0749c4e 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -87,6 +87,8 @@ function(thrust_add_test target_name_var test_name test_src thrust_target) target_compile_definitions(${test_target} PRIVATE THRUST_TEST_DEVICE_SIDE) endif() + thrust_fix_clang_nvcc_build_for(${test_target}) + # Add to the active configuration's meta target add_dependencies(${config_meta_target} ${test_target}) diff --git a/testing/cuda/copy_if.cu b/testing/cuda/copy_if.cu index a7704a8fc..bb879b671 100644 --- a/testing/cuda/copy_if.cu +++ b/testing/cuda/copy_if.cu @@ -3,7 +3,6 @@ #include #include - template struct is_even { diff --git a/testing/cuda/stream_per_thread.cmake b/testing/cuda/stream_per_thread.cmake index 265f4fdc3..2cea2f938 100644 --- a/testing/cuda/stream_per_thread.cmake +++ b/testing/cuda/stream_per_thread.cmake @@ -4,6 +4,8 @@ set_target_properties(${test_target} PROPERTIES $<$,$>:--default-stream=per-thread> ) +thrust_fix_clang_nvcc_build_for(${test_target}) + # NVC++ does not have an equivalent option, and will always # use the global stream by default. if (CMAKE_CUDA_COMPILER_ID STREQUAL "Feta") diff --git a/testing/fix_clang_nvcc_11.5.h b/testing/fix_clang_nvcc_11.5.h new file mode 100644 index 000000000..279dca3f9 --- /dev/null +++ b/testing/fix_clang_nvcc_11.5.h @@ -0,0 +1,24 @@ +#pragma once + +#if defined(__NVCC__) && defined(__clang__) && __CUDACC_VER_MAJOR__ == 11 && \ + __CUDACC_VER_MINOR__ <= 5 + +#if defined(__NVCC_DIAG_PRAGMA_SUPPORT__) +# pragma nv_diag_suppress 3171 +#else +# pragma diag_suppress 3171 +#endif + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-compat" + +// Clang has a builtin called `__is_signed`. Unfortunately, libstdc++ headers +// use this name as an identifier. Clang has a workaround for that, it checks +// if `__is_signed` is `const static bool` as in libstdc++ headers and if so, +// disables the intrinsic for the rest of the TU: +// https://github.com/llvm/llvm-project/blob/f49b6afc231242dfee027d5da69734836097cd43/clang/lib/Parse/ParseDecl.cpp#L3552-L3566 +const static bool __is_signed = false; + +#pragma clang diagnostic pop +#endif // defined(__NVCC__) && defined(__clang__) && __CUDACC_VER_MAJOR__ == 11 && + // __CUDACC_VER_MINOR__ <= 5 diff --git a/testing/unittest/CMakeLists.txt b/testing/unittest/CMakeLists.txt index 9a652577b..4c0eb66cb 100644 --- a/testing/unittest/CMakeLists.txt +++ b/testing/unittest/CMakeLists.txt @@ -18,4 +18,7 @@ foreach(thrust_target IN LISTS THRUST_TARGETS) target_link_libraries(${framework_target} PUBLIC ${thrust_target}) target_include_directories(${framework_target} PRIVATE "${Thrust_SOURCE_DIR}/testing") thrust_clone_target_properties(${framework_target} ${thrust_target}) + + thrust_fix_clang_nvcc_build_for(${framework_target}) + endforeach() From 3660fd0d76005f5f96c991baccd1e04a45a094a1 Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Tue, 21 Feb 2023 19:23:21 +0400 Subject: [PATCH 3/5] Transition CI to CTK 11.7.0 --- .../deploy-documentation-github-pages.yml | 2 +- README.md | 32 +++++++++---------- ci/axis/cpu.yml | 2 +- ci/axis/gpu.yml | 2 +- ci/local/build.bash | 2 +- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy-documentation-github-pages.yml b/.github/workflows/deploy-documentation-github-pages.yml index d13918019..508764c5c 100644 --- a/.github/workflows/deploy-documentation-github-pages.yml +++ b/.github/workflows/deploy-documentation-github-pages.yml @@ -11,7 +11,7 @@ on: jobs: deploy-documentation-github-pages: runs-on: ubuntu-latest - container: gpuci/cccl:cuda11.5.1-devel-ubuntu20.04-gcc9 + container: gpuci/cccl:cuda11.7.0-devel-ubuntu20.04-gcc9 steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/README.md b/README.md index c91c11016..f426d5b08 100644 --- a/README.md +++ b/README.md @@ -206,37 +206,35 @@ Thrust is distributed under the [Apache License v2.0 with LLVM Exceptions]; ## CI Status - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + diff --git a/ci/axis/cpu.yml b/ci/axis/cpu.yml index 3cfa7400c..cc393169d 100644 --- a/ci/axis/cpu.yml +++ b/ci/axis/cpu.yml @@ -7,7 +7,7 @@ SDK_TYPE: - cuda SDK_VER: - - 11.5.2-devel + - 11.7.0-devel OS_TYPE: - ubuntu diff --git a/ci/axis/gpu.yml b/ci/axis/gpu.yml index e5126f23b..550083aab 100644 --- a/ci/axis/gpu.yml +++ b/ci/axis/gpu.yml @@ -7,7 +7,7 @@ SDK_TYPE: - cuda SDK_VER: - - 11.5.2-devel + - 11.7.0-devel OS_TYPE: - ubuntu diff --git a/ci/local/build.bash b/ci/local/build.bash index 484eed96a..8b20ef063 100755 --- a/ci/local/build.bash +++ b/ci/local/build.bash @@ -60,7 +60,7 @@ REPOSITORY_PATH=$(realpath ${SCRIPT_PATH}/../..) # FLAGS - Process command line flags. ################################################################################ -IMAGE="gpuci/cccl:cuda11.5.1-devel-ubuntu20.04-gcc9" +IMAGE="gpuci/cccl:cuda11.7.0-devel-ubuntu20.04-gcc9" LOCAL_IMAGE=0 From 1aab4d3816bb475efa24d58064a9135705835edd Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Sun, 5 Mar 2023 10:37:39 +0400 Subject: [PATCH 4/5] Bump CUB. --- dependencies/cub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/cub b/dependencies/cub index 5d12837f9..99aa5efbd 160000 --- a/dependencies/cub +++ b/dependencies/cub @@ -1 +1 @@ -Subproject commit 5d12837f92ee12016827ad6f1ccbbc963eb428ff +Subproject commit 99aa5efbd9e5cdc94e19da5d4fe9f059d5b1da1e From 440970a880d1e2cc0bbde3800d46f4d3c1713c87 Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Mon, 6 Mar 2023 07:59:22 +0400 Subject: [PATCH 5/5] Bump CUB. --- dependencies/cub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/cub b/dependencies/cub index 99aa5efbd..b4f7e2366 160000 --- a/dependencies/cub +++ b/dependencies/cub @@ -1 +1 @@ -Subproject commit 99aa5efbd9e5cdc94e19da5d4fe9f059d5b1da1e +Subproject commit b4f7e2366913618aca8556a62727991d0fc5f44b