Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pr/allisonvacanti/300
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Aug 31, 2023
2 parents 0dad2c7 + c17cac0 commit bd88a9f
Show file tree
Hide file tree
Showing 373 changed files with 10,826 additions and 10,604 deletions.
39 changes: 39 additions & 0 deletions .devcontainer/cuda12.2-llvm16/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"shutdownAction": "stopContainer",
"image": "rapidsai/devcontainers:23.08-cpp-llvm16-cuda12.2-ubuntu22.04",
"hostRequirements": {
"gpu": true
},
"initializeCommand": [
"/bin/bash",
"-c",
"mkdir -m 0755 -p ${localWorkspaceFolder}/.{aws,cache,config}"
],
"containerEnv": {
"SCCACHE_REGION": "us-east-2",
"SCCACHE_BUCKET": "rapids-sccache-devs",
"VAULT_HOST": "https://vault.ops.k8s.rapids.ai",
"HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history",
"DEVCONTAINER_NAME": "cuda12.2-llvm16"
},
"workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent",
"mounts": [
"source=${localWorkspaceFolder}/.aws,target=/home/coder/.aws,type=bind,consistency=consistent",
"source=${localWorkspaceFolder}/.cache,target=/home/coder/.cache,type=bind,consistency=consistent",
"source=${localWorkspaceFolder}/.config,target=/home/coder/.config,type=bind,consistency=consistent"
],
"customizations": {
"vscode": {
"extensions": [
"llvm-vs-code-extensions.vscode-clangd"
],
"settings": {
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build/latest"
]
}
}
},
"name": "cuda12.2-llvm16"
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: Create a report to help us improve
title: '[BUG]: '
labels: ['Bug']
labels: ['bug']
body:
- type: checkboxes
id: check-duplicates
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/doc_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Documentation Request
description: Suggest an idea to improve CCCL
title: '[DOC]: '
labels: ['Doc']
labels: ['doc']

body:
- type: checkboxes
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature Request
description: Suggest an idea to improve CCCL
title: '[FEA]: '
labels: ['Feature']
labels: ['feature request']
body:
- type: checkboxes
id: check-duplicates
Expand Down
4 changes: 4 additions & 0 deletions .github/copy-pr-bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Configuration file for `copy-pr-bot` GitHub App
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/

enabled: true
4 changes: 0 additions & 4 deletions .github/ops-bot.yaml

This file was deleted.

92 changes: 82 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

# This is the main workflow that runs on every PR and push to main
name: pr
Expand All @@ -18,7 +32,7 @@ concurrency:
cancel-in-progress: true

jobs:

