Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SYCLomatic' into support_more_ge…
Browse files Browse the repository at this point in the history
…mm_batch
  • Loading branch information
zhiweij1 committed Jul 5, 2024
2 parents 1d91ff8 + 0389f19 commit 3b40caf
Show file tree
Hide file tree
Showing 3,524 changed files with 103,195 additions and 38,554 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
42 changes: 30 additions & 12 deletions .ci/generate-buildkite-pipeline-premerge
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ function compute-projects-to-test() {
done
}

function compute-runtimes-to-test() {
projects=${@}
for project in ${projects}; do
case ${project} in
clang)
for p in libcxx libcxxabi libunwind; do
echo $p
done
;;
*)
# Nothing to do
;;
esac
done
}

function add-dependencies() {
projects=${@}
for project in ${projects}; do
Expand Down Expand Up @@ -178,6 +194,15 @@ function check-targets() {
cross-project-tests)
echo "check-cross-project"
;;
libcxx)
echo "check-cxx"
;;
libcxxabi)
echo "check-cxxabi"
;;
libunwind)
echo "check-unwind"
;;
lldb)
echo "check-all" # TODO: check-lldb may not include all the LLDB tests?
;;
Expand Down Expand Up @@ -207,17 +232,6 @@ if echo "$modified_dirs" | grep -q -E "^(libcxx|libcxxabi|libunwind|runtimes|cma
EOF
fi

# If clang changed.
if echo "$modified_dirs" | grep -q -E "^(clang)$"; then
cat <<EOF
- trigger: "clang-ci"
build:
message: "${buildMessage}"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
EOF
fi

# Generic pipeline for projects that have not defined custom steps.
#
# Individual projects should instead define the pre-commit CI tests that suits their
Expand All @@ -231,6 +245,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro
linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)

linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)

windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects}))
windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq)
windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq)
Expand All @@ -255,7 +273,7 @@ if [[ "${linux_projects}" != "" ]]; then
CC: 'clang'
CXX: 'clang++'
commands:
- './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"'
- './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"'
EOF
fi

Expand Down
74 changes: 73 additions & 1 deletion .ci/monolithic-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set -o pipefail

MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
INSTALL_DIR="${BUILD_DIR}/install"
rm -rf "${BUILD_DIR}"

ccache --zero-stats
Expand Down Expand Up @@ -49,8 +50,79 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_LLD=ON \
-D CMAKE_CXX_FLAGS=-gmlt \
-D LLVM_CCACHE_BUILD=ON \
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"

echo "--- ninja"
# Targets are not escaped as they are passed as separate arguments.
ninja -C "${BUILD_DIR}" -k 0 ${targets}

runtimes="${3}"
runtime_targets="${4}"

# Compiling runtimes with just-built Clang and running their tests
# as an additional testing for Clang.
if [[ "${runtimes}" != "" ]]; then
if [[ "${runtime_targets}" == "" ]]; then
echo "Runtimes to build are specified, but targets are not."
exit 1
fi

echo "--- ninja install-clang"

ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers

RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
INSTALL_DIR="${BUILD_DIR}/install"
mkdir -p ${RUNTIMES_BUILD_DIR}

echo "--- cmake runtimes C++03"

cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-D LIBCXX_CXX_ABI=libcxxabi \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-D LIBCXX_TEST_PARAMS="std=c++03" \
-D LIBCXXABI_TEST_PARAMS="std=c++03"

echo "--- ninja runtimes C++03"

ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}

echo "--- cmake runtimes C++26"

rm -rf "${RUNTIMES_BUILD_DIR}"
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-D LIBCXX_CXX_ABI=libcxxabi \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-D LIBCXX_TEST_PARAMS="std=c++26" \
-D LIBCXXABI_TEST_PARAMS="std=c++26"

echo "--- ninja runtimes C++26"

ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}

echo "--- cmake runtimes clang modules"

rm -rf "${RUNTIMES_BUILD_DIR}"
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-D LIBCXX_CXX_ABI=libcxxabi \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"

