From dfb229774f67d242441a79e1bf133c4239df02f1 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 20:54:59 +0000 Subject: [PATCH 01/64] Migrate Thrust/CUB CI configs to CMake presets. --- .github/workflows/pr.yml | 4 +- CMakePresets.json | 181 ++++++++++++++++++++++++++++++++++++--- ci/build_common.sh | 19 ++++ ci/build_cub.sh | 15 +--- ci/build_thrust.sh | 18 +--- ci/test_cub.sh | 8 +- ci/test_thrust.sh | 7 +- 7 files changed, 210 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ea2037323bb..187cf3238f8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -159,7 +159,7 @@ jobs: devcontainer_version: ${{ needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION }} examples: - name: CCCL Examples + name: CCCL Infrastructure if: ${{ !contains(github.event.head_commit.message, 'skip-tests') }} needs: [compute-nvcc-matrix, get-devcontainer-version] strategy: @@ -172,7 +172,7 @@ jobs: runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - cmake -S . --preset=examples -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc + cmake -S . --preset=ci-cccl -CMAKE_CUDA_ARCHITECTURE=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc ctest --preset=examples # This job is the final job that runs after all other jobs and is used for branch protection status checks. diff --git a/CMakePresets.json b/CMakePresets.json index 5905d4fcda4..d2c06bc5fc3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -12,6 +12,7 @@ "generator": "Ninja", "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", "CCCL_ENABLE_LIBCUDACXX": false, "CCCL_ENABLE_CUB": false, "CCCL_ENABLE_THRUST": false, @@ -20,16 +21,146 @@ } }, { - "name": "examples", - "displayName": "CCCL Examples", - "description": "Configure, build, and run the CCCL Examples", + "name": "ci-cub-base", + "hidden": true, + "inherits": "base", + "cacheVariables": { + "CCCL_ENABLE_CUB": true, + "CUB_ENABLE_TESTING": true, + "CUB_ENABLE_EXAMPLES": true, + "CUB_ENABLE_DIALECT_CPP11": false, + "CUB_ENABLE_DIALECT_CPP14": false, + "CUB_ENABLE_DIALECT_CPP17": false, + "CUB_ENABLE_DIALECT_CPP20": false + } + }, + { + "name": "ci-cub-cpp11", + "displayName": "CUB GitHub CI: C++11", + "inherits": "ci-cub-base", + "cacheVariables": { + "CUB_IGNORE_DEPRECATED_CPP_DIALECT": true, + "CUB_ENABLE_DIALECT_CPP11": true + } + }, + { + "name": "ci-cub-cpp14", + "displayName": "CUB GitHub CI: C++14", + "inherits": "ci-cub-base", + "cacheVariables": { + "CUB_ENABLE_DIALECT_CPP14": true + } + }, + { + "name": "ci-cub-cpp17", + "displayName": "CUB GitHub CI: C++17", + "inherits": "ci-cub-base", + "cacheVariables": { + "CUB_ENABLE_DIALECT_CPP17": true + } + }, + { + "name": "ci-cub-cpp20", + "displayName": "CUB GitHub CI: C++20", + "inherits": "ci-cub-base", + "cacheVariables": { + "CUB_ENABLE_DIALECT_CPP20": true + } + }, + { + "name": "ci-thrust-base", + "hidden": true, "inherits": "base", "cacheVariables": { - "CMAKE_CUDA_ARCHITECTURES": "70", - "CCCL_ENABLE_EXAMPLES": true + "CCCL_ENABLE_THRUST": true, + "THRUST_ENABLE_MULTICONFIG": true, + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP11": false, + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP14": false, + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP17": false, + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP20": false + } + }, + { + "name": "ci-thrust-cpp11", + "displayName": "Thrust GitHub CI: C++11", + "inherits": "ci-thrust-base", + "cacheVariables": { + "THRUST_IGNORE_DEPRECATED_CPP_DIALECT": true, + "THRUST_ENABLE_DIALECT_CPP11": true + } + }, + { + "name": "ci-thrust-cpp14", + "displayName": "Thrust GitHub CI: C++14", + "inherits": "ci-thrust-base", + "cacheVariables": { + "THRUST_ENABLE_DIALECT_CPP14": true + } + }, + { + "name": "ci-thrust-cpp17", + "displayName": "Thrust GitHub CI: C++17", + "inherits": "ci-thrust-base", + "cacheVariables": { + "THRUST_ENABLE_DIALECT_CPP17": true + } + }, + { + "name": "ci-thrust-cpp20", + "displayName": "Thrust GitHub CI: C++20", + "inherits": "ci-thrust-base", + "cacheVariables": { + "THRUST_ENABLE_DIALECT_CPP20": true + } + }, + { + "name": "ci-cccl", + "displayName": "CCCL Infrastructure Github CI", + "inherits": "base", + "cacheVariables": { + "CCCL_ENABLE_EXAMPLES": true, + "CCCL_ENABLE_TESTING": true } } ], + "buildPresets": [ + { + "name": "ci-cub-cpp11", + "configurePreset": "ci-cub-cpp11" + }, + { + "name": "ci-cub-cpp14", + "configurePreset": "ci-cub-cpp14" + }, + { + "name": "ci-cub-cpp17", + "configurePreset": "ci-cub-cpp17" + }, + { + "name": "ci-cub-cpp20", + "configurePreset": "ci-cub-cpp20" + }, + { + "name": "ci-thrust-cpp11", + "configurePreset": "ci-thrust-cpp11" + }, + { + "name": "ci-thrust-cpp14", + "configurePreset": "ci-thrust-cpp14" + }, + { + "name": "ci-thrust-cpp17", + "configurePreset": "ci-thrust-cpp17" + }, + { + "name": "ci-thrust-cpp20", + "configurePreset": "ci-thrust-cpp20" + }, + { + "name": "ci-cccl", + "configurePreset": "ci-cccl" + } + ], "testPresets": [ { "name": "base", @@ -43,15 +174,43 @@ } }, { - "name": "examples", - "configurePreset": "examples", + "name": "ci-cub-base", "inherits": "base", - "filter":{ - "include": { - "name": "^cccl\\.example\\." + "filter": { + "exclude": { + "name": "device_radix_sort" } } + }, + { + "name": "ci-cub-cpp11", + "configurePreset": "ci-cub-cpp11", + "inherits": "ci-cub-base" + }, + { + "name": "ci-cub-cpp14", + "configurePreset": "ci-cub-cpp14", + "inherits": "ci-cub-base" + }, + { + "name": "ci-cub-cpp17", + "configurePreset": "ci-cub-cpp17", + "inherits": "ci-cub-base" + }, + { + "name": "ci-cub-cpp20", + "configurePreset": "ci-cub-cpp20", + "inherits": "ci-cub-base" + }, + { + "name": "ci-thrust-cpp11", + "configurePreset": "ci-thrust-cpp11", + "inherits": "ci-cub-base" + }, + { + "name": "ci-cccl", + "configurePreset": "ci-cccl", + "inherits": "base" } ] } - diff --git a/ci/build_common.sh b/ci/build_common.sh index 7b298f0893d..28d152531c6 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -110,3 +110,22 @@ function configure_and_build() { configure "$CMAKE_OPTIONS" build "$BUILD_NAME" } + +function configure_and_build_preset() +{ + local BUILD_NAME=$1 + local PRESET=$2 + local CMAKE_OPTIONS=$3 + + set CMAKE_BUILD_PARALLEL_LEVEL=$PARALLEL_LEVEL + + pushd .. + + cmake --preset=$PRESET $COMMON_CMAKE_OPTIONS $CMAKE_OPTIONS + echo "$BUILD_NAME configure complete." + + cmake --build --preset=$PRESET + echo "$BUILD_NAME build complete." + + popd +} diff --git a/ci/build_cub.sh b/ci/build_cub.sh index f3cdd40546a..c2e5c908118 100755 --- a/ci/build_cub.sh +++ b/ci/build_cub.sh @@ -20,18 +20,11 @@ else echo "CUDA version is $NVCC_VERSION. Not building CUB benchmarks because CUDA version is less than 11.5." fi +PRESET="ci-cub-cpp$CXX_STANDARD" + +# TODO Can we move the benchmark logic to CMake? CMAKE_OPTIONS=" - -DCCCL_ENABLE_THRUST=OFF \ - -DCCCL_ENABLE_LIBCUDACXX=OFF \ - -DCCCL_ENABLE_CUB=ON \ - -DCCCL_ENABLE_TESTING=OFF \ - -DCUB_ENABLE_DIALECT_CPP11=$(if [[ $CXX_STANDARD -ne 11 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DCUB_ENABLE_DIALECT_CPP14=$(if [[ $CXX_STANDARD -ne 14 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DCUB_ENABLE_DIALECT_CPP17=$(if [[ $CXX_STANDARD -ne 17 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DCUB_ENABLE_DIALECT_CPP20=$(if [[ $CXX_STANDARD -ne 20 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT=ON \ - -DCUB_IGNORE_DEPRECATED_CPP_DIALECT=ON \ -DCUB_ENABLE_BENCHMARKS="$ENABLE_CUB_BENCHMARKS"\ " -configure_and_build "CUB" "$CMAKE_OPTIONS" +configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" diff --git a/ci/build_thrust.sh b/ci/build_thrust.sh index e3cea1947d6..4e3d135a293 100755 --- a/ci/build_thrust.sh +++ b/ci/build_thrust.sh @@ -2,18 +2,8 @@ source "$(dirname "$0")/build_common.sh" -CMAKE_OPTIONS=" - -DCCCL_ENABLE_THRUST=ON \ - -DCCCL_ENABLE_LIBCUDACXX=OFF \ - -DCCCL_ENABLE_CUB=OFF \ - -DCCCL_ENABLE_TESTING=OFF \ - -DTHRUST_ENABLE_MULTICONFIG=ON \ - -DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP11=$(if [[ $CXX_STANDARD -ne 11 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP14=$(if [[ $CXX_STANDARD -ne 14 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP17=$(if [[ $CXX_STANDARD -ne 17 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP20=$(if [[ $CXX_STANDARD -ne 20 ]]; then echo "OFF"; else echo "ON"; fi) \ - -DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT=ON \ - -DCUB_IGNORE_DEPRECATED_CPP_DIALECT=ON \ -" +PRESET="ci-thrust-cpp$CXX_STANDARD" -configure_and_build "Thrust" "$CMAKE_OPTIONS" +CMAKE_OPTIONS="" + +configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" diff --git a/ci/test_cub.sh b/ci/test_cub.sh index 456a8b38fca..14442980c3a 100755 --- a/ci/test_cub.sh +++ b/ci/test_cub.sh @@ -4,6 +4,10 @@ source "$(dirname "$0")/build_common.sh" ./build_cub.sh "$@" -ctest --test-dir ${BUILD_DIR} --output-on-failure -E device_radix_sort +PRESET="ci-cub-cpp$CXX_STANDARD" -echo "CUB test complete" \ No newline at end of file +pushd .. +ctest --preset=$PRESET +popd + +echo "CUB test complete" diff --git a/ci/test_thrust.sh b/ci/test_thrust.sh index 740be1e28b7..346712f2014 100755 --- a/ci/test_thrust.sh +++ b/ci/test_thrust.sh @@ -4,7 +4,10 @@ source "$(dirname "$0")/build_common.sh" ./build_thrust.sh "$@" -ctest --test-dir ${BUILD_DIR} --output-on-failure +PRESET="ci-thrust-cpp$CXX_STANDARD" -echo "Thrust test complete" +pushd .. +ctest --preset=$PRESET +popd +echo "Thrust test complete" From 88408e09c8cff0a47a872b92eef590e076f76f06 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 21:11:05 +0000 Subject: [PATCH 02/64] Fix trivial issues from CI. --- .github/workflows/pr.yml | 6 +++--- CMakePresets.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 187cf3238f8..38fcbadbd10 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -158,7 +158,7 @@ jobs: test_script: "./ci/test_libcudacxx.sh" devcontainer_version: ${{ needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION }} - examples: + cccl: name: CCCL Infrastructure if: ${{ !contains(github.event.head_commit.message, 'skip-tests') }} needs: [compute-nvcc-matrix, get-devcontainer-version] @@ -173,7 +173,7 @@ jobs: image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | cmake -S . --preset=ci-cccl -CMAKE_CUDA_ARCHITECTURE=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc - ctest --preset=examples + ctest --preset=ci-cccl # This job is the final job that runs after all other jobs and is used for branch protection status checks. # See: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks @@ -185,6 +185,6 @@ jobs: - libcudacxx - nvrtc - thrust - - examples + - cccl steps: - run: echo "CI success" diff --git a/CMakePresets.json b/CMakePresets.json index d2c06bc5fc3..0566bf1eda7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -175,6 +175,7 @@ }, { "name": "ci-cub-base", + "hidden": true, "inherits": "base", "filter": { "exclude": { From eacd9c55b8f940fda09674bbaed6748cd9a98658 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 21:17:44 +0000 Subject: [PATCH 03/64] Fix typo. --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 38fcbadbd10..447bcff0a8c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -172,7 +172,7 @@ jobs: runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - cmake -S . --preset=ci-cccl -CMAKE_CUDA_ARCHITECTURE=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc + cmake -S . --preset=ci-cccl -DCMAKE_CUDA_ARCHITECTURE=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc ctest --preset=ci-cccl # This job is the final job that runs after all other jobs and is used for branch protection status checks. From fc7c323dd1fc38bb7a15235c1b950f2c759b4c34 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 21:52:23 +0000 Subject: [PATCH 04/64] Fix CMake warning. CMake requires a language be enabled to determine some install paths. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36fb5bdd47b..3c578997c8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,8 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}") set(CCCL_TOPLEVEL_PROJECT ON) endif() -project(CCCL LANGUAGES NONE) +# Enable CXX so CMake can configure install paths +project(CCCL LANGUAGES CXX) # Optionally include installation rules for non-top-level builds: option(CCCL_ENABLE_INSTALL_RULES "Enable installation of CCCL." ${CCCL_TOPLEVEL_PROJECT}) From b40d65c1ee14882b3ec42350dffe5b82d0b710ec Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 22:06:33 +0000 Subject: [PATCH 05/64] More typos. --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 447bcff0a8c..30f45c85e21 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -172,7 +172,7 @@ jobs: runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - cmake -S . --preset=ci-cccl -DCMAKE_CUDA_ARCHITECTURE=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc + cmake -S . --preset=ci-cccl -DCMAKE_CUDA_ARCHITECTURES=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc ctest --preset=ci-cccl # This job is the final job that runs after all other jobs and is used for branch protection status checks. From be5a3f26b54066f7b073782f7c2db08a335cfdda Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 22:07:18 +0000 Subject: [PATCH 06/64] Always enable install rules in config preset base. --- CMakePresets.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 0566bf1eda7..89359b58224 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -17,7 +17,10 @@ "CCCL_ENABLE_CUB": false, "CCCL_ENABLE_THRUST": false, "CCCL_ENABLE_TESTING": false, - "CCCL_ENABLE_EXAMPLES": false + "CCCL_ENABLE_EXAMPLES": false, + "libcudacxx_ENABLE_INSTALL_RULES": true, + "CUB_ENABLE_INSTALL_RULES": true, + "THRUST_ENABLE_INSTALL_RULES": true } }, { From 25e5f7cb5bf2f2155e202f2034f087df088ea805 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 22:16:00 +0000 Subject: [PATCH 07/64] Hopefully fix CCCL Infra CI for good. --- .github/workflows/pr.yml | 4 ++-- CMakePresets.json | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 30f45c85e21..aa36fa49393 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -168,11 +168,11 @@ jobs: include: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.FULL_MATRIX) }} uses: ./.github/workflows/run-as-coder.yml with: - name: CCCL Examples CUDA${{matrix.cuda}} ${{matrix.compiler.name}}${{matrix.compiler.version}} + name: CCCL Infra CUDA${{matrix.cuda}} ${{matrix.compiler.name}}${{matrix.compiler.version}} runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - cmake -S . --preset=ci-cccl -DCMAKE_CUDA_ARCHITECTURES=70 -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} -DCMAKE_CUDA_COMPILER=nvcc + cmake -S . --preset=ci-cccl -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} ctest --preset=ci-cccl # This job is the final job that runs after all other jobs and is used for branch protection status checks. diff --git a/CMakePresets.json b/CMakePresets.json index 89359b58224..2a705b587fc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -121,6 +121,8 @@ "displayName": "CCCL Infrastructure Github CI", "inherits": "base", "cacheVariables": { + "CMAKE_CUDA_COMPILER": "nvcc", + "CMAKE_CUDA_ARCHITECTURES": "70-virtual", "CCCL_ENABLE_EXAMPLES": true, "CCCL_ENABLE_TESTING": true } From acfeaa546474ea667b9e0e6eaec056b5293584bb Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 22:52:38 +0000 Subject: [PATCH 08/64] Build CCCL infra with both sm70 PTX and SASS. --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 2a705b587fc..76fd5a44043 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -122,7 +122,7 @@ "inherits": "base", "cacheVariables": { "CMAKE_CUDA_COMPILER": "nvcc", - "CMAKE_CUDA_ARCHITECTURES": "70-virtual", + "CMAKE_CUDA_ARCHITECTURES": "70;70-virtual", "CCCL_ENABLE_EXAMPLES": true, "CCCL_ENABLE_TESTING": true } From 6491b932729800753f1a0cd0f5715d142fdff1b4 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 11 Aug 2023 23:35:56 +0000 Subject: [PATCH 09/64] Add some missing test presets --- CMakePresets.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index 76fd5a44043..802f82c571e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -213,6 +213,21 @@ "configurePreset": "ci-thrust-cpp11", "inherits": "ci-cub-base" }, + { + "name": "ci-thrust-cpp14", + "configurePreset": "ci-thrust-cpp14", + "inherits": "ci-cub-base" + }, + { + "name": "ci-thrust-cpp17", + "configurePreset": "ci-thrust-cpp17", + "inherits": "ci-cub-base" + }, + { + "name": "ci-thrust-cpp20", + "configurePreset": "ci-thrust-cpp20", + "inherits": "ci-cub-base" + }, { "name": "ci-cccl", "configurePreset": "ci-cccl", From 48cd5eb089a3cc91ef4438ff12bf63ca239e7844 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 17 Aug 2023 23:20:46 +0000 Subject: [PATCH 10/64] Remove CI refs from preset names --- CMakePresets.json | 146 +++++++++++++++++++++++----------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 802f82c571e..dbbf914c727 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -24,7 +24,7 @@ } }, { - "name": "ci-cub-base", + "name": "cub-base", "hidden": true, "inherits": "base", "cacheVariables": { @@ -38,40 +38,40 @@ } }, { - "name": "ci-cub-cpp11", - "displayName": "CUB GitHub CI: C++11", - "inherits": "ci-cub-base", + "name": "cub-cpp11", + "displayName": "CUB: C++11", + "inherits": "cub-base", "cacheVariables": { "CUB_IGNORE_DEPRECATED_CPP_DIALECT": true, "CUB_ENABLE_DIALECT_CPP11": true } }, { - "name": "ci-cub-cpp14", - "displayName": "CUB GitHub CI: C++14", - "inherits": "ci-cub-base", + "name": "cub-cpp14", + "displayName": "CUB: C++14", + "inherits": "cub-base", "cacheVariables": { "CUB_ENABLE_DIALECT_CPP14": true } }, { - "name": "ci-cub-cpp17", - "displayName": "CUB GitHub CI: C++17", - "inherits": "ci-cub-base", + "name": "cub-cpp17", + "displayName": "CUB: C++17", + "inherits": "cub-base", "cacheVariables": { "CUB_ENABLE_DIALECT_CPP17": true } }, { - "name": "ci-cub-cpp20", - "displayName": "CUB GitHub CI: C++20", - "inherits": "ci-cub-base", + "name": "cub-cpp20", + "displayName": "CUB: C++20", + "inherits": "cub-base", "cacheVariables": { "CUB_ENABLE_DIALECT_CPP20": true } }, { - "name": "ci-thrust-base", + "name": "thrust-base", "hidden": true, "inherits": "base", "cacheVariables": { @@ -84,41 +84,41 @@ } }, { - "name": "ci-thrust-cpp11", - "displayName": "Thrust GitHub CI: C++11", - "inherits": "ci-thrust-base", + "name": "thrust-cpp11", + "displayName": "Thrust: C++11", + "inherits": "thrust-base", "cacheVariables": { "THRUST_IGNORE_DEPRECATED_CPP_DIALECT": true, "THRUST_ENABLE_DIALECT_CPP11": true } }, { - "name": "ci-thrust-cpp14", - "displayName": "Thrust GitHub CI: C++14", - "inherits": "ci-thrust-base", + "name": "thrust-cpp14", + "displayName": "Thrust: C++14", + "inherits": "thrust-base", "cacheVariables": { "THRUST_ENABLE_DIALECT_CPP14": true } }, { - "name": "ci-thrust-cpp17", - "displayName": "Thrust GitHub CI: C++17", - "inherits": "ci-thrust-base", + "name": "thrust-cpp17", + "displayName": "Thrust: C++17", + "inherits": "thrust-base", "cacheVariables": { "THRUST_ENABLE_DIALECT_CPP17": true } }, { - "name": "ci-thrust-cpp20", - "displayName": "Thrust GitHub CI: C++20", - "inherits": "ci-thrust-base", + "name": "thrust-cpp20", + "displayName": "Thrust: C++20", + "inherits": "thrust-base", "cacheVariables": { "THRUST_ENABLE_DIALECT_CPP20": true } }, { - "name": "ci-cccl", - "displayName": "CCCL Infrastructure Github CI", + "name": "cccl", + "displayName": "CCCL Infrastructure", "inherits": "base", "cacheVariables": { "CMAKE_CUDA_COMPILER": "nvcc", @@ -130,40 +130,40 @@ ], "buildPresets": [ { - "name": "ci-cub-cpp11", - "configurePreset": "ci-cub-cpp11" + "name": "cub-cpp11", + "configurePreset": "cub-cpp11" }, { - "name": "ci-cub-cpp14", - "configurePreset": "ci-cub-cpp14" + "name": "cub-cpp14", + "configurePreset": "cub-cpp14" }, { - "name": "ci-cub-cpp17", - "configurePreset": "ci-cub-cpp17" + "name": "cub-cpp17", + "configurePreset": "cub-cpp17" }, { - "name": "ci-cub-cpp20", - "configurePreset": "ci-cub-cpp20" + "name": "cub-cpp20", + "configurePreset": "cub-cpp20" }, { - "name": "ci-thrust-cpp11", - "configurePreset": "ci-thrust-cpp11" + "name": "thrust-cpp11", + "configurePreset": "thrust-cpp11" }, { - "name": "ci-thrust-cpp14", - "configurePreset": "ci-thrust-cpp14" + "name": "thrust-cpp14", + "configurePreset": "thrust-cpp14" }, { - "name": "ci-thrust-cpp17", - "configurePreset": "ci-thrust-cpp17" + "name": "thrust-cpp17", + "configurePreset": "thrust-cpp17" }, { - "name": "ci-thrust-cpp20", - "configurePreset": "ci-thrust-cpp20" + "name": "thrust-cpp20", + "configurePreset": "thrust-cpp20" }, { - "name": "ci-cccl", - "configurePreset": "ci-cccl" + "name": "cccl", + "configurePreset": "cccl" } ], "testPresets": [ @@ -179,7 +179,7 @@ } }, { - "name": "ci-cub-base", + "name": "cub-base", "hidden": true, "inherits": "base", "filter": { @@ -189,48 +189,48 @@ } }, { - "name": "ci-cub-cpp11", - "configurePreset": "ci-cub-cpp11", - "inherits": "ci-cub-base" + "name": "cub-cpp11", + "configurePreset": "cub-cpp11", + "inherits": "cub-base" }, { - "name": "ci-cub-cpp14", - "configurePreset": "ci-cub-cpp14", - "inherits": "ci-cub-base" + "name": "cub-cpp14", + "configurePreset": "cub-cpp14", + "inherits": "cub-base" }, { - "name": "ci-cub-cpp17", - "configurePreset": "ci-cub-cpp17", - "inherits": "ci-cub-base" + "name": "cub-cpp17", + "configurePreset": "cub-cpp17", + "inherits": "cub-base" }, { - "name": "ci-cub-cpp20", - "configurePreset": "ci-cub-cpp20", - "inherits": "ci-cub-base" + "name": "cub-cpp20", + "configurePreset": "cub-cpp20", + "inherits": "cub-base" }, { - "name": "ci-thrust-cpp11", - "configurePreset": "ci-thrust-cpp11", - "inherits": "ci-cub-base" + "name": "thrust-cpp11", + "configurePreset": "thrust-cpp11", + "inherits": "cub-base" }, { - "name": "ci-thrust-cpp14", - "configurePreset": "ci-thrust-cpp14", - "inherits": "ci-cub-base" + "name": "thrust-cpp14", + "configurePreset": "thrust-cpp14", + "inherits": "cub-base" }, { - "name": "ci-thrust-cpp17", - "configurePreset": "ci-thrust-cpp17", - "inherits": "ci-cub-base" + "name": "thrust-cpp17", + "configurePreset": "thrust-cpp17", + "inherits": "cub-base" }, { - "name": "ci-thrust-cpp20", - "configurePreset": "ci-thrust-cpp20", - "inherits": "ci-cub-base" + "name": "thrust-cpp20", + "configurePreset": "thrust-cpp20", + "inherits": "cub-base" }, { - "name": "ci-cccl", - "configurePreset": "ci-cccl", + "name": "cccl", + "configurePreset": "cccl", "inherits": "base" } ] From adafffd657a80c7608374d182f4003caeb1e43f6 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 14:03:47 +0000 Subject: [PATCH 11/64] Update the preset names in the CI scripts --- .github/workflows/pr.yml | 4 ++-- ci/build_thrust.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index aa36fa49393..fde0c1037eb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -172,8 +172,8 @@ jobs: runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - cmake -S . --preset=ci-cccl -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} - ctest --preset=ci-cccl + cmake -S . --preset=cccl -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} + ctest --preset=cccl # This job is the final job that runs after all other jobs and is used for branch protection status checks. # See: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks diff --git a/ci/build_thrust.sh b/ci/build_thrust.sh index 4e3d135a293..887f33b34b1 100755 --- a/ci/build_thrust.sh +++ b/ci/build_thrust.sh @@ -2,7 +2,7 @@ source "$(dirname "$0")/build_common.sh" -PRESET="ci-thrust-cpp$CXX_STANDARD" +PRESET="thrust-cpp$CXX_STANDARD" CMAKE_OPTIONS="" From cd5b458639e58422035e5353443b4208205265ca Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 14:23:31 +0000 Subject: [PATCH 12/64] More preset renaming. --- ci/build_cub.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_cub.sh b/ci/build_cub.sh index c2e5c908118..1778aa99dde 100755 --- a/ci/build_cub.sh +++ b/ci/build_cub.sh @@ -20,7 +20,7 @@ else echo "CUDA version is $NVCC_VERSION. Not building CUB benchmarks because CUDA version is less than 11.5." fi -PRESET="ci-cub-cpp$CXX_STANDARD" +PRESET="cub-cpp$CXX_STANDARD" # TODO Can we move the benchmark logic to CMake? CMAKE_OPTIONS=" From aeee57bce9cc83c2eb61326c2667b8d1630fcc66 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 17:25:02 +0000 Subject: [PATCH 13/64] Setup presets to use per-devcontainer build dirs. Extract an `CCCL_BUILD_INFIX` that will be used in the build paths: `${CCCL_SOURCE_DIR}/build/${CCCL_BUILD_INFIX}/${CMAKE_PRESET}/`. When `CCCL_BUILD_INFIX` is undefined (e.g. a preset is directly configured by other tools instead of our CI scripts), the builds will be configured in `${CCCL_SOURCE_DIR}/build/${CMAKE_PRESET}/`. --- CMakePresets.json | 2 +- ci/build_common.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index dbbf914c727..1eaeaf0c468 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,7 @@ "name": "base", "hidden": true, "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}", + "binaryDir": "${sourceDir}/build/$env{CCCL_BUILD_INFIX}/${presetName}", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", "CCCL_ENABLE_LIBCUDACXX": false, diff --git a/ci/build_common.sh b/ci/build_common.sh index 28d152531c6..a90bfa9cf01 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -59,11 +59,14 @@ readonly PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)} readonly NVCC_VERSION=$($CUDA_COMPILER --version | grep release | awk '{print $6}' | cut -c2-) if [ -z ${DEVCONTAINER_NAME+x} ]; then - BUILD_DIR=../build/local + CCCL_BUILD_INFIX=local else - BUILD_DIR=../build/${DEVCONTAINER_NAME} + CCCL_BUILD_INFIX=${DEVCONTAINER_NAME} fi +# Presets will be configured in this directory: +BUILD_DIR=../build/${CCCL_BUILD_INFIX} + # The most recent build will always be symlinked to cccl/build/latest mkdir -p $BUILD_DIR rm -f ../build/latest From b2e44d8add6a597ec17ec9a3582ff51e38352fe3 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 17:25:27 +0000 Subject: [PATCH 14/64] More preset name updates.... --- ci/test_cub.sh | 2 +- ci/test_thrust.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test_cub.sh b/ci/test_cub.sh index 14442980c3a..4df00baa6dc 100755 --- a/ci/test_cub.sh +++ b/ci/test_cub.sh @@ -4,7 +4,7 @@ source "$(dirname "$0")/build_common.sh" ./build_cub.sh "$@" -PRESET="ci-cub-cpp$CXX_STANDARD" +PRESET="cub-cpp$CXX_STANDARD" pushd .. ctest --preset=$PRESET diff --git a/ci/test_thrust.sh b/ci/test_thrust.sh index 346712f2014..bc6a51b2b5f 100755 --- a/ci/test_thrust.sh +++ b/ci/test_thrust.sh @@ -4,7 +4,7 @@ source "$(dirname "$0")/build_common.sh" ./build_thrust.sh "$@" -PRESET="ci-thrust-cpp$CXX_STANDARD" +PRESET="thrust-cpp$CXX_STANDARD" pushd .. ctest --preset=$PRESET From 74310bbed26b2307b22b3d01c46fd43fb7505a2d Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 17:29:36 +0000 Subject: [PATCH 15/64] Make build_common.sh more preset-friendly. - Move global cmake options to env vars. - Split the preset config/build functions. - Enable sccache output in build_preset(). --- ci/build_common.sh | 83 ++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index a90bfa9cf01..d3ffa4fc5d6 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -72,63 +72,66 @@ mkdir -p $BUILD_DIR rm -f ../build/latest ln -sf $BUILD_DIR ../build/latest -COMMON_CMAKE_OPTIONS=" - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=${CXX_STANDARD} \ - -DCMAKE_CUDA_STANDARD=${CXX_STANDARD} \ - -DCMAKE_CXX_COMPILER=${HOST_COMPILER} \ - -DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} \ - -DCMAKE_CUDA_HOST_COMPILER=${HOST_COMPILER} \ - -DCMAKE_CUDA_ARCHITECTURES=${GPU_ARCHS} \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -" +# Prepare environment for CMake: +export CCCL_BUILD_INFIX +export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" +export CMAKE_EXPORT_COMPILE_COMMANDS=1 +export CTEST_PARALLEL_LEVEL="${PARALLEL_LEVEL}" +export CUDAARCHS="${GPU_ARCHS}" +export CUDACXX="${CUDA_COMPILER}" +export CUDAHOSTCXX="${HOST_COMPILER}" +export CXX="${HOST_COMPILER}" echo "========================================" echo "Begin build" echo "pwd=$(pwd)" -echo "NVCC_VERSION=$NVCC_VERSION" -echo "HOST_COMPILER=$HOST_COMPILER" -echo "CXX_STANDARD=$CXX_STANDARD" -echo "GPU_ARCHS=$GPU_ARCHS" -echo "PARALLEL_LEVEL=$PARALLEL_LEVEL" echo "BUILD_DIR=$BUILD_DIR" +echo "CXX_STANDARD=$CXX_STANDARD" +echo "CXX=$CXX" +echo "CUDACXX=$CUDACXX" +echo "CUDAHOSTCXX=$CUDAHOSTCXX" +echo "CUDAARCHS=$CUDAARCHS" +echo "NVCC_VERSION=$NVCC_VERSION" +echo "CMAKE_BUILD_PARALLEL_LEVEL=$CMAKE_BUILD_PARALLEL_LEVEL" +echo "CTEST_PARALLEL_LEVEL=$CTEST_PARALLEL_LEVEL" +echo "CCCL_BUILD_INFIX=$CCCL_BUILD_INFIX" echo "========================================" -function configure(){ - local CMAKE_OPTIONS=$1 - cmake -S .. -B $BUILD_DIR $COMMON_CMAKE_OPTIONS $CMAKE_OPTIONS -G Ninja -} - -function build(){ +function configure_preset() +{ local BUILD_NAME=$1 - source "./sccache_stats.sh" start - cmake --build $BUILD_DIR --parallel $PARALLEL_LEVEL - echo "${BUILD_NAME} build complete" - source "./sccache_stats.sh" end -} + local PRESET=$2 + local CMAKE_OPTIONS=$3 -function configure_and_build() { - local BUILD_NAME=$1 - local CMAKE_OPTIONS=$2 - configure "$CMAKE_OPTIONS" - build "$BUILD_NAME" + pushd .. > /dev/null + + cmake --preset=$PRESET $CMAKE_OPTIONS --log-level=VERBOSE --trace 2>&1 | tee config.log + echo "$BUILD_NAME configure complete." + + popd > /dev/null } -function configure_and_build_preset() +function build_preset() { local BUILD_NAME=$1 local PRESET=$2 - local CMAKE_OPTIONS=$3 - set CMAKE_BUILD_PARALLEL_LEVEL=$PARALLEL_LEVEL - - pushd .. - - cmake --preset=$PRESET $COMMON_CMAKE_OPTIONS $CMAKE_OPTIONS - echo "$BUILD_NAME configure complete." + source "./sccache_stats.sh" "start" + pushd .. > /dev/null cmake --build --preset=$PRESET echo "$BUILD_NAME build complete." - popd + popd > /dev/null + source "./sccache_stats.sh" "end" +} + +function configure_and_build_preset() +{ + local BUILD_NAME=$1 + local PRESET=$2 + local CMAKE_OPTIONS=$3 + + configure_preset "$BUILD_NAME" "$PRESET" "$CMAKE_OPTIONS" + build_preset "$BUILD_NAME" "$PRESET" } From 9ebdf463894945117b187ce2e5ebfc3f26d75198 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 17:32:09 +0000 Subject: [PATCH 16/64] Remove compiler hacks that break CMake. --- cub/CMakeLists.txt | 1 - cub/cmake/CubCompilerHacks.cmake | 16 ---------------- thrust/CMakeLists.txt | 5 ++--- thrust/cmake/ThrustCompilerHacks.cmake | 16 ---------------- 4 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 cub/cmake/CubCompilerHacks.cmake delete mode 100644 thrust/cmake/ThrustCompilerHacks.cmake diff --git a/cub/CMakeLists.txt b/cub/CMakeLists.txt index bc34ce41050..12e8eeda68a 100644 --- a/cub/CMakeLists.txt +++ b/cub/CMakeLists.txt @@ -14,7 +14,6 @@ endif () # This must be done before any languages are enabled: if (CUB_TOPLEVEL_PROJECT) cmake_minimum_required(VERSION 3.21) - include(cmake/CubCompilerHacks.cmake) endif() # This must appear after our Compiler Hacks or else CMake will delete the cache diff --git a/cub/cmake/CubCompilerHacks.cmake b/cub/cmake/CubCompilerHacks.cmake deleted file mode 100644 index 00cee98289e..00000000000 --- a/cub/cmake/CubCompilerHacks.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# This file must be included before enabling any languages. - -if (NOT ("${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "" OR - "${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "${CMAKE_CXX_COMPILER}")) - set(tmp "${CMAKE_CUDA_HOST_COMPILER}") - unset(CMAKE_CUDA_HOST_COMPILER CACHE) - message(FATAL_ERROR - "For convenience, CUB's test harness uses CMAKE_CXX_COMPILER for the " - "CUDA host compiler. Refusing to overwrite specified " - "CMAKE_CUDA_HOST_COMPILER -- please reconfigure without setting this " - "variable. Currently:\n" - "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}\n" - "CMAKE_CUDA_HOST_COMPILER=${tmp}" - ) -endif () -set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}") diff --git a/thrust/CMakeLists.txt b/thrust/CMakeLists.txt index 650daf0e1f9..e6c4186e97a 100644 --- a/thrust/CMakeLists.txt +++ b/thrust/CMakeLists.txt @@ -10,7 +10,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}") set(THRUST_TOPLEVEL_PROJECT ON) endif() -## thrust_fix_clang_nvcc_build_for +## 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. @@ -22,7 +22,7 @@ function(thrust_fix_clang_nvcc_build_for target) 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 + target_compile_options(${target} PRIVATE "$<$:-include${clang_fix_header_path}>") endif() endfunction() @@ -30,7 +30,6 @@ endfunction() # This must be done before any languages are enabled: if (THRUST_TOPLEVEL_PROJECT) cmake_minimum_required(VERSION 3.21) - include(cmake/ThrustCompilerHacks.cmake) endif() # This must appear after our Compiler Hacks or else CMake will delete the cache diff --git a/thrust/cmake/ThrustCompilerHacks.cmake b/thrust/cmake/ThrustCompilerHacks.cmake deleted file mode 100644 index 1eeafa7757c..00000000000 --- a/thrust/cmake/ThrustCompilerHacks.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# This file must be included before enabling any languages. - -if (NOT ("${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "" OR - "${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "${CMAKE_CXX_COMPILER}")) - set(tmp "${CMAKE_CUDA_HOST_COMPILER}") - unset(CMAKE_CUDA_HOST_COMPILER CACHE) - message(FATAL_ERROR - "For convenience, Thrust's test harness uses CMAKE_CXX_COMPILER for the " - "CUDA host compiler. Refusing to overwrite specified " - "CMAKE_CUDA_HOST_COMPILER -- please reconfigure without setting this " - "variable. Currently:\n" - "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}\n" - "CMAKE_CUDA_HOST_COMPILER=${tmp}" - ) -endif () -set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}") From c065df870273d8450516e1de9e873ffb4818afba Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 17:34:57 +0000 Subject: [PATCH 17/64] Migrate libcu++ to cmake presets. Configure step only, still need to invoke lit for testing. --- CMakePresets.json | 49 ++++++++++++++++++++++++++++++++++++++++++ ci/build_libcudacxx.sh | 14 +++++------- ci/test_libcudacxx.sh | 16 ++++++-------- 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 1eaeaf0c468..3a8bc5f4406 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -23,6 +23,55 @@ "THRUST_ENABLE_INSTALL_RULES": true } }, + { + "name": "libcudacxx-base", + "hidden": true, + "inherits": "base", + "cacheVariables": { + "CCCL_ENABLE_LIBCUDACXX": true, + "LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS": true + } + }, + { + "name": "libcudacxx-cpp11", + "displayName": "libcu++: C++11 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "11", + "CMAKE_CUDA_STANDARD": "11" + + } + }, + { + "name": "libcudacxx-cpp14", + "displayName": "libcu++: C++14 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "14", + "CMAKE_CUDA_STANDARD": "14" + + } + }, + { + "name": "libcudacxx-cpp17", + "displayName": "libcu++: C++17 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "17", + "CMAKE_CUDA_STANDARD": "17" + + } + }, + { + "name": "libcudacxx-cpp20", + "displayName": "libcu++: C++20 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "20", + "CMAKE_CUDA_STANDARD": "20" + + } + }, { "name": "cub-base", "hidden": true, diff --git a/ci/build_libcudacxx.sh b/ci/build_libcudacxx.sh index 9bdf1d94522..9bbdcefed30 100755 --- a/ci/build_libcudacxx.sh +++ b/ci/build_libcudacxx.sh @@ -2,15 +2,11 @@ source "$(dirname "$0")/build_common.sh" -CMAKE_OPTIONS=" - -DCCCL_ENABLE_THRUST=OFF \ - -DCCCL_ENABLE_LIBCUDACXX=ON \ - -DCCCL_ENABLE_CUB=OFF \ - -DCCCL_ENABLE_TESTING=OFF \ - -DLIBCUDACXX_ENABLE_LIBCUDACXX_TESTS=ON \ -" -configure "$CMAKE_OPTIONS" +PRESET="libcudacxx-cpp${CXX_STANDARD}" +CMAKE_OPTIONS="" + +configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar -Dexecutor="NoopExecutor()" -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test +LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar -Dexecutor="NoopExecutor()" -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test source "./sccache_stats.sh" "end" diff --git a/ci/test_libcudacxx.sh b/ci/test_libcudacxx.sh index 617311875a3..a0e1f553dc5 100755 --- a/ci/test_libcudacxx.sh +++ b/ci/test_libcudacxx.sh @@ -2,17 +2,13 @@ source "$(dirname "$0")/build_common.sh" -CMAKE_OPTIONS=" - -DCCCL_ENABLE_THRUST=OFF \ - -DCCCL_ENABLE_LIBCUDACXX=ON \ - -DCCCL_ENABLE_CUB=OFF \ - -DCCCL_ENABLE_TESTING=OFF \ - -DLIBCUDACXX_ENABLE_LIBCUDACXX_TESTS=ON \ -" -configure "$CMAKE_OPTIONS" +PRESET="libcudacxx-cpp${CXX_STANDARD}" +CMAKE_OPTIONS="" + +configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" readonly TEST_PARALLEL_LEVEL=8 source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test -source "./sccache_stats.sh" "end" \ No newline at end of file +LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test +source "./sccache_stats.sh" "end" From 692843f6179994d4cffbbec5737af36c2987351f Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 17:35:19 +0000 Subject: [PATCH 18/64] Fix typo in thrust presets. --- CMakePresets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 3a8bc5f4406..c9e772d785f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -138,7 +138,7 @@ "inherits": "thrust-base", "cacheVariables": { "THRUST_IGNORE_DEPRECATED_CPP_DIALECT": true, - "THRUST_ENABLE_DIALECT_CPP11": true + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP11": true } }, { @@ -146,7 +146,7 @@ "displayName": "Thrust: C++14", "inherits": "thrust-base", "cacheVariables": { - "THRUST_ENABLE_DIALECT_CPP14": true + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP14": true } }, { @@ -154,7 +154,7 @@ "displayName": "Thrust: C++17", "inherits": "thrust-base", "cacheVariables": { - "THRUST_ENABLE_DIALECT_CPP17": true + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP17": true } }, { @@ -162,7 +162,7 @@ "displayName": "Thrust: C++20", "inherits": "thrust-base", "cacheVariables": { - "THRUST_ENABLE_DIALECT_CPP20": true + "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP20": true } }, { From ae676aa29e82f994accf1299d33d63acf43d369c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 20:15:41 +0000 Subject: [PATCH 19/64] Remove debugging output. --- ci/build_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index d3ffa4fc5d6..857f377e69c 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -105,7 +105,7 @@ function configure_preset() pushd .. > /dev/null - cmake --preset=$PRESET $CMAKE_OPTIONS --log-level=VERBOSE --trace 2>&1 | tee config.log + cmake --preset=$PRESET $CMAKE_OPTIONS --log-level=VERBOSE echo "$BUILD_NAME configure complete." popd > /dev/null From 61dc3d41ef5bb238f13a133454a18ced2e56022c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 18 Aug 2023 23:31:07 +0000 Subject: [PATCH 20/64] Reduce CTEST_PARALLEL_LEVEL in CI. --- ci/build_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index 857f377e69c..52ace93f935 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -76,7 +76,7 @@ ln -sf $BUILD_DIR ../build/latest export CCCL_BUILD_INFIX export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" export CMAKE_EXPORT_COMPILE_COMMANDS=1 -export CTEST_PARALLEL_LEVEL="${PARALLEL_LEVEL}" +export CTEST_PARALLEL_LEVEL="4" export CUDAARCHS="${GPU_ARCHS}" export CUDACXX="${CUDA_COMPILER}" export CUDAHOSTCXX="${HOST_COMPILER}" From bb28e05755dec1e5d0e8c3f1dca5db0f4826e433 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sat, 19 Aug 2023 11:49:28 +0000 Subject: [PATCH 21/64] Fix base preset for thrust testPresets. --- CMakePresets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index c9e772d785f..b9dbcec3b9d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -260,22 +260,22 @@ { "name": "thrust-cpp11", "configurePreset": "thrust-cpp11", - "inherits": "cub-base" + "inherits": "base" }, { "name": "thrust-cpp14", "configurePreset": "thrust-cpp14", - "inherits": "cub-base" + "inherits": "base" }, { "name": "thrust-cpp17", "configurePreset": "thrust-cpp17", - "inherits": "cub-base" + "inherits": "base" }, { "name": "thrust-cpp20", "configurePreset": "thrust-cpp20", - "inherits": "cub-base" + "inherits": "base" }, { "name": "cccl", From 4fab6750cafeab124be94f26ad6607123fb00497 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sat, 19 Aug 2023 12:04:48 +0000 Subject: [PATCH 22/64] Migrate new NVRTC builds to use presets. --- CMakePresets.json | 45 +++++++++++++++++++++++++++++++++++++++++- ci/nvrtc_libcudacxx.sh | 16 ++++++--------- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index b9dbcec3b9d..22d3bf3dfed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -69,7 +69,50 @@ "cacheVariables": { "CMAKE_CXX_STANDARD": "20", "CMAKE_CUDA_STANDARD": "20" - + } + }, + { + "name": "libcudacxx-nvrtc-base", + "hidden": true, + "inherits": "libcudacxx-base", + "cacheVariables": { + "LIBCUDACXX_TEST_WITH_NVRTC": true + } + }, + { + "name": "libcudacxx-nvrtc-cpp11", + "displayName": "libcu++ NVRTC: C++11 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-nvrtc-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "11", + "CMAKE_CUDA_STANDARD": "11" + } + }, + { + "name": "libcudacxx-nvrtc-cpp14", + "displayName": "libcu++ NVRTC: C++14 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-nvrtc-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "14", + "CMAKE_CUDA_STANDARD": "14" + } + }, + { + "name": "libcudacxx-nvrtc-cpp17", + "displayName": "libcu++ NVRTC: C++17 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-nvrtc-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "17", + "CMAKE_CUDA_STANDARD": "17" + } + }, + { + "name": "libcudacxx-nvrtc-cpp20", + "displayName": "libcu++ NVRTC: C++20 (requires manual usage of lit to build/test)", + "inherits": "libcudacxx-nvrtc-base", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "20", + "CMAKE_CUDA_STANDARD": "20" } }, { diff --git a/ci/nvrtc_libcudacxx.sh b/ci/nvrtc_libcudacxx.sh index a0783b67ad9..0a40f46bda0 100755 --- a/ci/nvrtc_libcudacxx.sh +++ b/ci/nvrtc_libcudacxx.sh @@ -2,18 +2,14 @@ source "$(dirname "$0")/build_common.sh" -CMAKE_OPTIONS=" - -DCCCL_ENABLE_THRUST=OFF \ - -DCCCL_ENABLE_LIBCUDACXX=ON \ - -DCCCL_ENABLE_CUB=OFF \ - -DCCCL_ENABLE_TESTING=OFF \ - -DLIBCUDACXX_ENABLE_LIBCUDACXX_TESTS=ON \ - -DLIBCUDACXX_TEST_WITH_NVRTC=ON \ -" -configure "$CMAKE_OPTIONS" + +PRESET="libcudacxx-nvrtc-cpp${CXX_STANDARD}" +CMAKE_OPTIONS="" + +configure_preset "libcudacxx NVRTC" "$PRESET" "$CMAKE_OPTIONS" readonly TEST_PARALLEL_LEVEL=8 source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test +LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test source "./sccache_stats.sh" "end" From a78fa75e14f04c944a67c4a9faa5c5fcba1362c4 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Mon, 21 Aug 2023 19:20:44 +0000 Subject: [PATCH 23/64] Build all presets for archs 60;70;80. --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 22d3bf3dfed..b76acd88174 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,6 +13,7 @@ "binaryDir": "${sourceDir}/build/$env{CCCL_BUILD_INFIX}/${presetName}", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CUDA_ARCHITECTURES": "60;70;80", "CCCL_ENABLE_LIBCUDACXX": false, "CCCL_ENABLE_CUB": false, "CCCL_ENABLE_THRUST": false, @@ -214,7 +215,6 @@ "inherits": "base", "cacheVariables": { "CMAKE_CUDA_COMPILER": "nvcc", - "CMAKE_CUDA_ARCHITECTURES": "70;70-virtual", "CCCL_ENABLE_EXAMPLES": true, "CCCL_ENABLE_TESTING": true } From 420a916b0e4be613aa6e69faf031efbd201b727f Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Tue, 22 Aug 2023 11:34:15 +0000 Subject: [PATCH 24/64] Escape arches when configuring CCCL example. --- examples/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e05dda71b80..269ef6aefd3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,13 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +string(REPLACE ";" "\\\;" arches_escaped "${CMAKE_CUDA_ARCHITECTURES}") + set(cmake_opts -D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" -D "CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" -D "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" -D "CMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}" -D "CMAKE_CUDA_HOST_COMPILER=${CMAKE_CUDA_HOST_COMPILER}" - -D "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" + -D "CMAKE_CUDA_ARCHITECTURES=${arches_escaped}" ) set(CCCL_EXAMPLE_CPM_REPOSITORY "nvidia/cccl" CACHE STRING "GitHub repository used for CPM examples.") From a135fbd65c77268d1b42d52a99ab05e117429222 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 25 Aug 2023 13:32:17 +0000 Subject: [PATCH 25/64] Move arch settings to presets. --- .github/workflows/build-and-test.yml | 5 ++- .github/workflows/dispatch-build-and-test.yml | 2 -- .github/workflows/pr.yml | 2 +- CMakePresets.json | 31 ++++++++++------ ci/build_common.sh | 17 ++++----- ci/build_libcudacxx.sh | 2 +- ci/matrix.yaml | 36 +++++++++---------- ci/nvrtc_libcudacxx.sh | 2 +- ci/test_libcudacxx.sh | 2 +- 9 files changed, 49 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 38fe7c899ee..c4181eeaadd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,7 +12,6 @@ on: compiler_exe: {type: string, required: true} compiler_version: {type: string, required: true} std: {type: string, required: true} - gpu_build_archs: {type: string, required: true} cpu: {type: string, required: true} os: {type: string, required: true} build_script: {type: string, required: false} @@ -31,7 +30,7 @@ jobs: runner: linux-${{inputs.cpu}}-cpu16 image: ${{inputs.build_image}} command: | - ${{ inputs.build_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" "${{inputs.gpu_build_archs}}" + ${{ inputs.build_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" test: needs: build @@ -44,4 +43,4 @@ jobs: image: ${{inputs.test_image}} command: | nvidia-smi - ${{ inputs.test_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" "${{inputs.gpu_build_archs}}" + ${{ inputs.test_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" diff --git a/.github/workflows/dispatch-build-and-test.yml b/.github/workflows/dispatch-build-and-test.yml index 52bb3dcd59b..080600b336f 100644 --- a/.github/workflows/dispatch-build-and-test.yml +++ b/.github/workflows/dispatch-build-and-test.yml @@ -25,7 +25,6 @@ jobs: compiler_exe: ${{ matrix.compiler.exe }} compiler_version: ${{ matrix.compiler.version }} std: ${{ matrix.std }} - gpu_build_archs: ${{ matrix.gpu_build_archs }} cpu: ${{ matrix.cpu }} os: ${{ matrix.os }} build_script: ${{ inputs.build_script }} @@ -33,4 +32,3 @@ jobs: test_script: ${{ inputs.test_script }} run_tests: ${{ contains(matrix.jobs, 'test') && !contains(github.event.head_commit.message, 'skip-tests') }} test_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} - diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fde0c1037eb..4f504f72931 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -110,7 +110,7 @@ jobs: runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION}}-cpp-gcc12-cuda${{matrix.cuda}}-${{matrix.os}} command: | - ./ci/nvrtc_libcudacxx.sh g++ ${{matrix.std}} ${{matrix.gpu_build_archs}} + ./ci/nvrtc_libcudacxx.sh g++ ${{matrix.std}} thrust: diff --git a/CMakePresets.json b/CMakePresets.json index b76acd88174..67706c0eb82 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,7 +30,8 @@ "inherits": "base", "cacheVariables": { "CCCL_ENABLE_LIBCUDACXX": true, - "LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS": true + "LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS": true, + "LIBCUDACXX_COMPUTE_ARCHS": "70" } }, { @@ -39,8 +40,8 @@ "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "11", - "CMAKE_CUDA_STANDARD": "11" - + "CMAKE_CUDA_STANDARD": "11", + "LIBCUDACXX_TEST_STANDARD_VER": "c++11" } }, { @@ -49,7 +50,8 @@ "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "14", - "CMAKE_CUDA_STANDARD": "14" + "CMAKE_CUDA_STANDARD": "14", + "LIBCUDACXX_TEST_STANDARD_VER": "c++14" } }, @@ -59,7 +61,8 @@ "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "17", - "CMAKE_CUDA_STANDARD": "17" + "CMAKE_CUDA_STANDARD": "17", + "LIBCUDACXX_TEST_STANDARD_VER": "c++17" } }, @@ -69,7 +72,8 @@ "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "20", - "CMAKE_CUDA_STANDARD": "20" + "CMAKE_CUDA_STANDARD": "20", + "LIBCUDACXX_TEST_STANDARD_VER": "c++20" } }, { @@ -77,7 +81,8 @@ "hidden": true, "inherits": "libcudacxx-base", "cacheVariables": { - "LIBCUDACXX_TEST_WITH_NVRTC": true + "LIBCUDACXX_TEST_WITH_NVRTC": true, + "LIBCUDACXX_COMPUTE_ARCHS": "70" } }, { @@ -86,7 +91,8 @@ "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "11", - "CMAKE_CUDA_STANDARD": "11" + "CMAKE_CUDA_STANDARD": "11", + "LIBCUDACXX_TEST_STANDARD_VER": "c++11" } }, { @@ -95,7 +101,8 @@ "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "14", - "CMAKE_CUDA_STANDARD": "14" + "CMAKE_CUDA_STANDARD": "14", + "LIBCUDACXX_TEST_STANDARD_VER": "c++14" } }, { @@ -104,7 +111,8 @@ "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "17", - "CMAKE_CUDA_STANDARD": "17" + "CMAKE_CUDA_STANDARD": "17", + "LIBCUDACXX_TEST_STANDARD_VER": "c++17" } }, { @@ -113,7 +121,8 @@ "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "20", - "CMAKE_CUDA_STANDARD": "20" + "CMAKE_CUDA_STANDARD": "20", + "LIBCUDACXX_TEST_STANDARD_VER": "c++20" } }, { diff --git a/ci/build_common.sh b/ci/build_common.sh index 52ace93f935..b20f1a28313 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -10,10 +10,10 @@ CUDA_COMPILER=nvcc # Check if the correct number of arguments has been provided function usage { - echo "Usage: $0 [OPTIONS] " + echo "Usage: $0 [OPTIONS] " echo "The PARALLEL_LEVEL environment variable controls the amount of build parallelism. Default is the number of cores." - echo "Example: PARALLEL_LEVEL=8 $0 g++-8 14 \"70\" " - echo "Example: $0 clang++-8 17 \"70;75;80-virtual\" " + echo "Example: PARALLEL_LEVEL=8 $0 g++-8 14" + echo "Example: $0 clang++-8 17" echo "Possible options: " echo " -nvcc: path/to/nvcc" echo " -v/--verbose: enable shell echo for debugging" @@ -21,8 +21,8 @@ function usage { } # Check for extra options -# While there are more than 3 arguments, parse switches/options -while [ "$#" -gt 3 ] +# While there are more than 2 arguments, parse switches/options +while [ "$#" -gt 2 ] do case "${1}" in -h) usage ;; @@ -40,7 +40,7 @@ if [ $VERBOSE ]; then set -x fi -if [ "$#" -ne 3 ]; then +if [ "$#" -ne 2 ]; then echo "Invalid number of arguments" usage fi @@ -52,9 +52,6 @@ set -u readonly HOST_COMPILER=$(which $1) readonly CXX_STANDARD=$2 -# Replace spaces, commas and semicolons with semicolons for CMake list -readonly GPU_ARCHS=$(echo $3 | tr ' ,' ';') - readonly PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)} readonly NVCC_VERSION=$($CUDA_COMPILER --version | grep release | awk '{print $6}' | cut -c2-) @@ -77,7 +74,6 @@ export CCCL_BUILD_INFIX export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" export CMAKE_EXPORT_COMPILE_COMMANDS=1 export CTEST_PARALLEL_LEVEL="4" -export CUDAARCHS="${GPU_ARCHS}" export CUDACXX="${CUDA_COMPILER}" export CUDAHOSTCXX="${HOST_COMPILER}" export CXX="${HOST_COMPILER}" @@ -90,7 +86,6 @@ echo "CXX_STANDARD=$CXX_STANDARD" echo "CXX=$CXX" echo "CUDACXX=$CUDACXX" echo "CUDAHOSTCXX=$CUDAHOSTCXX" -echo "CUDAARCHS=$CUDAARCHS" echo "NVCC_VERSION=$NVCC_VERSION" echo "CMAKE_BUILD_PARALLEL_LEVEL=$CMAKE_BUILD_PARALLEL_LEVEL" echo "CTEST_PARALLEL_LEVEL=$CTEST_PARALLEL_LEVEL" diff --git a/ci/build_libcudacxx.sh b/ci/build_libcudacxx.sh index 9bbdcefed30..321f52de6c6 100755 --- a/ci/build_libcudacxx.sh +++ b/ci/build_libcudacxx.sh @@ -8,5 +8,5 @@ CMAKE_OPTIONS="" configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar -Dexecutor="NoopExecutor()" -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test +LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar -Dexecutor="NoopExecutor()" ../libcudacxx/.upstream-tests/test source "./sccache_stats.sh" "end" diff --git a/ci/matrix.yaml b/ci/matrix.yaml index 707c06c6951..644a0862fcd 100644 --- a/ci/matrix.yaml +++ b/ci/matrix.yaml @@ -3,7 +3,6 @@ cuda_oldest: &cuda_oldest '11.1' cuda_newest: &cuda_newest '12.2' # The GPUs to test on -# Note: This assumes that the appropriate gpu_build_archs are set to include building for the GPUs listed here gpus: - 'a100' - 'v100' @@ -20,31 +19,30 @@ devcontainer_version: '23.08' # name: The compiler name # version: The compiler version # exe: The unverionsed compiler binary name -# gpu_build_archs: The GPU architectures to build for using the syntax of CMAKE_CUDA_ARCHITECTURES (semi-colon separated list) # std: The C++ standards to build for # This field is unique as it will generate an independent build/test job for each value # Configurations that will run for every PR pull_request: nvcc: - - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '6', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14], jobs: ['build']} - - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '7', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '8', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '9', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '7', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '8', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '9', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '10', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '11', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build', 'test']} - - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'llvm', version: '9', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '9', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '10', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '11', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '12', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} - - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '13', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} + - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '6', exe: 'g++'}, std: [11, 14], jobs: ['build']} + - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '7', exe: 'g++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '8', exe: 'g++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'gcc', version: '9', exe: 'g++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '7', exe: 'g++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '8', exe: 'g++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '9', exe: 'g++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'gcc', version: '10', exe: 'g++'}, std: [11, 14, 17, 20], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '11', exe: 'g++'}, std: [11, 14, 17, 20], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, std: [11, 14, 17, 20], jobs: ['build', 'test']} + - {cuda: *cuda_oldest, os: 'ubuntu18.04', cpu: 'amd64', compiler: {name: 'llvm', version: '9', exe: 'clang++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '9', exe: 'clang++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '10', exe: 'clang++'}, std: [11, 14, 17], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '11', exe: 'clang++'}, std: [11, 14, 17, 20], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '12', exe: 'clang++'}, std: [11, 14, 17, 20], jobs: ['build']} + - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '13', exe: 'clang++'}, std: [11, 14, 17, 20], jobs: ['build']} - {cuda: *cuda_newest, os: 'ubuntu20.04', cpu: 'amd64', compiler: {name: 'llvm', version: '14', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'llvm', version: '15', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build']} - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'llvm', version: '16', exe: 'clang++'}, gpu_build_archs: '70', std: [11, 14, 17, 20], jobs: ['build', 'test']} nvrtc: - - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', gpu_build_archs: '70', std: [11, 14, 17, 20]} + - {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', std: [11, 14, 17, 20]} diff --git a/ci/nvrtc_libcudacxx.sh b/ci/nvrtc_libcudacxx.sh index 0a40f46bda0..69047545605 100755 --- a/ci/nvrtc_libcudacxx.sh +++ b/ci/nvrtc_libcudacxx.sh @@ -11,5 +11,5 @@ configure_preset "libcudacxx NVRTC" "$PRESET" "$CMAKE_OPTIONS" readonly TEST_PARALLEL_LEVEL=8 source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test +LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar ../libcudacxx/.upstream-tests/test source "./sccache_stats.sh" "end" diff --git a/ci/test_libcudacxx.sh b/ci/test_libcudacxx.sh index a0e1f553dc5..89d895a71f1 100755 --- a/ci/test_libcudacxx.sh +++ b/ci/test_libcudacxx.sh @@ -10,5 +10,5 @@ configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" readonly TEST_PARALLEL_LEVEL=8 source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test +LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar ../libcudacxx/.upstream-tests/test source "./sccache_stats.sh" "end" From 2aa68e57e28e30f1f10245a6efc4c963e29f365b Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 25 Aug 2023 19:31:50 +0000 Subject: [PATCH 26/64] Move libcudacxx build/test logic to cmake. Defines a new build target for non-nvrtc builds named `libcudacxx.test.lit.precompile`. This target is disabled by default and only compiled when explicitly requested. It is enabled in the new `libcudacxx-cppXX` build presets. This target executes lit with test execution disabled and only compiles test, pre-seeding the cache for the test step. A new CTest has been added named `libcudacxx.test.lit`. This invokes lit with test execution enabled, reusing the cached artifacts and running the tests in a possibly different environment. Testing presets have been added for both the `libcudacxx-cppXX` and `libcudacxx-nvrtc-cppXX` configs. The testing parallelism is controlled by a new cache option `libcudacxx_LIT_PARALLEL_LEVEL`, which defaults to 8. --- CMakePresets.json | 65 +++++++++++++++++++ ci/build_common.sh | 13 ++++ ci/build_libcudacxx.sh | 6 +- ci/nvrtc_libcudacxx.sh | 4 +- ci/test_cub.sh | 6 +- ci/test_libcudacxx.sh | 4 +- ci/test_thrust.sh | 6 +- .../.upstream-tests/test/CMakeLists.txt | 32 ++++++++- 8 files changed, 112 insertions(+), 24 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 67706c0eb82..b9aee252cc3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -230,6 +230,31 @@ } ], "buildPresets": [ + { + "name": "libcudacxx-base", + "hidden": true, + "targets": ["libcudacxx.test.lit.precompile"] + }, + { + "name": "libcudacxx-cpp11", + "configurePreset": "libcudacxx-cpp11", + "inherits": ["libcudacxx-base"] + }, + { + "name": "libcudacxx-cpp14", + "configurePreset": "libcudacxx-cpp14", + "inherits": ["libcudacxx-base"] + }, + { + "name": "libcudacxx-cpp17", + "configurePreset": "libcudacxx-cpp17", + "inherits": ["libcudacxx-base"] + }, + { + "name": "libcudacxx-cpp20", + "configurePreset": "libcudacxx-cpp20", + "inherits": ["libcudacxx-base"] + }, { "name": "cub-cpp11", "configurePreset": "cub-cpp11" @@ -279,6 +304,46 @@ "stopOnFailure": false } }, + { + "name": "libcudacxx-cpp11", + "configurePreset": "libcudacxx-cpp11", + "inherits": ["base"] + }, + { + "name": "libcudacxx-cpp14", + "configurePreset": "libcudacxx-cpp14", + "inherits": ["base"] + }, + { + "name": "libcudacxx-cpp17", + "configurePreset": "libcudacxx-cpp17", + "inherits": ["base"] + }, + { + "name": "libcudacxx-cpp20", + "configurePreset": "libcudacxx-cpp20", + "inherits": ["base"] + }, + { + "name": "libcudacxx-nvrtc-cpp11", + "configurePreset": "libcudacxx-nvrtc-cpp11", + "inherits": ["base"] + }, + { + "name": "libcudacxx-nvrtc-cpp14", + "configurePreset": "libcudacxx-nvrtc-cpp14", + "inherits": ["base"] + }, + { + "name": "libcudacxx-nvrtc-cpp17", + "configurePreset": "libcudacxx-nvrtc-cpp17", + "inherits": ["base"] + }, + { + "name": "libcudacxx-nvrtc-cpp20", + "configurePreset": "libcudacxx-nvrtc-cpp20", + "inherits": ["base"] + }, { "name": "cub-base", "hidden": true, diff --git a/ci/build_common.sh b/ci/build_common.sh index b20f1a28313..7faa7027f4d 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -121,6 +121,19 @@ function build_preset() source "./sccache_stats.sh" "end" } +function test_preset() +{ + local BUILD_NAME=$1 + local PRESET=$2 + + pushd .. > /dev/null + + ctest --preset=$PRESET + echo "$BUILD_NAME testing complete." + + popd > /dev/null +} + function configure_and_build_preset() { local BUILD_NAME=$1 diff --git a/ci/build_libcudacxx.sh b/ci/build_libcudacxx.sh index 321f52de6c6..656851253ad 100755 --- a/ci/build_libcudacxx.sh +++ b/ci/build_libcudacxx.sh @@ -5,8 +5,4 @@ source "$(dirname "$0")/build_common.sh" PRESET="libcudacxx-cpp${CXX_STANDARD}" CMAKE_OPTIONS="" -configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" - -source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar -Dexecutor="NoopExecutor()" ../libcudacxx/.upstream-tests/test -source "./sccache_stats.sh" "end" +configure_and_build_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" diff --git a/ci/nvrtc_libcudacxx.sh b/ci/nvrtc_libcudacxx.sh index 69047545605..4cf185bfc90 100755 --- a/ci/nvrtc_libcudacxx.sh +++ b/ci/nvrtc_libcudacxx.sh @@ -8,8 +8,6 @@ CMAKE_OPTIONS="" configure_preset "libcudacxx NVRTC" "$PRESET" "$CMAKE_OPTIONS" -readonly TEST_PARALLEL_LEVEL=8 - source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar ../libcudacxx/.upstream-tests/test +test_preset "libcudacxx NVRTC" "${PRESET}" source "./sccache_stats.sh" "end" diff --git a/ci/test_cub.sh b/ci/test_cub.sh index 4df00baa6dc..b379cc2cbf5 100755 --- a/ci/test_cub.sh +++ b/ci/test_cub.sh @@ -6,8 +6,4 @@ source "$(dirname "$0")/build_common.sh" PRESET="cub-cpp$CXX_STANDARD" -pushd .. -ctest --preset=$PRESET -popd - -echo "CUB test complete" +test_preset CUB "${PRESET}" diff --git a/ci/test_libcudacxx.sh b/ci/test_libcudacxx.sh index 89d895a71f1..dce88472398 100755 --- a/ci/test_libcudacxx.sh +++ b/ci/test_libcudacxx.sh @@ -7,8 +7,6 @@ CMAKE_OPTIONS="" configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" -readonly TEST_PARALLEL_LEVEL=8 - source "./sccache_stats.sh" "start" -LIBCUDACXX_SITE_CONFIG="${BUILD_DIR}/${PRESET}/libcudacxx/test/lit.site.cfg" lit -v -j ${TEST_PARALLEL_LEVEL} --no-progress-bar ../libcudacxx/.upstream-tests/test +test_preset libcudacxx ${PRESET} source "./sccache_stats.sh" "end" diff --git a/ci/test_thrust.sh b/ci/test_thrust.sh index bc6a51b2b5f..a2895f9aead 100755 --- a/ci/test_thrust.sh +++ b/ci/test_thrust.sh @@ -6,8 +6,4 @@ source "$(dirname "$0")/build_common.sh" PRESET="thrust-cpp$CXX_STANDARD" -pushd .. -ctest --preset=$PRESET -popd - -echo "Thrust test complete" +test_preset "Thrust" ${PRESET} diff --git a/libcudacxx/.upstream-tests/test/CMakeLists.txt b/libcudacxx/.upstream-tests/test/CMakeLists.txt index b03563f09a6..b95f6352d21 100644 --- a/libcudacxx/.upstream-tests/test/CMakeLists.txt +++ b/libcudacxx/.upstream-tests/test/CMakeLists.txt @@ -81,13 +81,39 @@ endif() set(AUTO_GEN_COMMENT "## Autogenerated by libcudacxx configuration.\n# Do not edit!") +set(lit_site_cfg_path "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg") configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) + "${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in" + "${lit_site_cfg_path}") add_lit_testsuite(check-cudacxx "Running libcu++ tests" - ${CMAKE_CURRENT_BINARY_DIR}) + "${CMAKE_CURRENT_BINARY_DIR}") # Add test target for standalone headers add_subdirectory(host_only) + +if (NOT LIBCUDACXX_TEST_WITH_NVRTC) + # Build but don't run the tests. Used by CI to pre-seed sccache for the test machines. + # Only executed if explicitly requested. + add_custom_target(libcudacxx.test.lit.precompile + ${CMAKE_COMMAND} -E env + "LIBCUDACXX_SITE_CONFIG=${lit_site_cfg_path}" + lit -v --no-progress-bar + "-Dexecutor=\"NoopExecutor()\"" # Don't run the compiled tests. + "${libcudacxx_SOURCE_DIR}/.upstream-tests/test" + ) +endif() + +# Restricted to avoid oversubscribing the GPU: +set(libcudacxx_LIT_PARALLEL_LEVEL 8 CACHE STRING + "Parallelism used to run libcudacxx's lit test suite." +) + +add_test(NAME libcudacxx.test.lit COMMAND + ${CMAKE_COMMAND} -E env + "LIBCUDACXX_SITE_CONFIG=${lit_site_cfg_path}" + lit -v --no-progress-bar + -j "${libcudacxx_LIT_PARALLEL_LEVEL}" + "${libcudacxx_SOURCE_DIR}/.upstream-tests/test" +) From e3e961b083661c212c6ce4cb337bc3820a84eabc Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 25 Aug 2023 19:39:47 +0000 Subject: [PATCH 27/64] Update libcudacxx preset display names. --- CMakePresets.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index b9aee252cc3..b909619f762 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -36,7 +36,7 @@ }, { "name": "libcudacxx-cpp11", - "displayName": "libcu++: C++11 (requires manual usage of lit to build/test)", + "displayName": "libcu++: C++11", "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "11", @@ -46,7 +46,7 @@ }, { "name": "libcudacxx-cpp14", - "displayName": "libcu++: C++14 (requires manual usage of lit to build/test)", + "displayName": "libcu++: C++14", "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "14", @@ -57,7 +57,7 @@ }, { "name": "libcudacxx-cpp17", - "displayName": "libcu++: C++17 (requires manual usage of lit to build/test)", + "displayName": "libcu++: C++17", "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "17", @@ -68,7 +68,7 @@ }, { "name": "libcudacxx-cpp20", - "displayName": "libcu++: C++20 (requires manual usage of lit to build/test)", + "displayName": "libcu++: C++20", "inherits": "libcudacxx-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "20", @@ -87,7 +87,7 @@ }, { "name": "libcudacxx-nvrtc-cpp11", - "displayName": "libcu++ NVRTC: C++11 (requires manual usage of lit to build/test)", + "displayName": "libcu++ NVRTC: C++11", "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "11", @@ -97,7 +97,7 @@ }, { "name": "libcudacxx-nvrtc-cpp14", - "displayName": "libcu++ NVRTC: C++14 (requires manual usage of lit to build/test)", + "displayName": "libcu++ NVRTC: C++14", "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "14", @@ -107,7 +107,7 @@ }, { "name": "libcudacxx-nvrtc-cpp17", - "displayName": "libcu++ NVRTC: C++17 (requires manual usage of lit to build/test)", + "displayName": "libcu++ NVRTC: C++17", "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "17", @@ -117,7 +117,7 @@ }, { "name": "libcudacxx-nvrtc-cpp20", - "displayName": "libcu++ NVRTC: C++20 (requires manual usage of lit to build/test)", + "displayName": "libcu++ NVRTC: C++20", "inherits": "libcudacxx-nvrtc-base", "cacheVariables": { "CMAKE_CXX_STANDARD": "20", From b9afd96ef4cff191d995e4a3887447f2d0f15c17 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 25 Aug 2023 19:40:13 +0000 Subject: [PATCH 28/64] Enable libcudacxx internal packaging tests. --- libcudacxx/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libcudacxx/CMakeLists.txt b/libcudacxx/CMakeLists.txt index 784c57aa02c..49d3ea41e42 100644 --- a/libcudacxx/CMakeLists.txt +++ b/libcudacxx/CMakeLists.txt @@ -27,14 +27,15 @@ if (NOT LIBCUDACXX_TOPLEVEL_PROJECT) return() endif() +# Must be called in root CMakeLists.txt +include(CTest) +enable_testing() + # Note that this currently returns and skips the rest of the build # system. -option(libcudacxx_ENABLE_CMAKE_TESTS "Enable ctest-based testing." OFF) +option(libcudacxx_ENABLE_CMAKE_TESTS "Enable ctest-based testing." ON) if (libcudacxx_ENABLE_CMAKE_TESTS) - include(CTest) - enable_testing() # Must be called in root CMakeLists.txt add_subdirectory(cmake/test/) - return() endif() set(CMAKE_MODULE_PATH "${libcudacxx_SOURCE_DIR}/cmake") From 53344d06e845c1e7e3cdcf69857f570e6c8c77c6 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sat, 26 Aug 2023 12:41:40 +0000 Subject: [PATCH 29/64] Split the libcudacxx tests into two test presets. - libcudacxx-ctest-cppXX test presets will run all of the CTest tests, except for libcudacxx.test.lit. - libcudacxx-lit-cppXX test presets will run only libcudacxx.test.lit, extra verbosity settings, etc. The CI script runs both. --- CMakePresets.json | 103 ++++++++++++++++-- ci/test_libcudacxx.sh | 10 +- .../.upstream-tests/test/CMakeLists.txt | 5 +- 3 files changed, 103 insertions(+), 15 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index b909619f762..b25346fd975 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -305,44 +305,123 @@ } }, { - "name": "libcudacxx-cpp11", + "name": "libcudacxx-ctest-base", + "hidden": true, + "inherits": [ + "base" + ], + "filter": { + "exclude": { + "name": "^libcudacxx\\.test\\.lit$" + } + } + }, + { + "name": "libcudacxx-ctest-cpp11", "configurePreset": "libcudacxx-cpp11", - "inherits": ["base"] + "inherits": [ + "libcudacxx-ctest-base" + ] }, { - "name": "libcudacxx-cpp14", + "name": "libcudacxx-ctest-cpp14", "configurePreset": "libcudacxx-cpp14", - "inherits": ["base"] + "inherits": [ + "libcudacxx-ctest-base" + ] }, { - "name": "libcudacxx-cpp17", + "name": "libcudacxx-ctest-cpp17", "configurePreset": "libcudacxx-cpp17", - "inherits": ["base"] + "inherits": [ + "libcudacxx-ctest-base" + ] }, { - "name": "libcudacxx-cpp20", + "name": "libcudacxx-ctest-cpp20", "configurePreset": "libcudacxx-cpp20", - "inherits": ["base"] + "inherits": [ + "libcudacxx-ctest-base" + ] + }, + { + "name": "libcudacxx-lit-base", + "hidden": true, + "inherits": [ + "base" + ], + "filter": { + "include": { + "name": "^libcudacxx\\.test\\.lit$" + } + }, + "output": { + "verbosity": "extra", + "outputOnFailure": false + } + }, + { + "name": "libcudacxx-lit-cpp11", + "configurePreset": "libcudacxx-cpp11", + "inherits": [ + "libcudacxx-lit-base" + ] + }, + { + "name": "libcudacxx-lit-cpp14", + "configurePreset": "libcudacxx-cpp14", + "inherits": [ + "libcudacxx-lit-base" + ] + }, + { + "name": "libcudacxx-lit-cpp17", + "configurePreset": "libcudacxx-cpp17", + "inherits": [ + "libcudacxx-lit-base" + ] + }, + { + "name": "libcudacxx-lit-cpp20", + "configurePreset": "libcudacxx-cpp20", + "inherits": [ + "libcudacxx-lit-base" + ] + }, + { + "name": "libcudacxx-nvrtc-base", + "hidden": true, + "inherits": [ + "libcudacxx-lit-base" + ] }, { "name": "libcudacxx-nvrtc-cpp11", "configurePreset": "libcudacxx-nvrtc-cpp11", - "inherits": ["base"] + "inherits": [ + "libcudacxx-nvrtc-base" + ] }, { "name": "libcudacxx-nvrtc-cpp14", "configurePreset": "libcudacxx-nvrtc-cpp14", - "inherits": ["base"] + "inherits": [ + "libcudacxx-nvrtc-base" + ] }, { "name": "libcudacxx-nvrtc-cpp17", "configurePreset": "libcudacxx-nvrtc-cpp17", - "inherits": ["base"] + "inherits": [ + "libcudacxx-nvrtc-base" + ] }, { "name": "libcudacxx-nvrtc-cpp20", "configurePreset": "libcudacxx-nvrtc-cpp20", - "inherits": ["base"] + "inherits": [ + "libcudacxx-nvrtc-base" + ] }, { "name": "cub-base", diff --git a/ci/test_libcudacxx.sh b/ci/test_libcudacxx.sh index dce88472398..c433199cc43 100755 --- a/ci/test_libcudacxx.sh +++ b/ci/test_libcudacxx.sh @@ -7,6 +7,14 @@ CMAKE_OPTIONS="" configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" +# The libcudacxx tests are split into two presets, one for +# regular ctest tests and another that invokes the lit tests +# harness with extra options for verbosity, etc: +CTEST_PRESET="libcudacxx-ctest-cpp${CXX_STANDARD}" +LIT_PRESET="libcudacxx-lit-cpp${CXX_STANDARD}" + +test_preset "libcudacxx (CTest)" ${CTEST_PRESET} + source "./sccache_stats.sh" "start" -test_preset libcudacxx ${PRESET} +test_preset "libcudacxx (lit)" ${LIT_PRESET} source "./sccache_stats.sh" "end" diff --git a/libcudacxx/.upstream-tests/test/CMakeLists.txt b/libcudacxx/.upstream-tests/test/CMakeLists.txt index b95f6352d21..65110dec2d4 100644 --- a/libcudacxx/.upstream-tests/test/CMakeLists.txt +++ b/libcudacxx/.upstream-tests/test/CMakeLists.txt @@ -99,7 +99,7 @@ if (NOT LIBCUDACXX_TEST_WITH_NVRTC) add_custom_target(libcudacxx.test.lit.precompile ${CMAKE_COMMAND} -E env "LIBCUDACXX_SITE_CONFIG=${lit_site_cfg_path}" - lit -v --no-progress-bar + lit -vv --no-progress-bar "-Dexecutor=\"NoopExecutor()\"" # Don't run the compiled tests. "${libcudacxx_SOURCE_DIR}/.upstream-tests/test" ) @@ -113,7 +113,8 @@ set(libcudacxx_LIT_PARALLEL_LEVEL 8 CACHE STRING add_test(NAME libcudacxx.test.lit COMMAND ${CMAKE_COMMAND} -E env "LIBCUDACXX_SITE_CONFIG=${lit_site_cfg_path}" - lit -v --no-progress-bar + lit -vv --no-progress-bar -j "${libcudacxx_LIT_PARALLEL_LEVEL}" "${libcudacxx_SOURCE_DIR}/.upstream-tests/test" ) +set_tests_properties(libcudacxx.test.lit PROPERTIES TIMEOUT 3600 RUN_SERIAL TRUE) From 6e01c4ef38702c273d59ff29ebedc3bcac0b789d Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sat, 26 Aug 2023 14:35:03 +0000 Subject: [PATCH 30/64] Remove compute arch hint. This doesn't seem to be used anymore. Now the raw value of CMAKE_CUDA_ARCHITECTURES is written to lit's site config regardless of how LIBCUDACXX_COMPUTE_ARCHS is set. --- CMakePresets.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index b25346fd975..510c1677160 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -81,8 +81,7 @@ "hidden": true, "inherits": "libcudacxx-base", "cacheVariables": { - "LIBCUDACXX_TEST_WITH_NVRTC": true, - "LIBCUDACXX_COMPUTE_ARCHS": "70" + "LIBCUDACXX_TEST_WITH_NVRTC": true } }, { From 3a3ca9515f50161652935f6fb17e9d5668e2151b Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 30 Aug 2023 14:54:53 +0000 Subject: [PATCH 31/64] Restrict the NVRTC configs to sm70. --- CMakePresets.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 510c1677160..10d3febf2e2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -81,7 +81,8 @@ "hidden": true, "inherits": "libcudacxx-base", "cacheVariables": { - "LIBCUDACXX_TEST_WITH_NVRTC": true + "LIBCUDACXX_TEST_WITH_NVRTC": true, + "CMAKE_CUDA_ARCHITECTURES": "70" } }, { From 12eb5483cc1d64081aa30d54f545cbae636571d7 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 30 Aug 2023 16:46:35 +0000 Subject: [PATCH 32/64] Set CTest parallel level to 1. This has been reported to give significantly worse performance for Thrust tests. Disabling until we can investigate further. --- ci/build_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index 7faa7027f4d..eb9d573ca12 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -73,7 +73,7 @@ ln -sf $BUILD_DIR ../build/latest export CCCL_BUILD_INFIX export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" export CMAKE_EXPORT_COMPILE_COMMANDS=1 -export CTEST_PARALLEL_LEVEL="4" +export CTEST_PARALLEL_LEVEL="1" export CUDACXX="${CUDA_COMPILER}" export CUDAHOSTCXX="${HOST_COMPILER}" export CXX="${HOST_COMPILER}" From 328ff4945bc826b0c57a94d44c66b69f2145a54b Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 31 Aug 2023 18:33:46 +0000 Subject: [PATCH 33/64] Move clangd command database logic into CMake. Rather than configuring the clangd command database location in the devcontainer config, use CMake to ensure that the database will be discoverable regardless of whether or not a devcontainer is used. --- .devcontainer/devcontainer.json | 9 ++------- .gitignore | 3 ++- CMakeLists.txt | 3 ++- ci/build_common.sh | 1 - cmake/CCCLClangdCompileInfo.cmake | 28 ++++++++++++++++++++++++++++ cmake/CCCLUtilities.cmake | 30 ++++++++++++++++++++++++++++++ 6 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 cmake/CCCLClangdCompileInfo.cmake diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6fd7fdfb66f..8a2854c9090 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,12 +26,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } } -} \ No newline at end of file +} diff --git a/.gitignore b/.gitignore index a221dae54e7..3df4512e6a8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *build*/ .cache .aws -.config \ No newline at end of file +.config +compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c578997c8f..6ff552fa41b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,8 @@ option(CCCL_ENABLE_EXAMPLES "Enable CUDA C++ Core Library examples." ON) include(CTest) enable_testing() -include(cmake/CCCLUtilities.cmake) +include(cmake/CCCLUtilities.cmake) # include this first +include(cmake/CCCLClangdCompileInfo.cmake) if (CCCL_ENABLE_LIBCUDACXX) set(LIBCUDACXX_TOPLEVEL_PROJECT ON) diff --git a/ci/build_common.sh b/ci/build_common.sh index eb9d573ca12..338866d0302 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -72,7 +72,6 @@ ln -sf $BUILD_DIR ../build/latest # Prepare environment for CMake: export CCCL_BUILD_INFIX export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" -export CMAKE_EXPORT_COMPILE_COMMANDS=1 export CTEST_PARALLEL_LEVEL="1" export CUDACXX="${CUDA_COMPILER}" export CUDAHOSTCXX="${HOST_COMPILER}" diff --git a/cmake/CCCLClangdCompileInfo.cmake b/cmake/CCCLClangdCompileInfo.cmake new file mode 100644 index 00000000000..89b8be1d568 --- /dev/null +++ b/cmake/CCCLClangdCompileInfo.cmake @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. + +# Tell cmake to generate a json file of compile commands for clangd: +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Symlink the compile command output to the source dir, where clangd will find it. +set(compile_commands_file "${CMAKE_BINARY_DIR}/compile_commands.json") +set(compile_commands_link "${CMAKE_SOURCE_DIR}/compile_commands.json") +message(STATUS "Creating symlink from ${compile_commands_link} to ${compile_commands_file}...") +cccl_execute_non_fatal_process(COMMAND + "${CMAKE_COMMAND}" -E rm -f "${compile_commands_link}") +cccl_execute_non_fatal_process(COMMAND + "${CMAKE_COMMAND}" -E touch "${compile_commands_file}") +cccl_execute_non_fatal_process(COMMAND + "${CMAKE_COMMAND}" -E create_symlink "${compile_commands_file}" "${compile_commands_link}") diff --git a/cmake/CCCLUtilities.cmake b/cmake/CCCLUtilities.cmake index 52d132d8170..fbaa2f24197 100644 --- a/cmake/CCCLUtilities.cmake +++ b/cmake/CCCLUtilities.cmake @@ -13,6 +13,36 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Passes all args directly to execute_process while setting up the following +# results variables and propogating them to the caller's scope: +# +# - cccl_process_exit_code +# - cccl_process_stdout +# - cccl_process_stderr +# +# If the command +# is not successful (e.g. the last command does not return zero), a non-fatal +# warning is printed. +function(cccl_execute_non_fatal_process) + execute_process(${ARGN} + RESULT_VARIABLE cccl_process_exit_code + OUTPUT_VARIABLE cccl_process_stdout + ERROR_VARIABLE cccl_process_stderr + ) + + if (NOT cccl_process_exit_code EQUAL 0) + message(WARNING + "execute_process failed with non-zero exit code: ${cccl_process_exit_code}\n" + "${ARGN}\n" + "stdout:\n${cccl_process_stdout}\n" + "stderr:\n${cccl_process_stderr}\n" + ) + endif() + + set(cccl_process_exit_code "${cccl_process_exit_code}" PARENT_SCOPE) + set(cccl_process_stdout "${cccl_process_stdout}" PARENT_SCOPE) + set(cccl_process_stderr "${cccl_process_stderr}" PARENT_SCOPE) +endfunction() # Add a build-and-test CTest. # - full_test_name_var will be set to the full name of the test. From 274855eeb44386f16afcd04b530367c9f20f0e2c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 31 Aug 2023 18:54:50 +0000 Subject: [PATCH 34/64] Rebuild devcontainer configs with preset changes. CCCL_BUILD_INFIX is now defined in the container's environment, and will be used regardless of whether the project is configured manually in the container, or via the ci/*.sh scripts. --- .devcontainer/cuda11.1-gcc6/devcontainer.json | 10 +++------- .devcontainer/cuda11.1-gcc7/devcontainer.json | 10 +++------- .devcontainer/cuda11.1-gcc8/devcontainer.json | 10 +++------- .devcontainer/cuda11.1-gcc9/devcontainer.json | 10 +++------- .devcontainer/cuda11.1-llvm9/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-gcc10/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-gcc11/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-gcc12/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-gcc7/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-gcc8/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-gcc9/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm10/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm11/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm12/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm13/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm14/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm15/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm16/devcontainer.json | 10 +++------- .devcontainer/cuda12.2-llvm9/devcontainer.json | 10 +++------- .devcontainer/make_devcontainers.sh | 4 ++-- ci/build_common.sh | 7 ------- 21 files changed, 59 insertions(+), 142 deletions(-) diff --git a/.devcontainer/cuda11.1-gcc6/devcontainer.json b/.devcontainer/cuda11.1-gcc6/devcontainer.json index c81a4b93fbc..9f289a53fed 100644 --- a/.devcontainer/cuda11.1-gcc6/devcontainer.json +++ b/.devcontainer/cuda11.1-gcc6/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda11.1-gcc6" + "DEVCONTAINER_NAME": "cuda11.1-gcc6", + "CCCL_BUILD_INFIX": "cuda11.1-gcc6" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda11.1-gcc6" diff --git a/.devcontainer/cuda11.1-gcc7/devcontainer.json b/.devcontainer/cuda11.1-gcc7/devcontainer.json index 11a84d7b820..76ea2cf5dc2 100644 --- a/.devcontainer/cuda11.1-gcc7/devcontainer.json +++ b/.devcontainer/cuda11.1-gcc7/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda11.1-gcc7" + "DEVCONTAINER_NAME": "cuda11.1-gcc7", + "CCCL_BUILD_INFIX": "cuda11.1-gcc7" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda11.1-gcc7" diff --git a/.devcontainer/cuda11.1-gcc8/devcontainer.json b/.devcontainer/cuda11.1-gcc8/devcontainer.json index af4f4ae204e..663e294616e 100644 --- a/.devcontainer/cuda11.1-gcc8/devcontainer.json +++ b/.devcontainer/cuda11.1-gcc8/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda11.1-gcc8" + "DEVCONTAINER_NAME": "cuda11.1-gcc8", + "CCCL_BUILD_INFIX": "cuda11.1-gcc8" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda11.1-gcc8" diff --git a/.devcontainer/cuda11.1-gcc9/devcontainer.json b/.devcontainer/cuda11.1-gcc9/devcontainer.json index 36eecdaad37..c501985e5de 100644 --- a/.devcontainer/cuda11.1-gcc9/devcontainer.json +++ b/.devcontainer/cuda11.1-gcc9/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda11.1-gcc9" + "DEVCONTAINER_NAME": "cuda11.1-gcc9", + "CCCL_BUILD_INFIX": "cuda11.1-gcc9" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda11.1-gcc9" diff --git a/.devcontainer/cuda11.1-llvm9/devcontainer.json b/.devcontainer/cuda11.1-llvm9/devcontainer.json index 4953d3ec410..8bcc7ad16f6 100644 --- a/.devcontainer/cuda11.1-llvm9/devcontainer.json +++ b/.devcontainer/cuda11.1-llvm9/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda11.1-llvm9" + "DEVCONTAINER_NAME": "cuda11.1-llvm9", + "CCCL_BUILD_INFIX": "cuda11.1-llvm9" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda11.1-llvm9" diff --git a/.devcontainer/cuda12.2-gcc10/devcontainer.json b/.devcontainer/cuda12.2-gcc10/devcontainer.json index 92e28490ae8..3eb3ba4c9a2 100644 --- a/.devcontainer/cuda12.2-gcc10/devcontainer.json +++ b/.devcontainer/cuda12.2-gcc10/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-gcc10" + "DEVCONTAINER_NAME": "cuda12.2-gcc10", + "CCCL_BUILD_INFIX": "cuda12.2-gcc10" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-gcc10" diff --git a/.devcontainer/cuda12.2-gcc11/devcontainer.json b/.devcontainer/cuda12.2-gcc11/devcontainer.json index 91abfb7d01a..5d82459e21b 100644 --- a/.devcontainer/cuda12.2-gcc11/devcontainer.json +++ b/.devcontainer/cuda12.2-gcc11/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-gcc11" + "DEVCONTAINER_NAME": "cuda12.2-gcc11", + "CCCL_BUILD_INFIX": "cuda12.2-gcc11" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-gcc11" diff --git a/.devcontainer/cuda12.2-gcc12/devcontainer.json b/.devcontainer/cuda12.2-gcc12/devcontainer.json index 199ce44f4ff..8a13765b5f3 100644 --- a/.devcontainer/cuda12.2-gcc12/devcontainer.json +++ b/.devcontainer/cuda12.2-gcc12/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-gcc12" + "DEVCONTAINER_NAME": "cuda12.2-gcc12", + "CCCL_BUILD_INFIX": "cuda12.2-gcc12" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-gcc12" diff --git a/.devcontainer/cuda12.2-gcc7/devcontainer.json b/.devcontainer/cuda12.2-gcc7/devcontainer.json index 8cd8647cc68..3160cbd33eb 100644 --- a/.devcontainer/cuda12.2-gcc7/devcontainer.json +++ b/.devcontainer/cuda12.2-gcc7/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-gcc7" + "DEVCONTAINER_NAME": "cuda12.2-gcc7", + "CCCL_BUILD_INFIX": "cuda12.2-gcc7" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-gcc7" diff --git a/.devcontainer/cuda12.2-gcc8/devcontainer.json b/.devcontainer/cuda12.2-gcc8/devcontainer.json index 194c27fdb55..2b088076c55 100644 --- a/.devcontainer/cuda12.2-gcc8/devcontainer.json +++ b/.devcontainer/cuda12.2-gcc8/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-gcc8" + "DEVCONTAINER_NAME": "cuda12.2-gcc8", + "CCCL_BUILD_INFIX": "cuda12.2-gcc8" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-gcc8" diff --git a/.devcontainer/cuda12.2-gcc9/devcontainer.json b/.devcontainer/cuda12.2-gcc9/devcontainer.json index 733ee611f07..01d77bb340a 100644 --- a/.devcontainer/cuda12.2-gcc9/devcontainer.json +++ b/.devcontainer/cuda12.2-gcc9/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-gcc9" + "DEVCONTAINER_NAME": "cuda12.2-gcc9", + "CCCL_BUILD_INFIX": "cuda12.2-gcc9" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-gcc9" diff --git a/.devcontainer/cuda12.2-llvm10/devcontainer.json b/.devcontainer/cuda12.2-llvm10/devcontainer.json index 27b278899be..c345325d5eb 100644 --- a/.devcontainer/cuda12.2-llvm10/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm10/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm10" + "DEVCONTAINER_NAME": "cuda12.2-llvm10", + "CCCL_BUILD_INFIX": "cuda12.2-llvm10" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm10" diff --git a/.devcontainer/cuda12.2-llvm11/devcontainer.json b/.devcontainer/cuda12.2-llvm11/devcontainer.json index 3ece880c541..4db5cdd3465 100644 --- a/.devcontainer/cuda12.2-llvm11/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm11/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm11" + "DEVCONTAINER_NAME": "cuda12.2-llvm11", + "CCCL_BUILD_INFIX": "cuda12.2-llvm11" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm11" diff --git a/.devcontainer/cuda12.2-llvm12/devcontainer.json b/.devcontainer/cuda12.2-llvm12/devcontainer.json index 900e6c289f6..bc5b0b95782 100644 --- a/.devcontainer/cuda12.2-llvm12/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm12/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm12" + "DEVCONTAINER_NAME": "cuda12.2-llvm12", + "CCCL_BUILD_INFIX": "cuda12.2-llvm12" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm12" diff --git a/.devcontainer/cuda12.2-llvm13/devcontainer.json b/.devcontainer/cuda12.2-llvm13/devcontainer.json index d13770f0184..24d1f7a72ac 100644 --- a/.devcontainer/cuda12.2-llvm13/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm13/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm13" + "DEVCONTAINER_NAME": "cuda12.2-llvm13", + "CCCL_BUILD_INFIX": "cuda12.2-llvm13" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm13" diff --git a/.devcontainer/cuda12.2-llvm14/devcontainer.json b/.devcontainer/cuda12.2-llvm14/devcontainer.json index f83db7314bb..17b376ca391 100644 --- a/.devcontainer/cuda12.2-llvm14/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm14/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm14" + "DEVCONTAINER_NAME": "cuda12.2-llvm14", + "CCCL_BUILD_INFIX": "cuda12.2-llvm14" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm14" diff --git a/.devcontainer/cuda12.2-llvm15/devcontainer.json b/.devcontainer/cuda12.2-llvm15/devcontainer.json index 33861956a95..16d4e12255c 100644 --- a/.devcontainer/cuda12.2-llvm15/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm15/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm15" + "DEVCONTAINER_NAME": "cuda12.2-llvm15", + "CCCL_BUILD_INFIX": "cuda12.2-llvm15" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm15" diff --git a/.devcontainer/cuda12.2-llvm16/devcontainer.json b/.devcontainer/cuda12.2-llvm16/devcontainer.json index d8d5d3fe11d..ddaed403c1f 100644 --- a/.devcontainer/cuda12.2-llvm16/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm16/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm16" + "DEVCONTAINER_NAME": "cuda12.2-llvm16", + "CCCL_BUILD_INFIX": "cuda12.2-llvm16" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm16" diff --git a/.devcontainer/cuda12.2-llvm9/devcontainer.json b/.devcontainer/cuda12.2-llvm9/devcontainer.json index 20773960559..454b71696d3 100644 --- a/.devcontainer/cuda12.2-llvm9/devcontainer.json +++ b/.devcontainer/cuda12.2-llvm9/devcontainer.json @@ -14,7 +14,8 @@ "SCCACHE_BUCKET": "rapids-sccache-devs", "VAULT_HOST": "https://vault.ops.k8s.rapids.ai", "HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history", - "DEVCONTAINER_NAME": "cuda12.2-llvm9" + "DEVCONTAINER_NAME": "cuda12.2-llvm9", + "CCCL_BUILD_INFIX": "cuda12.2-llvm9" }, "workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", @@ -27,12 +28,7 @@ "vscode": { "extensions": [ "llvm-vs-code-extensions.vscode-clangd" - ], - "settings": { - "clangd.arguments": [ - "--compile-commands-dir=${workspaceFolder}/build/latest" - ] - } + ] } }, "name": "cuda12.2-llvm9" diff --git a/.devcontainer/make_devcontainers.sh b/.devcontainer/make_devcontainers.sh index 5cd27976864..96f72b3c687 100755 --- a/.devcontainer/make_devcontainers.sh +++ b/.devcontainer/make_devcontainers.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This script parses the CI matrix.yaml file and generates a devcontainer.json file for each unique combination of +# This script parses the CI matrix.yaml file and generates a devcontainer.json file for each unique combination of # CUDA version, compiler name/version, and Ubuntu version. The devcontainer.json files are written to the # .devcontainer directory to a subdirectory named after the CUDA version and compiler name/version. # GitHub docs on using multiple devcontainer.json files: @@ -40,7 +40,7 @@ for combination in $combinations; do # Use the base_devcontainer.json as a template, plug in the CUDA, compiler names, versions, and Ubuntu version, # and write the output to the new devcontainer.json file #jq --arg image "$image" --arg name "$name" '. + {image: $image, name: $name}' $base_devcontainer_file > "$devcontainer_file" - jq --arg image "$image" --arg name "$name" '.image = $image | .name = $name | .containerEnv.DEVCONTAINER_NAME = $name' $base_devcontainer_file > "$devcontainer_file" + jq --arg image "$image" --arg name "$name" '.image = $image | .name = $name | .containerEnv.DEVCONTAINER_NAME = $name | .containerEnv.CCCL_BUILD_INFIX = $name' $base_devcontainer_file > "$devcontainer_file" echo "Created $devcontainer_file" done diff --git a/ci/build_common.sh b/ci/build_common.sh index 338866d0302..d46b99530dc 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -55,12 +55,6 @@ readonly CXX_STANDARD=$2 readonly PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)} readonly NVCC_VERSION=$($CUDA_COMPILER --version | grep release | awk '{print $6}' | cut -c2-) -if [ -z ${DEVCONTAINER_NAME+x} ]; then - CCCL_BUILD_INFIX=local -else - CCCL_BUILD_INFIX=${DEVCONTAINER_NAME} -fi - # Presets will be configured in this directory: BUILD_DIR=../build/${CCCL_BUILD_INFIX} @@ -70,7 +64,6 @@ rm -f ../build/latest ln -sf $BUILD_DIR ../build/latest # Prepare environment for CMake: -export CCCL_BUILD_INFIX export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" export CTEST_PARALLEL_LEVEL="1" export CUDACXX="${CUDA_COMPILER}" From e0dc009a0ed79290f0236713ca6769b536e12d0a Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 31 Aug 2023 19:49:34 +0000 Subject: [PATCH 35/64] Ensure that CCCL_BUILD_INFIX is set. --- ci/build_common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/build_common.sh b/ci/build_common.sh index d46b99530dc..3febc628d0f 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -55,6 +55,10 @@ readonly CXX_STANDARD=$2 readonly PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)} readonly NVCC_VERSION=$($CUDA_COMPILER --version | grep release | awk '{print $6}' | cut -c2-) +if [ -z ${CCCL_BUILD_INFIX+x} ]; then + CCCL_BUILD_INFIX="" +fi + # Presets will be configured in this directory: BUILD_DIR=../build/${CCCL_BUILD_INFIX} From ca5b76cc3f171b2a416a70ad82bd0260d75949ad Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 31 Aug 2023 23:17:36 +0000 Subject: [PATCH 36/64] Minor fixes. --- CMakePresets.json | 3 +-- ci/build_cub.sh | 1 - libcudacxx/.upstream-tests/test/CMakeLists.txt | 15 ++++++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 10d3febf2e2..cb8361745bc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,8 +30,7 @@ "inherits": "base", "cacheVariables": { "CCCL_ENABLE_LIBCUDACXX": true, - "LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS": true, - "LIBCUDACXX_COMPUTE_ARCHS": "70" + "LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS": true } }, { diff --git a/ci/build_cub.sh b/ci/build_cub.sh index 1778aa99dde..b60b822d72f 100755 --- a/ci/build_cub.sh +++ b/ci/build_cub.sh @@ -22,7 +22,6 @@ fi PRESET="cub-cpp$CXX_STANDARD" -# TODO Can we move the benchmark logic to CMake? CMAKE_OPTIONS=" -DCUB_ENABLE_BENCHMARKS="$ENABLE_CUB_BENCHMARKS"\ " diff --git a/libcudacxx/.upstream-tests/test/CMakeLists.txt b/libcudacxx/.upstream-tests/test/CMakeLists.txt index 65110dec2d4..4784e4f968b 100644 --- a/libcudacxx/.upstream-tests/test/CMakeLists.txt +++ b/libcudacxx/.upstream-tests/test/CMakeLists.txt @@ -93,13 +93,15 @@ add_lit_testsuite(check-cudacxx # Add test target for standalone headers add_subdirectory(host_only) +find_program(lit libcudacxx_LIT REQUIRED) + if (NOT LIBCUDACXX_TEST_WITH_NVRTC) # Build but don't run the tests. Used by CI to pre-seed sccache for the test machines. # Only executed if explicitly requested. add_custom_target(libcudacxx.test.lit.precompile - ${CMAKE_COMMAND} -E env + "${CMAKE_COMMAND}" -E env "LIBCUDACXX_SITE_CONFIG=${lit_site_cfg_path}" - lit -vv --no-progress-bar + "${libcudacxx_LIT}" -vv --no-progress-bar "-Dexecutor=\"NoopExecutor()\"" # Don't run the compiled tests. "${libcudacxx_SOURCE_DIR}/.upstream-tests/test" ) @@ -111,10 +113,13 @@ set(libcudacxx_LIT_PARALLEL_LEVEL 8 CACHE STRING ) add_test(NAME libcudacxx.test.lit COMMAND - ${CMAKE_COMMAND} -E env + "${CMAKE_COMMAND}" -E env "LIBCUDACXX_SITE_CONFIG=${lit_site_cfg_path}" - lit -vv --no-progress-bar + "${libcudacxx_LIT}" -vv --no-progress-bar -j "${libcudacxx_LIT_PARALLEL_LEVEL}" "${libcudacxx_SOURCE_DIR}/.upstream-tests/test" ) -set_tests_properties(libcudacxx.test.lit PROPERTIES TIMEOUT 3600 RUN_SERIAL TRUE) +set_tests_properties(libcudacxx.test.lit PROPERTIES + TIMEOUT 3600 + RUN_SERIAL TRUE +) From 6966a9bcbab0e673662d7a566e9b2bd2b4323156 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 1 Sep 2023 22:55:32 +0000 Subject: [PATCH 37/64] Fix typo. --- libcudacxx/.upstream-tests/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcudacxx/.upstream-tests/test/CMakeLists.txt b/libcudacxx/.upstream-tests/test/CMakeLists.txt index 4784e4f968b..932306b5d1e 100644 --- a/libcudacxx/.upstream-tests/test/CMakeLists.txt +++ b/libcudacxx/.upstream-tests/test/CMakeLists.txt @@ -93,7 +93,7 @@ add_lit_testsuite(check-cudacxx # Add test target for standalone headers add_subdirectory(host_only) -find_program(lit libcudacxx_LIT REQUIRED) +find_program(libcudacxx_LIT lit REQUIRED) if (NOT LIBCUDACXX_TEST_WITH_NVRTC) # Build but don't run the tests. Used by CI to pre-seed sccache for the test machines. From f5a21557bdac48c852693d63df32fa69cc1a546c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 27 Sep 2023 20:54:17 +0000 Subject: [PATCH 38/64] First stab at porting new windows CI to use presets. --- ci/windows/build_common.psm1 | 115 +++++++++++++++++++++----------- ci/windows/build_cub.ps1 | 29 ++------ ci/windows/build_libcudacxx.ps1 | 38 ++--------- ci/windows/build_thrust.ps1 | 29 ++------ 4 files changed, 88 insertions(+), 123 deletions(-) diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index 0cb85e7fc21..816a9ef2752 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -4,11 +4,7 @@ Param( [Alias("cxx")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17, - [Parameter(Mandatory = $true)] - [Alias("archs")] - [ValidateNotNullOrEmpty()] - [string]$GPU_ARCHS = "70" + [int]$CXX_STANDARD = 17 ) @@ -17,12 +13,13 @@ Param( $script:HOST_COMPILER = (Get-Command "cl").source -replace '\\','/' $script:PARALLEL_LEVEL = (Get-WmiObject -class Win32_processor).NumberOfLogicalProcessors -If($null -eq $env:DEVCONTAINER_NAME) { - $script:BUILD_DIR="$PSScriptRoot/../../build/local" -} else { - $script:BUILD_DIR="$PSScriptRoot/../../build/$DEVCONTAINER_NAME" +if (-not $env:CCCL_BUILD_INFIX) { + $env:CCCL_BUILD_INFIX = "" } +# Presets will be configured in this directory: +$BUILD_DIR = "../build/$env:CCCL_BUILD_INFIX" + If(!(test-path -PathType container "../build")) { New-Item -ItemType Directory -Path "../build" } @@ -35,78 +32,118 @@ $script:path_to_sccache =(gcm sccache).Source Remove-Item $path_to_sccache -Force Invoke-WebRequest -Uri "https://github.com/robertmaynard/sccache/releases/download/nvcc_msvc_v1/sccache.exe" -OutFile $path_to_sccache -$script:COMMON_CMAKE_OPTIONS= @( - "-S .." - "-B $BUILD_DIR" - "-G Ninja" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_CXX_STANDARD=$CXX_STANDARD" - "-DCMAKE_CUDA_STANDARD=$CXX_STANDARD" - "-DCMAKE_CXX_COMPILER=$HOST_COMPILER" - "-DCMAKE_CUDA_HOST_COMPILER=$HOST_COMPILER" - "-DCMAKE_CUDA_ARCHITECTURES=$GPU_ARCHS" - "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" -) +# Prepare environment for CMake: +$env:CMAKE_BUILD_PARALLEL_LEVEL = $PARALLEL_LEVEL +$env:CTEST_PARALLEL_LEVEL = 1 +$env:CUDAHOSTCXX = $HOST_COMPILER.FullName +$env:CXX = $HOST_COMPILER.FullName Write-Host "========================================" Write-Host "Begin build" Write-Host "pwd=$pwd" -Write-Host "HOST_COMPILER=$HOST_COMPILER" -Write-Host "CXX_STANDARD=$CXX_STANDARD" -Write-Host "GPU_ARCHS=$GPU_ARCHS" -Write-Host "PARALLEL_LEVEL=$PARALLEL_LEVEL" Write-Host "BUILD_DIR=$BUILD_DIR" +Write-Host "CXX_STANDARD=$CXX_STANDARD" +Write-Host "CXX=$env:CXX" +Write-Host "CUDACXX=$env:CUDACXX" +Write-Host "CUDAHOSTCXX=$env:CUDAHOSTCXX" +Write-Host "NVCC_VERSION=$NVCC_VERSION" +Write-Host "CMAKE_BUILD_PARALLEL_LEVEL=$env:CMAKE_BUILD_PARALLEL_LEVEL" +Write-Host "CTEST_PARALLEL_LEVEL=$env:CTEST_PARALLEL_LEVEL" +Write-Host "CCCL_BUILD_INFIX=$env:CCCL_BUILD_INFIX" Write-Host "Current commit is:" Write-Host "$(git log -1)" Write-Host "========================================" -function configure { +function configure_preset { Param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] - $CMAKE_OPTIONS + [string]$BUILD_NAME, + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$PRESET, + [Parameter(Mandatory = $true)] + [string]$CMAKE_OPTIONS ) - $FULL_CMAKE_OPTIONS = $script:COMMON_CMAKE_OPTIONS + $CMAKE_OPTIONS - cmake $FULL_CMAKE_OPTIONS + $step = "$BUILD_NAME (configure)" + + cmake --preset $PRESET $CMAKE_OPTIONS --log-level VERBOSE $test_result = $LastExitCode If ($test_result -ne 0) { - throw 'Step Failed' + throw '$step Failed' } + + Write-Host "$step complete." } -function build { +function build_preset { Param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] - [string]$BUILD_NAME + [string]$BUILD_NAME, + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$PRESET ) + $step = "$BUILD_NAME (build)" + sccache_stats('Start') - cmake --build $script:BUILD_DIR --parallel $script:PARALLEL_LEVEL + cmake --build --preset $PRESET $test_result = $LastExitCode sccache_stats('Stop') - echo "${BUILD_NAME} build complete" + + echo "$step complete" + If ($test_result -ne 0) { - throw 'Step Failed' + throw '$step Failed' } } -function configure_and_build { +function test_preset { Param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$BUILD_NAME, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] - $CMAKE_OPTIONS + [string]$PRESET + ) + + $step = "$BUILD_NAME (test)" + + sccache_stats('Start') + + ctest --preset $PRESET + $test_result = $LastExitCode + + sccache_stats('Stop') + + echo "$step complete" + + If ($test_result -ne 0) { + throw '$step Failed' + } +} + +function configure_and_build_preset { + Param( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$BUILD_NAME, + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string]$PRESET, + [Parameter(Mandatory = $true)] + [string]$CMAKE_OPTIONS ) - configure -CMAKE_OPTIONS $CMAKE_OPTIONS - build -BUILD_NAME $BUILD_NAME + configure_preset "$BUILD_NAME" "$PRESET" "$CMAKE_OPTIONS" + build_preset "$BUILD_NAME" "$PRESET" } function sccache_stats { diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index 6642638156a..ce002ab5343 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -4,11 +4,7 @@ Param( [Alias("cxx")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17, - [Parameter(Mandatory = $true)] - [Alias("archs")] - [ValidateNotNullOrEmpty()] - [string]$GPU_ARCHS = "70" + [int]$CXX_STANDARD = 17 ) $CURRENT_PATH = Split-Path $pwd -leaf @@ -18,28 +14,11 @@ If($CURRENT_PATH -ne "ci") { } Remove-Module -Name build_common -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $GPU_ARCHS +Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD -$ENABLE_DIALECT_CPP11 = If ($CXX_STANDARD -ne 11) {"OFF"} Else {"ON"} -$ENABLE_DIALECT_CPP14 = If ($CXX_STANDARD -ne 14) {"OFF"} Else {"ON"} -$ENABLE_DIALECT_CPP17 = If ($CXX_STANDARD -ne 17) {"OFF"} Else {"ON"} -$ENABLE_DIALECT_CPP20 = If ($CXX_STANDARD -ne 20) {"OFF"} Else {"ON"} - -$CMAKE_OPTIONS = @( - "-DCCCL_ENABLE_THRUST=OFF" - "-DCCCL_ENABLE_LIBCUDACXX=OFF" - "-DCCCL_ENABLE_CUB=ON" - "-DCCCL_ENABLE_TESTING=OFF" - "-DCUB_ENABLE_DIALECT_CPP11=$ENABLE_DIALECT_CPP11" - "-DCUB_ENABLE_DIALECT_CPP14=$ENABLE_DIALECT_CPP14" - "-DCUB_ENABLE_DIALECT_CPP17=$ENABLE_DIALECT_CPP17" - "-DCUB_ENABLE_DIALECT_CPP20=$ENABLE_DIALECT_CPP20" - "-DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT=ON" - "-DCUB_IGNORE_DEPRECATED_CPP_DIALECT=ON" - "-DCUB_ENABLE_RDC_TESTS=OFF" -) +$PRESET = "thrust-$CXX_STANDARD" -configure_and_build "CUB" $CMAKE_OPTIONS +configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" If($CURRENT_PATH -ne "ci") { popd diff --git a/ci/windows/build_libcudacxx.ps1 b/ci/windows/build_libcudacxx.ps1 index 9219a5c04e2..b244c07eba3 100644 --- a/ci/windows/build_libcudacxx.ps1 +++ b/ci/windows/build_libcudacxx.ps1 @@ -4,11 +4,7 @@ Param( [Alias("cxx")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17, - [Parameter(Mandatory = $true)] - [Alias("archs")] - [ValidateNotNullOrEmpty()] - [string]$GPU_ARCHS = "70" + [int]$CXX_STANDARD = 17 ) $CURRENT_PATH = Split-Path $pwd -leaf @@ -20,37 +16,11 @@ If($CURRENT_PATH -ne "ci") { Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $GPU_ARCHS -$CMAKE_OPTIONS = @( - "-DCCCL_ENABLE_THRUST=OFF" - "-DCCCL_ENABLE_LIBCUDACXX=ON" - "-DCCCL_ENABLE_CUB=OFF" - "-DCCCL_ENABLE_TESTING=OFF" - "-DLIBCUDACXX_ENABLE_LIBCUDACXX_TESTS=ON" -) - -$LIT_OPTIONS = @( - "-v" - "--no-progress-bar" - "-Dexecutor=""NoopExecutor()""" - "-Dcompute_archs=$GPU_ARCHS" - "-Dstd=c++$CXX_STANDARD" - "$BUILD_DIR/libcudacxx/test" -) - -configure $CMAKE_OPTIONS +PRESET="libcudacxx-cpp${CXX_STANDARD}" +CMAKE_OPTIONS="" -pushd $BUILD_DIR/libcudacxx/ +configure_and_build_preset "libcudacxx" "$PRESET" "$CMAKE_OPTIONS" -sccache_stats('Start') -lit $LIT_OPTIONS -$test_result = $LastExitCode -sccache_stats('Stop') - -popd If($CURRENT_PATH -ne "ci") { popd } - -If ($test_result -ne 0) { - throw 'Step Failed' -} \ No newline at end of file diff --git a/ci/windows/build_thrust.ps1 b/ci/windows/build_thrust.ps1 index 264849a0cd2..ce002ab5343 100644 --- a/ci/windows/build_thrust.ps1 +++ b/ci/windows/build_thrust.ps1 @@ -4,11 +4,7 @@ Param( [Alias("cxx")] [ValidateNotNullOrEmpty()] [ValidateSet(11, 14, 17, 20)] - [int]$CXX_STANDARD = 17, - [Parameter(Mandatory = $true)] - [Alias("archs")] - [ValidateNotNullOrEmpty()] - [string]$GPU_ARCHS = "70" + [int]$CXX_STANDARD = 17 ) $CURRENT_PATH = Split-Path $pwd -leaf @@ -18,28 +14,11 @@ If($CURRENT_PATH -ne "ci") { } Remove-Module -Name build_common -Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $GPU_ARCHS +Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD -$ENABLE_DIALECT_CPP11 = If ($CXX_STANDARD -ne 11) {"OFF"} Else {"ON"} -$ENABLE_DIALECT_CPP14 = If ($CXX_STANDARD -ne 14) {"OFF"} Else {"ON"} -$ENABLE_DIALECT_CPP17 = If ($CXX_STANDARD -ne 17) {"OFF"} Else {"ON"} -$ENABLE_DIALECT_CPP20 = If ($CXX_STANDARD -ne 20) {"OFF"} Else {"ON"} - -$CMAKE_OPTIONS = @( - "-DCCCL_ENABLE_THRUST=ON" - "-DCCCL_ENABLE_LIBCUDACXX=OFF" - "-DCCCL_ENABLE_CUB=OFF" - "-DCCCL_ENABLE_TESTING=OFF" - "-DTHRUST_ENABLE_MULTICONFIG=ON" - "-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP11=$ENABLE_DIALECT_CPP11" - "-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP14=$ENABLE_DIALECT_CPP14" - "-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP17=$ENABLE_DIALECT_CPP17" - "-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP20=$ENABLE_DIALECT_CPP20" - "-DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT=ON" - "-DCUB_IGNORE_DEPRECATED_CPP_DIALECT=ON" -) +$PRESET = "thrust-$CXX_STANDARD" -configure_and_build "Thrust" $CMAKE_OPTIONS +configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" If($CURRENT_PATH -ne "ci") { popd From 0042c07edc95900d58ee0b03bf21d7561233d154 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 27 Sep 2023 21:25:52 +0000 Subject: [PATCH 39/64] Export new windows CI functions from common script --- ci/windows/build_common.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index 816a9ef2752..e87df01eba4 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -184,5 +184,5 @@ function sccache_stats { } } -Export-ModuleMember -Function configure, build, configure_and_build, sccache_stats +Export-ModuleMember -Function configure_preset, build_preset, test_preset, configure_and_build_preset, sccache_stats Export-ModuleMember -Variable BUILD_DIR From 3ae7e93a985a22ed4e09aa3ee5f6dbd10e7f87b7 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 27 Sep 2023 21:55:31 +0000 Subject: [PATCH 40/64] More powershell fixes. --- ci/windows/build_common.psm1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index e87df01eba4..0c787ca6801 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -63,6 +63,7 @@ function configure_preset { [ValidateNotNullOrEmpty()] [string]$PRESET, [Parameter(Mandatory = $true)] + [AllowEmptyString()] [string]$CMAKE_OPTIONS ) @@ -139,6 +140,7 @@ function configure_and_build_preset { [ValidateNotNullOrEmpty()] [string]$PRESET, [Parameter(Mandatory = $true)] + [AllowEmptyString()] [string]$CMAKE_OPTIONS ) From 697d52307172a6ed8412d51ef685d890eec3f2e4 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 29 Sep 2023 17:59:30 +0000 Subject: [PATCH 41/64] Allow variables to be dereferenced in powershell exceptions. --- ci/windows/build_common.psm1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index 0c787ca6801..60d59192e11 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -73,7 +73,7 @@ function configure_preset { $test_result = $LastExitCode If ($test_result -ne 0) { - throw '$step Failed' + throw "$step Failed" } Write-Host "$step complete." @@ -99,9 +99,9 @@ function build_preset { sccache_stats('Stop') echo "$step complete" - + If ($test_result -ne 0) { - throw '$step Failed' + throw "$step Failed" } } @@ -125,9 +125,9 @@ function test_preset { sccache_stats('Stop') echo "$step complete" - + If ($test_result -ne 0) { - throw '$step Failed' + throw "$step Failed" } } From 6981f343f19ae697862c3bf9209d3c30f539c844 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 29 Sep 2023 18:04:24 +0000 Subject: [PATCH 42/64] Running cmake in the correct directory is helpful. --- ci/windows/build_common.psm1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index 60d59192e11..442bccee427 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -69,6 +69,9 @@ function configure_preset { $step = "$BUILD_NAME (configure)" + # CMake must be invoked in the same directory as the presets file: + pushd ".." + cmake --preset $PRESET $CMAKE_OPTIONS --log-level VERBOSE $test_result = $LastExitCode @@ -76,6 +79,7 @@ function configure_preset { throw "$step Failed" } + popd Write-Host "$step complete." } @@ -91,6 +95,9 @@ function build_preset { $step = "$BUILD_NAME (build)" + # CMake must be invoked in the same directory as the presets file: + pushd ".." + sccache_stats('Start') cmake --build --preset $PRESET @@ -103,6 +110,8 @@ function build_preset { If ($test_result -ne 0) { throw "$step Failed" } + + popd } function test_preset { @@ -117,6 +126,9 @@ function test_preset { $step = "$BUILD_NAME (test)" + # CTest must be invoked in the same directory as the presets file: + pushd ".." + sccache_stats('Start') ctest --preset $PRESET @@ -129,6 +141,8 @@ function test_preset { If ($test_result -ne 0) { throw "$step Failed" } + + popd } function configure_and_build_preset { From 35dd57fae76276dd6b22063df4ca36b22f779b2d Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Fri, 29 Sep 2023 19:20:49 +0000 Subject: [PATCH 43/64] Fix copy/paste error. --- ci/windows/build_cub.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index ce002ab5343..97b28504ce0 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -16,9 +16,9 @@ If($CURRENT_PATH -ne "ci") { Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD -$PRESET = "thrust-$CXX_STANDARD" +$PRESET = "cub-$CXX_STANDARD" -configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" +configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" If($CURRENT_PATH -ne "ci") { popd From 04955d2b1bcad4c9d5a4b0a87252d1e086abf346 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sat, 30 Sep 2023 12:58:34 +0000 Subject: [PATCH 44/64] Fix preset names on windows CI --- ci/windows/build_cub.ps1 | 2 +- ci/windows/build_thrust.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index 97b28504ce0..ce1e6e88747 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -16,7 +16,7 @@ If($CURRENT_PATH -ne "ci") { Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD -$PRESET = "cub-$CXX_STANDARD" +$PRESET = "cub-cpp$CXX_STANDARD" configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" diff --git a/ci/windows/build_thrust.ps1 b/ci/windows/build_thrust.ps1 index ce002ab5343..92499cd4325 100644 --- a/ci/windows/build_thrust.ps1 +++ b/ci/windows/build_thrust.ps1 @@ -16,7 +16,7 @@ If($CURRENT_PATH -ne "ci") { Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD -$PRESET = "thrust-$CXX_STANDARD" +$PRESET = "thrust-cpp$CXX_STANDARD" configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" From 20e97fe49bb4e4b1bda35eeacd5abd22537e7a7c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sun, 1 Oct 2023 13:10:29 +0000 Subject: [PATCH 45/64] Ensure that CMAKE_OPTIONS is defined. --- ci/windows/build_cub.ps1 | 1 + ci/windows/build_libcudacxx.ps1 | 4 ++-- ci/windows/build_thrust.ps1 | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index ce1e6e88747..8a7d729f71b 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -17,6 +17,7 @@ Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD $PRESET = "cub-cpp$CXX_STANDARD" +$CMAKE_OPTIONS = "" configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" diff --git a/ci/windows/build_libcudacxx.ps1 b/ci/windows/build_libcudacxx.ps1 index b244c07eba3..85f0da9fa93 100644 --- a/ci/windows/build_libcudacxx.ps1 +++ b/ci/windows/build_libcudacxx.ps1 @@ -16,8 +16,8 @@ If($CURRENT_PATH -ne "ci") { Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD, $GPU_ARCHS -PRESET="libcudacxx-cpp${CXX_STANDARD}" -CMAKE_OPTIONS="" +$PRESET = "libcudacxx-cpp${CXX_STANDARD}" +$CMAKE_OPTIONS = "" configure_and_build_preset "libcudacxx" "$PRESET" "$CMAKE_OPTIONS" diff --git a/ci/windows/build_thrust.ps1 b/ci/windows/build_thrust.ps1 index 92499cd4325..5e4183dbc55 100644 --- a/ci/windows/build_thrust.ps1 +++ b/ci/windows/build_thrust.ps1 @@ -17,6 +17,7 @@ Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD $PRESET = "thrust-cpp$CXX_STANDARD" +$CMAKE_OPTIONS = "" configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" From a0006b7db76edf11f3332b8f6883379318a98563 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Sun, 1 Oct 2023 13:12:09 +0000 Subject: [PATCH 46/64] Drop sm60 from windows testing. --- ci/windows/build_cub.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index 8a7d729f71b..53b478b630c 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -17,7 +17,9 @@ Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD $PRESET = "cub-cpp$CXX_STANDARD" -$CMAKE_OPTIONS = "" + +# Override the preset 60;70;80, since cuda::atomic can't be used on msvc+sm60: +$CMAKE_OPTIONS = "-DCMAKE_CUDA_ARCHITECTURES=70;80" configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" From dc457c665172f7d20c49d76d7889cd2130a82854 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 17:06:11 +0000 Subject: [PATCH 47/64] Update linux ci script options. Adds a `-arch` flag to allow modification of CUDA arches. Remove the remaining positional arguments, replacing them with flags: - Host compiler: `-cxx ...` (defaults to $CXX or g++ if not set) - C++ standard: `-std ...` (defaults to 17) - CUDA archs: `-arch ...` (defaults to preset file) --- ci/build_common.sh | 115 +++++++++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 41 deletions(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index d4a92c1fa53..0cfca9eeeb8 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -6,52 +6,65 @@ set -eo pipefail cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; # Script defaults +HOST_COMPILER=${CXX:-g++} # $CXX if set, otherwise `g++` +CXX_STANDARD=17 CUDA_COMPILER=nvcc +CUDA_ARCHS= # Empty, use presets by default. # Check if the correct number of arguments has been provided function usage { - echo "Usage: $0 [OPTIONS] " + echo "Usage: $0 [OPTIONS]" + echo echo "The PARALLEL_LEVEL environment variable controls the amount of build parallelism. Default is the number of cores." - echo "Example: PARALLEL_LEVEL=8 $0 g++-8 14" - echo "Example: $0 clang++-8 17" - echo "Possible options: " - echo " -nvcc: path/to/nvcc" + echo + echo "Options:" echo " -v/--verbose: enable shell echo for debugging" + echo " -nvcc: path/to/nvcc" + echo " -cxx: Host compiler (Defaults to $CXX if set, otherwise g++)" + echo " -std: C++ standard (Defaults to 17)" + echo " -arch: Target CUDA arches, e.g. \"60-real;70;80-virtual\" (Defaults to value in presets file)" + echo + echo "Examples:" + echo " $ PARALLEL_LEVEL=8 $0" + echo " $ PARALLEL_LEVEL=8 $0 -cxx g++-9" + echo " $ $0 -cxx clang++-8" + echo " $ $0 -cxx g++-8 --std 14 --arch 80-real -v --nvcc /usr/local/bin/nvcc" exit 1 } -# Check for extra options -# While there are more than 2 arguments, parse switches/options -while [ "$#" -gt 2 ] -do - case "${1}" in - -h) usage ;; - -help) usage ;; - --help) usage ;; - --verbose) VERBOSE=1; shift ;; - -v) VERBOSE=1; shift ;; - -nvcc) CUDA_COMPILER="${2}"; shift 2;; - -disable-benchmarks) ENABLE_CUB_BENCHMARKS="false"; shift ;; - *) usage ;; - esac +# Parse options +while [ "$#" -gt 0 ]; do + case "${1}" in + -h) usage ;; + -help) usage ;; + --help) usage ;; + --verbose) VERBOSE=1; shift;; + -v) VERBOSE=1; shift;; + -cxx) HOST_COMPILER="${2}"; shift 2;; + -std) CXX_STANDARD="${2}"; shift 2;; + -nvcc) CUDA_COMPILER="${2}"; shift 2;; + -arch) CUDA_ARCHS="${2}"; shift 2;; + -disable-benchmarks) ENABLE_CUB_BENCHMARKS="false"; shift;; + *) usage ;; + esac done -if [ $VERBOSE ]; then - set -x +# Convert to full paths: +HOST_COMPILER=$(which ${HOST_COMPILER}) +CUDA_COMPILER=$(which ${CUDA_COMPILER}) + +GLOBAL_CMAKE_OPTIONS="" +if [[ -n "${CUDA_ARCHS}" ]]; then + GLOBAL_CMAKE_OPTIONS+="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHS} " fi -if [ "$#" -ne 2 ]; then - echo "Invalid number of arguments" - usage +if [ $VERBOSE ]; then + set -x fi # Begin processing unsets after option parsing set -u -# Assign command line arguments to variables -readonly HOST_COMPILER=$(which $1) -readonly CXX_STANDARD=$2 - readonly PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)} readonly NVCC_VERSION=$($CUDA_COMPILER --version | grep release | awk '{print $6}' | cut -c2-) @@ -60,7 +73,7 @@ if [ -z ${CCCL_BUILD_INFIX+x} ]; then fi # Presets will be configured in this directory: -BUILD_DIR=../build/${CCCL_BUILD_INFIX} +BUILD_DIR=$(readlink -f "../build/${CCCL_BUILD_INFIX}") # The most recent build will always be symlinked to cccl/build/latest mkdir -p $BUILD_DIR @@ -70,25 +83,45 @@ ln -sf $BUILD_DIR ../build/latest # Prepare environment for CMake: export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" export CTEST_PARALLEL_LEVEL="1" +export CXX="${HOST_COMPILER}" export CUDACXX="${CUDA_COMPILER}" export CUDAHOSTCXX="${HOST_COMPILER}" -export CXX="${HOST_COMPILER}" + +# Print "ARG=${ARG}" for all args. +function print_var_values() { + # Iterate through the arguments + for var_name in "$@"; do + if [ -z "$var_name" ]; then + echo "Usage: print_var_values ..." + return 1 + fi + + # Dereference the variable and print the result + echo "$var_name=${!var_name:-(undefined)}" + done +} echo "========================================" -echo "Begin build" echo "pwd=$(pwd)" -echo "BUILD_DIR=$BUILD_DIR" -echo "CXX_STANDARD=$CXX_STANDARD" -echo "CXX=$CXX" -echo "CUDACXX=$CUDACXX" -echo "CUDAHOSTCXX=$CUDAHOSTCXX" -echo "NVCC_VERSION=$NVCC_VERSION" -echo "CMAKE_BUILD_PARALLEL_LEVEL=$CMAKE_BUILD_PARALLEL_LEVEL" -echo "CTEST_PARALLEL_LEVEL=$CTEST_PARALLEL_LEVEL" -echo "CCCL_BUILD_INFIX=$CCCL_BUILD_INFIX" +print_var_values \ + BUILD_DIR \ + CXX_STANDARD \ + CXX \ + CUDACXX \ + CUDAHOSTCXX \ + CUDAARCHS \ + NVCC_VERSION \ + CMAKE_BUILD_PARALLEL_LEVEL \ + CTEST_PARALLEL_LEVEL \ + CCCL_BUILD_INFIX \ + GLOBAL_CMAKE_OPTIONS +echo "========================================" +echo +echo "========================================" echo "Current commit is:" git log -1 echo "========================================" +echo function configure_preset() { @@ -98,7 +131,7 @@ function configure_preset() pushd .. > /dev/null - cmake --preset=$PRESET $CMAKE_OPTIONS --log-level=VERBOSE + cmake --preset=$PRESET --log-level=VERBOSE $GLOBAL_CMAKE_OPTIONS $CMAKE_OPTIONS echo "$BUILD_NAME configure complete." popd > /dev/null From 680c10b281cd4edcce8085f65364541fd4140726 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 17:19:37 +0000 Subject: [PATCH 48/64] Update CI configs to use new script syntax. --- .github/workflows/dispatch-build-and-test.yml | 4 ++-- .github/workflows/pr.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dispatch-build-and-test.yml b/.github/workflows/dispatch-build-and-test.yml index a8cc08c13d9..96557aa8437 100644 --- a/.github/workflows/dispatch-build-and-test.yml +++ b/.github/workflows/dispatch-build-and-test.yml @@ -23,8 +23,8 @@ jobs: with: cpu: ${{ matrix.cpu }} test_name: ${{matrix.compiler.name}}${{matrix.compiler.version}}/C++${{matrix.std}} - build_script: "./ci/build_${{ inputs.project_name }}.sh ${{matrix.compiler.exe}} ${{matrix.std}}" - test_script: "./ci/test_${{ inputs.project_name }}.sh ${{matrix.compiler.exe}} ${{matrix.std}}" + build_script: "./ci/build_${{ inputs.project_name }}.sh -cxx ${{matrix.compiler.exe}} -std ${{matrix.std}}" + test_script: "./ci/test_${{ inputs.project_name }}.sh -cxx ${{matrix.compiler.exe}} -std ${{matrix.std}}" container_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} run_tests: ${{ contains(matrix.jobs, 'test') && !contains(github.event.head_commit.message, 'skip-tests') && matrix.os != 'windows-2022' }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8ccfb696a0f..e7289d1799f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -64,7 +64,7 @@ jobs: runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 image: rapidsai/devcontainers:${{needs.compute-matrix.outputs.DEVCONTAINER_VERSION}}-cpp-gcc12-cuda${{matrix.cuda}}-${{matrix.os}} command: | - ./ci/nvrtc_libcudacxx.sh g++ ${{matrix.std}} ${{matrix.gpu_build_archs}} + ./ci/nvrtc_libcudacxx.sh -cxx g++ -std ${{matrix.std}} thrust: name: Thrust CUDA${{ matrix.cuda_version }} ${{ matrix.compiler }} From 9ae9e34083f042ccab9e4fd60b5b12b7b101e1c3 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 17:48:55 +0000 Subject: [PATCH 49/64] Re-enable sm60 for windows builds after legacy atomic fix. --- ci/windows/build_cub.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index 53b478b630c..8a7d729f71b 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -17,9 +17,7 @@ Remove-Module -Name build_common Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD $PRESET = "cub-cpp$CXX_STANDARD" - -# Override the preset 60;70;80, since cuda::atomic can't be used on msvc+sm60: -$CMAKE_OPTIONS = "-DCMAKE_CUDA_ARCHITECTURES=70;80" +$CMAKE_OPTIONS = "" configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" From aa0434a3d41b371332a1ef20ed56f6f376268376 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 19:58:39 +0000 Subject: [PATCH 50/64] Prevent any user preset files from being committed. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7f02d691179..891a96b2dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .config _deps/catch2-src/ compile_commands.json +CMakeUserPresets.json From c586ccec3db353f67d0f02838f41f894f9b758b3 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 19:58:57 +0000 Subject: [PATCH 51/64] Add missing newline. --- .github/workflows/build-cccl-infra.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cccl-infra.yml b/.github/workflows/build-cccl-infra.yml index e356391e56c..c9c70947bda 100644 --- a/.github/workflows/build-cccl-infra.yml +++ b/.github/workflows/build-cccl-infra.yml @@ -24,4 +24,5 @@ jobs: image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | cmake -S . --preset=cccl -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} - ctest --preset=cccl \ No newline at end of file + ctest --preset=cccl + \ No newline at end of file From 04dae96c2dfbe508f6c94e97507f21ae197adfd3 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 21:39:52 +0000 Subject: [PATCH 52/64] Replace the `-nvcc` option with `-cuda`. --- ci/build_common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index 0cfca9eeeb8..21a5fe3882f 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -8,7 +8,7 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; # Script defaults HOST_COMPILER=${CXX:-g++} # $CXX if set, otherwise `g++` CXX_STANDARD=17 -CUDA_COMPILER=nvcc +CUDA_COMPILER=${CUDACXX:-nvcc} # $CUDACXX if set, otherwise `nvcc` CUDA_ARCHS= # Empty, use presets by default. # Check if the correct number of arguments has been provided @@ -19,16 +19,16 @@ function usage { echo echo "Options:" echo " -v/--verbose: enable shell echo for debugging" - echo " -nvcc: path/to/nvcc" + echo " -cuda: CUDA compiler (Defaults to $CUDACXX if set, otherwise nvcc)" echo " -cxx: Host compiler (Defaults to $CXX if set, otherwise g++)" - echo " -std: C++ standard (Defaults to 17)" + echo " -std: CUDA/C++ standard (Defaults to 17)" echo " -arch: Target CUDA arches, e.g. \"60-real;70;80-virtual\" (Defaults to value in presets file)" echo echo "Examples:" echo " $ PARALLEL_LEVEL=8 $0" echo " $ PARALLEL_LEVEL=8 $0 -cxx g++-9" echo " $ $0 -cxx clang++-8" - echo " $ $0 -cxx g++-8 --std 14 --arch 80-real -v --nvcc /usr/local/bin/nvcc" + echo " $ $0 -cxx g++-8 -std 14 -arch 80-real -v -cuda /usr/local/bin/nvcc" exit 1 } @@ -42,7 +42,7 @@ while [ "$#" -gt 0 ]; do -v) VERBOSE=1; shift;; -cxx) HOST_COMPILER="${2}"; shift 2;; -std) CXX_STANDARD="${2}"; shift 2;; - -nvcc) CUDA_COMPILER="${2}"; shift 2;; + -cuda) CUDA_COMPILER="${2}"; shift 2;; -arch) CUDA_ARCHS="${2}"; shift 2;; -disable-benchmarks) ENABLE_CUB_BENCHMARKS="false"; shift;; *) usage ;; From fd3808389e114f6c574a25ee2e72f153bf50826c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 21:47:05 +0000 Subject: [PATCH 53/64] Remove outdated log message. --- ci/build_common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index 21a5fe3882f..f5a6316566e 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -109,7 +109,6 @@ print_var_values \ CXX \ CUDACXX \ CUDAHOSTCXX \ - CUDAARCHS \ NVCC_VERSION \ CMAKE_BUILD_PARALLEL_LEVEL \ CTEST_PARALLEL_LEVEL \ From ce2a6630a231d2db6dcbd799acdd584550edf22f Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 4 Oct 2023 22:00:10 +0000 Subject: [PATCH 54/64] Make sure BUILD_DIR exists before canonicalizing the path. --- ci/build_common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index f5a6316566e..7f5576c611c 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -73,13 +73,16 @@ if [ -z ${CCCL_BUILD_INFIX+x} ]; then fi # Presets will be configured in this directory: -BUILD_DIR=$(readlink -f "../build/${CCCL_BUILD_INFIX}") +BUILD_DIR="../build/${CCCL_BUILD_INFIX}" # The most recent build will always be symlinked to cccl/build/latest mkdir -p $BUILD_DIR rm -f ../build/latest ln -sf $BUILD_DIR ../build/latest +# Now that BUILD_DIR exists, use readlink to canonicalize the path: +BUILD_DIR=$(readlink -f "${BUILD_DIR}") + # Prepare environment for CMake: export CMAKE_BUILD_PARALLEL_LEVEL="${PARALLEL_LEVEL}" export CTEST_PARALLEL_LEVEL="1" From d552d162fca088cc61b1230595f9b806eeecb419 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 5 Oct 2023 12:22:59 +0000 Subject: [PATCH 55/64] Suppress deprecation warnings for old cl. --- ci/windows/build_common.psm1 | 10 ++++++++-- ci/windows/build_cub.ps1 | 4 ++++ ci/windows/build_thrust.ps1 | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ci/windows/build_common.psm1 b/ci/windows/build_common.psm1 index d3c60128e71..1b3b07023bd 100644 --- a/ci/windows/build_common.psm1 +++ b/ci/windows/build_common.psm1 @@ -7,12 +7,18 @@ Param( [int]$CXX_STANDARD = 17 ) - # We need the full path to cl because otherwise cmake will replace CMAKE_CXX_COMPILER with the full path # and keep CMAKE_CUDA_HOST_COMPILER at "cl" which breaks our cmake script $script:HOST_COMPILER = (Get-Command "cl").source -replace '\\','/' $script:PARALLEL_LEVEL = (Get-WmiObject -class Win32_processor).NumberOfLogicalProcessors +# Extract the CL version for export to build scripts: +$script:CL_VERSION_STRING = & cl.exe /? +if ($script:CL_VERSION_STRING -match "Version (\d+\.\d+)\.\d+") { + $CL_VERSION = [version]$matches[1] + Write-Host "Detected cl.exe version: $CL_VERSION" +} + if (-not $env:CCCL_BUILD_INFIX) { $env:CCCL_BUILD_INFIX = "" } @@ -201,4 +207,4 @@ function sccache_stats { } Export-ModuleMember -Function configure_preset, build_preset, test_preset, configure_and_build_preset, sccache_stats -Export-ModuleMember -Variable BUILD_DIR +Export-ModuleMember -Variable BUILD_DIR, CL_VERSION diff --git a/ci/windows/build_cub.ps1 b/ci/windows/build_cub.ps1 index 8a7d729f71b..8ba1ce56eae 100644 --- a/ci/windows/build_cub.ps1 +++ b/ci/windows/build_cub.ps1 @@ -19,6 +19,10 @@ Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD $PRESET = "cub-cpp$CXX_STANDARD" $CMAKE_OPTIONS = "" +if ($CL_VERSION -lt [version]"19.20") { + $CMAKE_OPTIONS += "-DCUB_IGNORE_DEPRECATED_COMPILER=ON " +} + configure_and_build_preset "CUB" "$PRESET" "$CMAKE_OPTIONS" If($CURRENT_PATH -ne "ci") { diff --git a/ci/windows/build_thrust.ps1 b/ci/windows/build_thrust.ps1 index 5e4183dbc55..960d83ecc31 100644 --- a/ci/windows/build_thrust.ps1 +++ b/ci/windows/build_thrust.ps1 @@ -19,6 +19,10 @@ Import-Module $PSScriptRoot/build_common.psm1 -ArgumentList $CXX_STANDARD $PRESET = "thrust-cpp$CXX_STANDARD" $CMAKE_OPTIONS = "" +if ($CL_VERSION -lt [version]"19.20") { + $CMAKE_OPTIONS += "-THRUST_IGNORE_DEPRECATED_COMPILER=ON " +} + configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" If($CURRENT_PATH -ne "ci") { From 964b05732ae560d0f92a45dbab190816014e12a8 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Thu, 5 Oct 2023 12:23:43 +0000 Subject: [PATCH 56/64] Fix deprecation message. --- cub/cub/util_cpp_dialect.cuh | 2 +- thrust/thrust/detail/config/cpp_dialect.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cub/cub/util_cpp_dialect.cuh b/cub/cub/util_cpp_dialect.cuh index 23adf8e8dc7..693177974a2 100644 --- a/cub/cub/util_cpp_dialect.cuh +++ b/cub/cub/util_cpp_dialect.cuh @@ -109,7 +109,7 @@ #endif #define CUB_COMPILER_DEPRECATION(REQ) \ - CUB_COMP_DEPR_IMPL(CUB requires at least REQ. Define CUB_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.) + CUB_COMP_DEPR_IMPL(CUB requires at least REQ. Define CUB_IGNORE_DEPRECATED_COMPILER to suppress this message.) #define CUB_COMPILER_DEPRECATION_SOFT(REQ, CUR) \ CUB_COMP_DEPR_IMPL(CUB requires at least REQ. CUR is deprecated but still supported. CUR support will be removed in a future release. Define CUB_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.) diff --git a/thrust/thrust/detail/config/cpp_dialect.h b/thrust/thrust/detail/config/cpp_dialect.h index 46b0caec780..97c39bea574 100644 --- a/thrust/thrust/detail/config/cpp_dialect.h +++ b/thrust/thrust/detail/config/cpp_dialect.h @@ -98,7 +98,7 @@ #endif #define THRUST_COMPILER_DEPRECATION(REQ) \ - THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. Define THRUST_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.) + THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. Define THRUST_IGNORE_DEPRECATED_COMPILER to suppress this message.) #define THRUST_COMPILER_DEPRECATION_SOFT(REQ, CUR) \ THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. CUR is deprecated but still supported. CUR support will be removed in a future release. Define THRUST_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.) From 1bdb8a30ed6b4926e6442a6fe488588171b2fe3e Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Mon, 9 Oct 2023 22:18:37 +0000 Subject: [PATCH 57/64] Add missing escapes. --- ci/build_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index 7f5576c611c..6c97d0f7b6a 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -19,8 +19,8 @@ function usage { echo echo "Options:" echo " -v/--verbose: enable shell echo for debugging" - echo " -cuda: CUDA compiler (Defaults to $CUDACXX if set, otherwise nvcc)" - echo " -cxx: Host compiler (Defaults to $CXX if set, otherwise g++)" + echo " -cuda: CUDA compiler (Defaults to \$CUDACXX if set, otherwise nvcc)" + echo " -cxx: Host compiler (Defaults to \$CXX if set, otherwise g++)" echo " -std: CUDA/C++ standard (Defaults to 17)" echo " -arch: Target CUDA arches, e.g. \"60-real;70;80-virtual\" (Defaults to value in presets file)" echo From f630eb641b82f1d92d85aaa640ac2d8083809af5 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 14:40:48 +0000 Subject: [PATCH 58/64] Parse CLI args from a temp array. We were destructively parsing the CLI args in build_common, but the test scripts needed those to persist so they could be passed to the build scripts after sourcing build_common.sh. This was causing the build/test scripts to execute with different parameters. --- ci/build_common.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/ci/build_common.sh b/ci/build_common.sh index 6c97d0f7b6a..fbb989bc1e6 100755 --- a/ci/build_common.sh +++ b/ci/build_common.sh @@ -33,19 +33,21 @@ function usage { } # Parse options -while [ "$#" -gt 0 ]; do - case "${1}" in - -h) usage ;; - -help) usage ;; - --help) usage ;; - --verbose) VERBOSE=1; shift;; - -v) VERBOSE=1; shift;; - -cxx) HOST_COMPILER="${2}"; shift 2;; - -std) CXX_STANDARD="${2}"; shift 2;; - -cuda) CUDA_COMPILER="${2}"; shift 2;; - -arch) CUDA_ARCHS="${2}"; shift 2;; - -disable-benchmarks) ENABLE_CUB_BENCHMARKS="false"; shift;; - *) usage ;; + +# Copy the args into a temporary array, since we will modify them and +# the parent script may still need them. +args=("$@") +echo "Args: ${args[@]}" +while [ "${#args[@]}" -ne 0 ]; do + case "${args[0]}" in + -v | --verbose) VERBOSE=1; args=("${args[0]:1}");; + -cxx) HOST_COMPILER="${args[1]}"; args=("${args[@]:2}");; + -std) CXX_STANDARD="${args[1]}"; args=("${args[@]:2}");; + -cuda) CUDA_COMPILER="${args[1]}"; args=("${args[@]:2}");; + -arch) CUDA_ARCHS="${args[1]}"; args=("${args[@]:2}");; + -disable-benchmarks) ENABLE_CUB_BENCHMARKS="false"; args=("${args[@]:1}");; + -h | -help | --help) usage ;; + *) echo "Unrecognized option: ${args[0]}"; usage ;; esac done @@ -90,6 +92,8 @@ export CXX="${HOST_COMPILER}" export CUDACXX="${CUDA_COMPILER}" export CUDAHOSTCXX="${HOST_COMPILER}" +export CXX_STANDARD + # Print "ARG=${ARG}" for all args. function print_var_values() { # Iterate through the arguments From 3cae5b31350049993d004e5e0c43a1ddd5199a26 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 14:41:50 +0000 Subject: [PATCH 59/64] Remove problematic header from CUB tests. The usage of the atomics was removed in a previous commit, this removes the header to unblock the cl builds on sm60. --- .../catch2_test_device_adjacent_difference_substract_left.cu | 2 -- .../catch2_test_device_adjacent_difference_substract_right.cu | 2 -- 2 files changed, 4 deletions(-) diff --git a/cub/test/catch2_test_device_adjacent_difference_substract_left.cu b/cub/test/catch2_test_device_adjacent_difference_substract_left.cu index f5cc30a04a9..98cc4c27e75 100644 --- a/cub/test/catch2_test_device_adjacent_difference_substract_left.cu +++ b/cub/test/catch2_test_device_adjacent_difference_substract_left.cu @@ -31,8 +31,6 @@ #include #include -#include - #include #include diff --git a/cub/test/catch2_test_device_adjacent_difference_substract_right.cu b/cub/test/catch2_test_device_adjacent_difference_substract_right.cu index c5a4970cac2..df1b1555cd8 100644 --- a/cub/test/catch2_test_device_adjacent_difference_substract_right.cu +++ b/cub/test/catch2_test_device_adjacent_difference_substract_right.cu @@ -31,8 +31,6 @@ #include #include -#include - #include #include From 13183007ac52a2466220b5ad5c44ba99de709c0d Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 15:15:39 +0000 Subject: [PATCH 60/64] Remove unused infra file. --- .github/workflows/build-cccl-infra.yml | 28 -------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/build-cccl-infra.yml diff --git a/.github/workflows/build-cccl-infra.yml b/.github/workflows/build-cccl-infra.yml deleted file mode 100644 index c9c70947bda..00000000000 --- a/.github/workflows/build-cccl-infra.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build examples -on: - workflow_call: - inputs: - per_cuda_compiler_matrix: {type: string, required: true} - devcontainer_version: {type: string, required: true} - is_windows: {type: boolean, required: true} - -jobs: - # Using a matrix to dispatch to the build-and-test reusable workflow for each build configuration - # ensures that the build/test steps can overlap across different configurations. For example, - # the build step for CUDA 12.1 + gcc 9.3 can run at the same time as the test step for CUDA 11.0 + clang 11. - build_examples: - name: Build examples - if: ${{ !inputs.is_windows }} - uses: ./.github/workflows/run-as-coder.yml - strategy: - fail-fast: false - matrix: - include: ${{ fromJSON(inputs.per_cuda_compiler_matrix) }} - with: - name: CCCL Examples CUDA${{matrix.cuda}} ${{matrix.compiler.name}}${{matrix.compiler.version}} - runner: linux-${{matrix.cpu}}-gpu-v100-latest-1 - image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} - command: | - cmake -S . --preset=cccl -DCCCL_EXAMPLE_CPM_TAG=${GITHUB_SHA} - ctest --preset=cccl - \ No newline at end of file From 047ee6f922c77d766a2a38b8c62fed90f256f0fc Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 15:17:55 +0000 Subject: [PATCH 61/64] Fix typo in CMake arg --- ci/windows/build_thrust.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/windows/build_thrust.ps1 b/ci/windows/build_thrust.ps1 index 960d83ecc31..ef97509a598 100644 --- a/ci/windows/build_thrust.ps1 +++ b/ci/windows/build_thrust.ps1 @@ -20,7 +20,7 @@ $PRESET = "thrust-cpp$CXX_STANDARD" $CMAKE_OPTIONS = "" if ($CL_VERSION -lt [version]"19.20") { - $CMAKE_OPTIONS += "-THRUST_IGNORE_DEPRECATED_COMPILER=ON " + $CMAKE_OPTIONS += "-DTHRUST_IGNORE_DEPRECATED_COMPILER=ON " } configure_and_build_preset "Thrust" "$PRESET" "$CMAKE_OPTIONS" From b0db90953c4ed414e76bf81266856e705cced66c Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 15:36:02 +0000 Subject: [PATCH 62/64] Update syntax for launching clang-cuda builds. --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 86372139ab7..9c98ac81861 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -125,7 +125,7 @@ jobs: runner: linux-${{matrix.cpu}}-cpu16 image: rapidsai/devcontainers:${{needs.compute-matrix.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - CMAKE_CUDA_COMPILER="${{matrix.compiler.exe}}" ./ci/build_${{matrix.lib}}.sh ${{matrix.compiler.exe}} ${{matrix.std}} ${{matrix.gpu_build_archs}} + ./ci/build_${{matrix.lib}}.sh -cxx "${{matrix.compiler.exe}}" -std "${{matrix.std}}" cccl-infra: name: CCCL Infrastructure From 18148fd55a5f813f346c07f500a7fa0c6759196e Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 16:25:37 +0000 Subject: [PATCH 63/64] Re-enable clang-cuda builds using new CLI. --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9c98ac81861..c3ad374a0cd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -125,7 +125,7 @@ jobs: runner: linux-${{matrix.cpu}}-cpu16 image: rapidsai/devcontainers:${{needs.compute-matrix.outputs.DEVCONTAINER_VERSION}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}} command: | - ./ci/build_${{matrix.lib}}.sh -cxx "${{matrix.compiler.exe}}" -std "${{matrix.std}}" + ./ci/build_${{matrix.lib}}.sh -cxx "${{matrix.compiler.exe}}" -cuda "${{matrix.compiler.exe}}" -std "${{matrix.std}}" cccl-infra: name: CCCL Infrastructure From da4228d3e158905c5c424c4947807fabf6c0afd9 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 11 Oct 2023 16:56:33 +0000 Subject: [PATCH 64/64] [skip-tests] Update contributing guide with new CLI. --- CONTRIBUTING.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f452d217b89..7888aa97203 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,8 +27,8 @@ Thank you for your interest in contributing to the CUDA C++ Core Libraries (CCCL Ensure changes don't break existing functionality by building and running tests. ```bash - ./ci/build_[thrust|cub|libcudacxx].sh - ./ci/test_[thrust|cub|libcudacxx].sh + ./ci/build_[thrust|cub|libcudacxx].sh -cxx -std -arch + ./ci/test_[thrust|cub|libcudacxx].sh -cxx -std -arch ``` For more details on building and testing, refer to the [Building and Testing](#building-and-testing) section below. @@ -62,8 +62,8 @@ CCCL components are header-only libraries. This means there isn't a traditional Use the build scripts provided in the `ci/` directory to build tests for each component. Building tests does not require a GPU. ```bash - ci/build_[thrust|cub|libcudacxx].sh -``` + ci/build_[thrust|cub|libcudacxx].sh -cxx -std -arch + - **HOST_COMPILER**: The desired host compiler (e.g., `g++`, `clang++`). - **CXX_STANDARD**: The C++ standard version (e.g., `11`, `14`, `17`, `20`). - **GPU_ARCHS**: A semicolon-separated list of CUDA GPU architectures (e.g., `"70;85;90"`). This uses the same syntax as CMake's [CUDA_ARCHITECTURES](https://cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html#prop_tgt:CUDA_ARCHITECTURES): @@ -73,7 +73,7 @@ Use the build scripts provided in the `ci/` directory to build tests for each co **Example:** ```bash -./ci/build_cub.sh g++ 14 "70;75;80-virtual" +./ci/build_cub.sh -cxx g++ -std 14 -arch "70;75;80-virtual" ``` ### Testing @@ -81,12 +81,12 @@ Use the build scripts provided in the `ci/` directory to build tests for each co Use the test scripts provided in the `ci/` directory to run tests for each component. These take the same arguments as the build scripts and will automatically build the tests if they haven't already been built. Running tests requires a GPU. ```bash - ci/test_[thrust|cub|libcudacxx].sh + ci/test_[thrust|cub|libcudacxx].sh -cxx -std -arch ``` **Example:** ```bash -./ci/test_cub.sh g++ 14 "70;75;80-virtual" +./ci/test_cub.sh -cxx g++ -std 14 -arch "70;75;80-virtual" ``` ## Creating a Pull Request