get-devcontainer-version:
name: Get devcontainer version
runs-on: ubuntu-latest
Expand All @@ -37,6 +51,7 @@ jobs:
name: Compute NVCC matrix
runs-on: ubuntu-latest
outputs:
FULL_MATRIX: ${{ steps.set-outputs.outputs.FULL_MATRIX }}
CUDA_VERSIONS: ${{ steps.set-outputs.outputs.CUDA_VERSIONS }}
HOST_COMPILERS: ${{ steps.set-outputs.outputs.HOST_COMPILERS }}
PER_CUDA_COMPILER_MATRIX: ${{ steps.set-outputs.outputs.PER_CUDA_COMPILER_MATRIX }}
Expand All @@ -53,21 +68,59 @@ jobs:
id: set-outputs
run: |
FULL_MATRIX='${{steps.compute-nvcc-matrix.outputs.matrix}}'
echo "FULL_MATRIX=$FULL_MATRIX" | tee -a "$GITHUB_OUTPUT"
CUDA_VERSIONS=$(echo $FULL_MATRIX | jq -c '[.[] | .cuda] | unique')
echo "CUDA_VERSIONS=$CUDA_VERSIONS" | tee -a "$GITHUB_OUTPUT"
HOST_COMPILERS=$(echo $FULL_MATRIX | jq -c '[.[] | .compiler.name] | unique')
echo "HOST_COMPILERS=$HOST_COMPILERS" | tee -a "$GITHUB_OUTPUT"
PER_CUDA_COMPILER_MATRIX=$(echo $FULL_MATRIX | jq -c ' group_by(.cuda + .compiler.name) | map({(.[0].cuda + "-" + .[0].compiler.name): .}) | add')
echo "PER_CUDA_COMPILER_MATRIX=$PER_CUDA_COMPILER_MATRIX" | tee -a "$GITHUB_OUTPUT"
compute-nvrtc-matrix:
name: Compute NVRTC matrix
runs-on: ubuntu-latest
outputs:
NVRTC_MATRIX: ${{ steps.set-outputs.outputs.NVRTC_MATRIX }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get full nvrtc matrix
id: compute-nvrtc-matrix
uses: ./.github/actions/compute-matrix
with:
matrix_file: './ci/matrix.yaml'
matrix_query: '.pull_request.nvrtc'
- name: Set outputs
id: set-outputs
run: |
NVRTC_MATRIX='${{steps.compute-nvrtc-matrix.outputs.matrix}}'
echo "NVRTC_MATRIX=$NVRTC_MATRIX" | tee -a "$GITHUB_OUTPUT"
nvrtc:
name: NVRTC CUDA${{matrix.cuda}} C++${{matrix.std}}
if: ${{ !contains(github.event.head_commit.message, 'skip-tests') }}
needs: [compute-nvrtc-matrix, get-devcontainer-version]
uses: ./.github/workflows/run-as-coder.yml
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.compute-nvrtc-matrix.outputs.NVRTC_MATRIX) }}
with:
name: NVRTC CUDA${{matrix.cuda}} C++${{matrix.std}}
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}}
thrust:
name: Thrust CUDA${{ matrix.cuda_version }} ${{ matrix.compiler }}
needs: [compute-nvcc-matrix, get-devcontainer-version]
uses: ./.github/workflows/dispatch-build-and-test.yml
strategy:
fail-fast: false
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.HOST_COMPILERS) }}
with:
per_cuda_compiler_matrix: ${{ toJSON(fromJSON(needs.compute-nvcc-matrix.outputs.PER_CUDA_COMPILER_MATRIX)[ format('{0}-{1}', matrix.cuda_version, matrix.compiler) ]) }}
Expand All @@ -81,38 +134,57 @@ jobs:
uses: ./.github/workflows/dispatch-build-and-test.yml
strategy:
fail-fast: false
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.HOST_COMPILERS) }}
with:
per_cuda_compiler_matrix: ${{ toJSON(fromJSON(needs.compute-nvcc-matrix.outputs.PER_CUDA_COMPILER_MATRIX)[ format('{0}-{1}', matrix.cuda_version, matrix.compiler) ]) }}
build_script: "./ci/build_cub.sh"
test_script: "./ci/test_cub.sh"
devcontainer_version: ${{ needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION }}

libcudacxx:
name: libcudacxx CUDA${{ matrix.cuda_version }} ${{ matrix.compiler }}
needs: [compute-nvcc-matrix, get-devcontainer-version]
uses: ./.github/workflows/dispatch-build-and-test.yml
strategy:
fail-fast: false
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.HOST_COMPILERS) }}
with:
per_cuda_compiler_matrix: ${{ toJSON(fromJSON(needs.compute-nvcc-matrix.outputs.PER_CUDA_COMPILER_MATRIX)[ format('{0}-{1}', matrix.cuda_version, matrix.compiler) ]) }}
build_script: "./ci/build_libcudacxx.sh"
test_script: "./ci/test_libcudacxx.sh"
test_script: "./ci/test_libcudacxx.sh"
devcontainer_version: ${{ needs.get-devcontainer-version.outputs.DEVCONTAINER_VERSION }}

