Add 'projects/hip/' from commit 'e74b05a7bd9454b97dc04d7cc4b66d1fe6c534a7'

git-subtree-dir: projects/hip
git-subtree-mainline: 64df0940b8
git-subtree-split: e74b05a7bd
This commit is contained in:
systems-assistant[bot]
2025-08-10 02:09:42 +00:00
231 changed files with 63214 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/sphinx" # Location of package manifests
open-pull-requests-limit: 10
schedule:
interval: "daily"
labels:
- "documentation"
- "dependencies"
- "ci:docs-only"
target-branch: "docs/develop"
reviewers:
- "samjwu"
+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -euo pipefail
RANGE=""
while [[ $# -gt 0 ]]; do
echo $1
echo $2
case "$1" in
--range)
RANGE="$2"
shift 2
;;
*)
echo "Unknown arg $1" >&2
exit 64
;;
esac
done
regex='\.(c|cc|cpp|cxx|h|hh|hpp|hxx)$'
if [[ -n $RANGE ]]; then
files=$(git diff --name-only "$RANGE" | grep -E "$regex" || true)
else
files=$(git diff --cached --name-only --diff-filter=ACMR | grep -E "$regex" || true)
fi
echo "Checking $files"
[[ -z $files ]] && exit 0
clang_bin="${CLANG_FORMAT:-clang-format}"
if ! command -v "$clang_bin" >/dev/null 2>&1; then
if [[ -x "/c/Program Files/LLVM/bin/clang-format.exe" ]]; then
clang_bin="/c/Program Files/LLVM/bin/clang-format.exe"
fi
fi
clang_format_diff="${CLANG_FORMAT_DIFF:-clang-format-diff}"
if ! command -v "$clang_format_diff" >/dev/null 2>&1; then
if [[ -x "/c/Program Files/LLVM/share/clang/clang-format-diff.py" ]]; then
clang_format_diff="/c/Program Files/LLVM/share/clang/clang-format-diff.py"
fi
fi
for file in $files; do
echo "Checking lines of $file"
if [[ -n $RANGE ]]; then
diff_output=$(git diff -U0 "$RANGE" -- "$file")
else
diff_output=$(git diff -U0 --cached -- "$file")
fi
echo "$diff_output" | "$clang_format_diff" -style=file -fallback-style=none -p1
done
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec "$(git rev-parse --show-toplevel)/.github/hooks/clang-format-check.sh"
+5
View File
@@ -0,0 +1,5 @@
disabled: false
scmId: gh-emu-rocm
branchesToScan:
- amd-staging
- amd-mainline
+36
View File
@@ -0,0 +1,36 @@
## Associated JIRA ticket number/Github issue number
<!-- For example: "Closes #1234" or "Fixes SWDEV-123456" -->
## What type of PR is this? (check all applicable)
- [ ] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Continuous Integration
## What were the changes?
<!-- Please give a short summary of the change. -->
## Why are these changes needed?
<!-- Please explain the motivation behind the change and why this solves the given problem. -->
## Updated CHANGELOG?
<!-- Needed for Release updates for a ROCm release. -->
- [ ] Yes
- [ ] No, Does not apply to this PR.
## Added/Updated documentation?
- [ ] Yes
- [ ] No, Does not apply to this PR.
## Additional Checks
- [ ] I have added tests relevant to the introduced functionality, and the unit tests are passing locally.
- [ ] Any dependent changes have been merged.
+76
View File
@@ -0,0 +1,76 @@
import os, re, sys
from typing import List, Optional
def is_checkbox(line: str) -> bool:
return bool(re.match(r"^\s*-\s*\[[ xX]\]\s*.+", line))
def is_checked(line: str) -> bool:
return bool(re.match(r"^\s*-\s*\[[xX]\]\s*.+", line))
def is_comment(line: str) -> bool:
return bool(re.match(r"^\s*<!--.*-->\s*$", line))
def text_clean(lines: List[str]) -> str:
text = [line for line in lines if not is_comment(line)]
return "".join("".join(text).strip().split())
def validate_section(section_name: str, lines: List[str]) -> Optional[str]:
has_checkboxes = any(is_checkbox(line) for line in lines)
if has_checkboxes:
if not any(is_checked(line) for line in lines):
return f"Section {section_name} is a checklist without selections"
return None
if not text_clean(lines):
return f"Section {section_name} is empty text section"
return None
def check_description(description: str) -> List[str]:
if not description:
# pull_request_template is not merged yet, so treat as valid for now
return []
# return ["PR description is empty"]
sections = []
current_section = None
current_lines = []
errors = []
for line in description.splitlines():
header_match = re.match(r"^\s*##\s*(.+?)\s*$", line)
if header_match:
if current_section:
sections.append((current_section, current_lines))
current_section = header_match.group(1)
current_lines = []
elif current_section:
current_lines.append(line)
if current_section:
sections.append((current_section, current_lines))
if not sections:
return ["No sections available, template is empty"]
for section_name, section_lines in sections:
error = validate_section(section_name, section_lines)
if error:
errors.append(error)
return errors
if __name__ == "__main__":
pr_description = os.getenv("PR_DESCRIPTION", "")
errors = check_description(pr_description)
if not errors:
print("All good")
exit(0)
print("\n".join(errors))
exit(1)
+22
View File
@@ -0,0 +1,22 @@
name: Clang format check
on:
pull_request:
types: [synchronize, opened]
jobs:
format:
runs-on: AMD-ROCm-Internal-dev1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install clang-format
run: |
sudo apt update && sudo apt install -y clang-format
- name: Run clang-format-check
id: clang-format
run: |
chmod +x .github/hooks/clang-format-check.sh
./.github/hooks/clang-format-check.sh --range "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
+73
View File
@@ -0,0 +1,73 @@
name: Keywords checker
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- amd-staging
workflow_dispatch:
jobs:
check-keywords:
runs-on: AMD-ROCm-Internal-dev1
env:
KEYWORDS: ${{ vars.KEYWORDS }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check keywords
run: |
set -e
if [ -z "$KEYWORDS" ]; then
echo "No keywords set. Skipping check"
exit 0
fi
IFS=',' read -ra KEYWORDS_ARRAY <<< "$KEYWORDS"
echo "Checking against list of keywords: ${KEYWORDS_ARRAY[*]}"
MATCHED=0
BASE_BRANCH=${{github.event.pull_request.base.ref}}
HEAD_BRANCH=${{github.event.pull_request.head.ref}}
PR_TITLE="${{ github.event.pull_request.title }}"
for file in $(git diff --name-only origin/$BASE_BRANCH..origin/$HEAD_BRANCH); do
if [ -f "$file" ]; then
for keyword in "${KEYWORDS_ARRAY[*]}"; do
grep -in -E "${keyword}" "$file" | while IFS= read -r line; do
echo "Matched in '$file': $line"
MATCHED=1
done
done
fi
done
for commit in $(git log --format=%H origin/$BASE_BRANCH..origin/$HEAD_BRANCH); do
msg=$(git log -1 --format=%B "$commit")
for keyword in "${KEYWORDS_ARRAY[*]}"; do
if echo "$msg" | grep -i -q "$keyword"; then
echo "Match in commit $commit: $msg"
MATCHED=1
fi
done
done
for keyword in "${KEYWORDS_ARRAY[*]}"; do
if echo "$PR_TITLE" | grep -i -q "$keyword"; then
echo "Match in PR title"
MATCHED=1
fi
done
if [ "$MATCHED" -eq 1 ]; then
echo "Keywords found, please see diagnostics higher"
exit 1
else
echo "No keywords found"
exit 0
fi
+15
View File
@@ -0,0 +1,15 @@
name: Rocm Validation Suite KWS
on:
push:
branches: [amd-staging, amd-mainline]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
kws:
if: ${{ github.event_name == 'pull_request' }}
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/kws.yml@mainline
secrets: inherit
with:
pr_number: ${{github.event.pull_request.number}}
base_branch: ${{github.base_ref}}
+20
View File
@@ -0,0 +1,20 @@
name: Linting
on:
push:
branches:
- develop
- main
- 'docs/*'
- 'roc**'
pull_request:
branches:
- develop
- main
- 'docs/*'
- 'roc**'
jobs:
call-workflow-passing-data:
name: Documentation
uses: ROCm/rocm-docs-core/.github/workflows/linting.yml@develop
+46
View File
@@ -0,0 +1,46 @@
name: Validate PR Title
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
validate-pr-title:
runs-on: ubuntu-latest
steps:
- name: Check PR Title
id: check-pr-title
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
if [[ ! "$PR_TITLE" =~ ^SWDEV-[0-9]+ ]]; then
echo "::error::PR title must start with a Jira ticket ID, SWDEV-<num>"
exit 1
else
echo "PR title is valid"
fi
validate-commit-messages:
runs-on: AMD-ROCm-Internal-dev1
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check all commit messages
id: validate-commit-messags
run: |
COMMITS=$(git log --format="%H %s" origin/${{ github.event.pull_request.base.ref }}..origin/${{ github.event.pull_request.head.ref }})
echo "$COMMITS"
echo "$COMMITS" | while read -r hash message; do
echo -e "$hash $message\n "
if [[ "$message" =~ ^SWDEV-[0-9]+ ]]; then
echo "Valid JIRA ticket format"
elif [[ "$message" =~ ^Merge\ branch ]]; then
echo "Merge commits are allowed"
else
echo "::error:: $hash commit should start with Jira ticket ID, SWDEV-<num> or be a merge commit"
exit 1
fi
done
+25
View File
@@ -0,0 +1,25 @@
name: ROCm CI Caller
on:
pull_request:
branches: [amd-staging, amd-npi-next, release/rocm-rel-*, amd-mainline]
types: [opened, reopened, synchronize]
push:
branches: [amd-mainline]
workflow_dispatch:
issue_comment:
types: [created]
jobs:
call-workflow:
if: github.event_name != 'issue_comment' ||(github.event_name == 'issue_comment' && github.event.issue.pull_request && (startsWith(github.event.comment.body, '!verify') || startsWith(github.event.comment.body, '!linux-hip-psdb') || startsWith(github.event.comment.body, '!verify release') || startsWith(github.event.comment.body, '!verify retest')))
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/rocm_ci.yml@mainline
secrets: inherit
with:
input_sha: ${{github.event_name == 'pull_request' && github.event.pull_request.head.sha || (github.event_name == 'push' && github.sha) || (github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha) || github.sha}}
input_pr_num: ${{github.event_name == 'pull_request' && github.event.pull_request.number || (github.event_name == 'issue_comment' && github.event.issue.number) || 0}}
input_pr_url: ${{github.event_name == 'pull_request' && github.event.pull_request.html_url || (github.event_name == 'issue_comment' && github.event.issue.pull_request.html_url) || ''}}
input_pr_title: ${{github.event_name == 'pull_request' && github.event.pull_request.title || (github.event_name == 'issue_comment' && github.event.issue.pull_request.title) || ''}}
repository_name: ${{ github.repository }}
base_ref: ${{github.event_name == 'pull_request' && github.event.pull_request.base.ref || (github.event_name == 'issue_comment' && github.event.issue.pull_request.base.ref) || github.ref}}
trigger_event_type: ${{ github.event_name }}
comment_text: ${{ github.event_name == 'issue_comment' && github.event.comment.body || '' }}
@@ -0,0 +1,22 @@
name: Validate PR desription
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
validate-pr-description:
runs-on: AMD-ROCm-Internal-dev1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Validate PR description
env:
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
run: python .github/scripts/validate_pr_description.py