echo "--- ninja runtimes clang modules"

ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
fi
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: To reproduce
description: Please describe the steps to reproduce the behavior
placeholder: |
value: |
1. Include a code snippet that is as short as possible
2. Specify the command which should be used to compile the program
3. Specify the command which should be used to launch the program
Expand All @@ -26,7 +26,7 @@ body:
attributes:
label: Environment
description: Please complete the following information
placeholder: |
value: |
- OS: [e.g Windows/Linux]
- Target device and vendor: [e.g. Intel GPU]
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/2-bug-report-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
attributes:
label: To reproduce
description: Please describe the steps to reproduce the behavior
placeholder: |
value: |
1. Include code snippet as short as possible
2. Specify the command which should be used to compile the program
3. Specify the command which should be used to launch the program
Expand All @@ -29,7 +29,7 @@ body:
attributes:
label: Environment
description: Please complete the following information
placeholder: |
value: |
- OS: [e.g Windows/Linux]
- Target device and vendor: [e.g. Nvidia GPU]
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/3-bug-report-hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
attributes:
label: To reproduce
description: Please describe the steps to reproduce the behavior
placeholder: |
value: |
1. Include code snippet as short as possible
2. Specify the command which should be used to compile the program
3. Specify the command which should be used to launch the program
Expand All @@ -29,7 +29,7 @@ body:
attributes:
label: Environment
description: Please complete the following information
placeholder: |
value: |
- OS: [e.g Windows/Linux]
- Target device and vendor: [e.g. AMD GPU]
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

# Check current LLVM-Project results here: https://securityscorecards.dev/viewer/?uri=github.com/intel/llvm

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '30 20 * * *'

# Declare default permissions as read only.
permissions:
contents: read

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
if: github.repository == 'intel/llvm'
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write

steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif

# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
sarif_file: results.sarif
68 changes: 68 additions & 0 deletions .github/workflows/sycl-issues-ping-assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Ping issue assignees
# We have some specific pool of the issues we would like to handle. Sometimes
# the issue from this pool has an assignee, but doesn't get any updates for a
# long time. In this case it'd be useful to periodically ping the assignee.

# Note: may be we could use "actions/stale@v*", but I'm not sure if it's
# possible to not set the "stale" label at all. Even so, this action will not
# ping the assignee of the "stale" issue more than onсe.

# Note2: probably it'd be useful to have a small doc describing this "specific
# pool" to refer to.

on:
schedule:
- cron: '0 0 * * *'

permissions: read-all

jobs:
run:
permissions:
issues: write
runs-on: ubuntu-20.04
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
steps:
# List specific issues with an assignee but without recent updates.
# Note: for some reason gh returns 0 results if the "assignee:*" filter is
# added, so we have to manually filter the results.
- name: Get the specicifc list of issues
run: |
gh issue list --search '-label:"help wanted" -label:cuda \
-label:confirmed -label:hip -label:sycl-mlir -label:upstream is:open \
-label:genx -label:sycl-bindless-images -label:sycl-graph \
-label:native-cpu' --limit 200 --json assignees --json number \
--json updatedAt \
-R https://github.com/${{ env.REPO }}.git > issues.json
- name: Filter issues and ping
run: |
days_to_stale=60
current_time=$(date +%s)
cat issues.json | jq -c '.[]' | while read -r issue; do
assignees=$(echo "$issue" | jq '.assignees | length')
[ "$assignees" -eq 0 ] && continue
updated_at=$(echo "$issue" | jq -r '.updatedAt')
updated_at_seconds=$(date -d "$updated_at" +%s)
difference_days=$(( (current_time - updated_at_seconds) / 86400 ))
[ "$difference_days" -lt $days_to_stale ] && continue
issue_number=$(echo "$issue" | jq '.number')
assignee_logins=$(echo "$issue" | jq -r '.assignees[].login' | sed 's/^/@/' | paste -s -d ' ' -)
comment_body="Hi! There have been no updates for at least the last $days_to_stale days, though the issue has assignee(s).
$assignee_logins, could you please take one of the following actions:
- provide an update if you have any
- unassign yourself if you're not looking / going to look into this issue
- mark this issue with the 'confirmed' label if you have confirmed the problem/request and our team should work on it
- close the issue if it has been resolved
- take any other suitable action.
Thanks!"
gh issue comment $issue_number -R https://github.com/${{ env.REPO }}.git -b "$comment_body" >> $GITHUB_STEP_SUMMARY
done
Loading

0 comments on commit 3b40caf

Please sign in to comment.