examples:
name: CCCL Examples
if: ${{ !contains(github.event.head_commit.message, 'skip-tests') }}
needs: [compute-nvcc-matrix, get-devcontainer-version]
strategy:
fail-fast: false
matrix:
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}}
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
ctest --preset=examples
# 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
ci:
runs-on: ubuntu-latest
name: CI
needs:
- libcudacxx
- cub
- libcudacxx
- nvrtc
- thrust
- examples
steps:
- run: echo "CI success"
46 changes: 25 additions & 21 deletions .github/workflows/project_automation_set_in_progress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,49 @@ env:
jobs:
query_and_mutate_project_fields:
runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write

steps:
- name: Check if changes requested from a reviewer
id: check_changes_requested
if: github.event_name == 'pull_request_review'
run: |
if [ ${{ github.event_name }} == 'pull_request_review' ]; then
if [ ${{ github.event.review.state }} != 'changes_requested' ]; then
echo "Changes not requested, exiting"
exit 0
fi
if [ ${{ github.event.review.state }} != 'changes_requested' ]; then
echo "Changes not requested, exiting"
exit 0
# If it is requesting changes, set PR to draft
# We use the default token here since we're granting write access to the PR
elif [ ${{ github.event.pull_request.draft }} == true ]; then
gh api graphql -f query='
mutation {
convertPullRequestToDraft(input: {pullRequestId: "${{ env.PR_GLOBAL_ID }}"}) {
clientMutationId
}
}'
exit 0
fi
continue-on-error: true

- name: Generate token
id: generate_token
if: github.event_name == 'pull_request_target'
uses: tibdex/github-app-token@v1.8.0
with:
app_id: ${{ secrets.CCCL_AUTH_APP_ID }}
private_key: ${{ secrets.CCCL_AUTH_APP_PEM }}

- name: Wait 1 Second
id: sleep
if: github.event_name == 'pull_request_target'
run: sleep 1

- name: Get PR Project ID
id: get_pr_id
if: github.event_name == 'pull_request_target'
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
Expand Down Expand Up @@ -104,6 +122,7 @@ jobs:

- name: Set PR Fields
id: set_pr_fields
if: github.event_name == 'pull_request_target'
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
Expand Down Expand Up @@ -233,6 +252,7 @@ jobs:

- name: Sync Linked Issues
id: sync_linked_issues
if: github.event_name == 'pull_request_target'
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
Expand Down Expand Up @@ -334,19 +354,3 @@ jobs:
fi
done
continue-on-error: true

- name: set PR to draft
id: set_pr_draft
# only run if PR is not a draft
if: ${{ github.event.pull_request.draft }} == false
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
# Set the PR to draft using the graphQL API
gh api graphql -f query='
mutation {
convertPullRequestToDraft(input: {pullRequestId: "${{ env.PR_GLOBAL_ID }}"}) {
clientMutationId
}
}'
continue-on-error: true
1 change: 1 addition & 0 deletions .github/workflows/run-as-coder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- name: Run command
shell: su coder {0}
run: |
set -exo pipefail
cd ~/cccl
eval "${{inputs.command}}" || exit_code=$?
if [ ! -z "$exit_code" ]; then
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ option(CCCL_ENABLE_LIBCUDACXX "Enable the libcu++ developer build." ON)
option(CCCL_ENABLE_CUB "Enable the CUB developer build." ON)
option(CCCL_ENABLE_THRUST "Enable the Thrust developer build." ON)
option(CCCL_ENABLE_TESTING "Enable CUDA C++ Core Library tests." ON)
option(CCCL_ENABLE_EXAMPLES "Enable CUDA C++ Core Library examples." ON)

include(CTest)
enable_testing()

include(cmake/CCCLUtilities.cmake)

if (CCCL_ENABLE_LIBCUDACXX)
set(LIBCUDACXX_TOPLEVEL_PROJECT ON)
endif()
Expand All @@ -53,5 +56,9 @@ if (CCCL_ENABLE_TESTING)
add_subdirectory(test)
endif()

if (CCCL_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()

# Must stay at the end of this file.
include(cmake/CCCLHideThirdPartyOptions.cmake)
Loading

0 comments on commit bd88a9f

Please sign in to comment.