Skip to content

Commit f824054

Browse files
committed
Merge remote-tracking branch 'intel/sycl' into sycl-triple-dependent-opts
2 parents bf38050 + b7f3920 commit f824054

File tree

905 files changed

+107565
-3411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

905 files changed

+107565
-3411
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This workflow checks for ready-to-merge PRs - if a PR is open, not a draft,
2+
# passed all checks, and has been approved, it will ping @intel/llvm-gatekeepers
3+
# if this group has not already been mentioned or if the last mention was more
4+
# than $days days ago.
5+
6+
name: Check ready-to-merge PRs
7+
8+
on:
9+
schedule:
10+
- cron: '0 * * * *' # every hour
11+
workflow_dispatch:
12+
13+
permissions: read-all
14+
15+
jobs:
16+
notify-ready-prs:
17+
permissions:
18+
pull-requests: write
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
# Number of days before repeating the gatekeepers ping
26+
days=3
27+
days_in_seconds=$((days*24*60*60))
28+
29+
# Function to ping gatekeepers and print debug info
30+
ping_gatekeepers() {
31+
pr_number=$1
32+
gh pr comment "$pr_number" --repo intel/llvm --body "@intel/llvm-gatekeepers please consider merging"
33+
echo "Pinged @intel/llvm-gatekeepers for https://github.com/intel/llvm/pull/$pr_number"
34+
}
35+
36+
# Get the list of suitable PRs
37+
prs=$(gh pr list --search "is:open review:approved draft:no status:success" --repo intel/llvm --json number --jq '.[].number')
38+
now=$(date -u +%s)
39+
for pr in $prs; do
40+
# Get the timestamp of the latest comment mentioning @intel/llvm-gatekeepers
41+
latest_ts=$(gh pr view $pr --repo intel/llvm --json comments \
42+
--jq '[.comments[] | select(.body | test("@intel/llvm-gatekeepers")) | .createdAt] | last')
43+
# If there is no previous mention, ping the gatekeepers
44+
if [[ -z "$latest_ts" ]]; then
45+
ping_gatekeepers "$pr"
46+
# If the latest mention is older than $days, ping the gatekeepers again
47+
else
48+
comment_time=$(date -u -d "$latest_ts" +%s)
49+
age=$((now - comment_time))
50+
if (( age >= days_in_seconds )); then
51+
ping_gatekeepers "$pr"
52+
fi
53+
fi
54+
done

.github/workflows/sycl-docs.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@ on:
1010
- '.github/workflows/sycl-docs.yml'
1111
- 'clang/docs/**'
1212
- 'sycl/doc/**'
13+
- 'devops/benchmarks/scripts/html/**'
1314
push:
1415
branches:
1516
- sycl
1617
paths:
1718
- '.github/workflows/sycl-docs.yml'
1819
- 'clang/docs/**'
1920
- 'sycl/doc/**'
21+
- 'devops/benchmarks/scripts/html/**'
22+
workflow_dispatch:
23+
inputs:
24+
update_gh_pages:
25+
type: choice
26+
description: Update Github Pages
27+
options:
28+
- true
29+
- false
30+
default: true
2031

2132
permissions:
2233
contents: read
@@ -62,5 +73,5 @@ jobs:
6273
with:
6374
path: ./install_docs
6475
- name: Deploy to GitHub Pages
65-
if: ${{ github.event_name == 'push' }}
76+
if: ${{ github.event_name == 'push' || inputs.update_gh_pages == 'true' }}
6677
uses: actions/deploy-pages@v4

.github/workflows/sycl-linux-build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ jobs:
202202
--ci-defaults ${{ inputs.build_configure_extra_args }} \
203203
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
204204
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
205-
-DLLVM_INSTALL_UTILS=ON \
206-
-DNATIVECPU_USE_OCK=Off
205+
-DLLVM_INSTALL_UTILS=ON
207206
- name: Compile
208207
id: build
209208
# Emulate default value for manual dispatch as we've run out of available arguments.

.github/workflows/sycl-nightly.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,23 @@ jobs:
201201
always()
202202
&& !cancelled()
203203
&& needs.build-win.outputs.build_conclusion == 'success'
204+
strategy:
205+
fail-fast: false
206+
matrix:
207+
include:
208+
- name: Intel L0 Gen12 GPU
209+
runner: '["Windows", "gen12"]'
210+
target_devices: level_zero:gpu
211+
212+
- name: Intel L0 Battlemage GPU
213+
runner: '["Windows", "bmg"]'
214+
target_devices: level_zero:gpu
215+
204216
uses: ./.github/workflows/sycl-windows-run-tests.yml
205217
with:
206-
name: Intel GEN12 Graphics with Level Zero
207-
runner: '["Windows","gen12"]'
208-
target_devices: level_zero:gpu
218+
name: ${{ matrix.name }}
219+
runner: ${{ matrix.runner }}
220+
target_devices: ${{ matrix.target_devices }}
209221
toolchain_artifact_filename: ${{ needs.build-win.outputs.toolchain_artifact_filename }}
210222

211223
cuda-aws-start:
@@ -320,20 +332,30 @@ jobs:
320332
toolchain_artifact_filename: ${{ needs.build-win.outputs.toolchain_artifact_filename }}
321333
sycl_cts_artifact: sycl_cts_bin_win
322334

335+
# Verification example:
336+
# cosign-windows-amd64.exe verify-blob sycl_linux.tar.gz \
337+
# --bundle sycl_linux.tar.gz.sigstore.json \
338+
# --certificate-oidc-issuer https://token.actions.githubusercontent.com \
339+
# --certificate-identity https://github.com/intel/llvm/.github/workflows/sycl-nightly.yml@refs/heads/sycl
323340
nightly_build_upload:
324341
name: Nightly Build Upload
325342
if: ${{ github.ref_name == 'sycl' }}
326343
needs: [ubuntu2204_build, build-win]
327344
runs-on: ubuntu-latest
328345
permissions:
329346
contents: write
347+
id-token: write
330348
steps:
331349
- uses: actions/download-artifact@v4
332350
with:
333351
name: sycl_linux_default
334352
- uses: actions/download-artifact@v4
335353
with:
336354
name: sycl_windows_default
355+
- name: Sign with sigstore/cosign
356+
uses: sigstore/[email protected]
357+
with:
358+
inputs: sycl_linux.tar.gz sycl_windows.tar.gz
337359
- name: Compute tag
338360
id: tag
339361
run: |
@@ -349,6 +371,8 @@ jobs:
349371
files: |
350372
sycl_linux.tar.gz
351373
sycl_windows.tar.gz
374+
sycl_linux.tar.gz.sigstore.json
375+
sycl_windows.tar.gz.sigstore.json
352376
tag_name: nightly-${{ steps.tag.outputs.TAG }}
353377
name: DPC++ daily ${{ steps.tag.outputs.TAG }}
354378
prerelease: true

buildbot/configure.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def do_configure(args, passthrough_args):
8282
if libclc_enabled:
8383
llvm_enable_projects += ";libclc"
8484

85+
# DeviceRTL uses -fuse-ld=lld, so enable lld.
86+
if args.offload:
87+
llvm_enable_projects += ";lld"
88+
sycl_enabled_backends.append("offload")
89+
8590
if args.cuda:
8691
llvm_targets_to_build += ";NVPTX"
8792
libclc_targets_to_build = libclc_nvidia_target_names
@@ -210,6 +215,12 @@ def do_configure(args, passthrough_args):
210215
"-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB={}".format(sycl_preview_lib),
211216
"-DBUG_REPORT_URL=https://github.com/intel/llvm/issues",
212217
]
218+
if args.offload:
219+
cmake_cmd.extend(
220+
[
221+
"-DUR_BUILD_ADAPTER_OFFLOAD=ON",
222+
]
223+
)
213224

214225
if libclc_enabled:
215226
cmake_cmd.extend(
@@ -340,6 +351,11 @@ def main():
340351
default="AMD",
341352
help="choose hardware platform for HIP backend",
342353
)
354+
parser.add_argument(
355+
"--offload",
356+
action="store_true",
357+
help="Enable UR liboffload adapter (experimental)",
358+
)
343359
parser.add_argument(
344360
"--level_zero_adapter_version",
345361
type=str,

clang/include/clang/Driver/Action.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class Action {
7676
OffloadUnbundlingJobClass,
7777
OffloadWrapperJobClass,
7878
OffloadPackagerJobClass,
79+
OffloadPackagerExtractJobClass,
7980
OffloadDepsJobClass,
8081
SPIRVTranslatorJobClass,
8182
SYCLPostLinkJobClass,
@@ -719,6 +720,17 @@ class OffloadPackagerJobAction : public JobAction {
719720
}
720721
};
721722

723+
class OffloadPackagerExtractJobAction : public JobAction {
724+
void anchor() override;
725+
726+
public:
727+
OffloadPackagerExtractJobAction(ActionList &Inputs, types::ID Type);
728+
729+
static bool classof(const Action *A) {
730+
return A->getKind() == OffloadPackagerExtractJobClass;
731+
}
732+
};
733+
722734
class OffloadDepsJobAction final : public JobAction {
723735
void anchor() override;
724736

clang/include/clang/Driver/Driver.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,9 @@ bool isObjectFile(std::string FileName);
990990
/// \return True if the filename has a static archive/lib extension.
991991
bool isStaticArchiveFile(const StringRef &FileName);
992992

993+
/// \return True if the filename is an Offload Binary file.
994+
bool isOffloadBinaryFile(const StringRef &FileName);
995+
993996
/// \return True if the argument combination will end up generating remarks.
994997
bool willEmitRemarks(const llvm::opt::ArgList &Args);
995998

clang/include/clang/Driver/ToolChain.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class ToolChain {
166166
mutable std::unique_ptr<Tool> OffloadBundler;
167167
mutable std::unique_ptr<Tool> OffloadWrapper;
168168
mutable std::unique_ptr<Tool> OffloadPackager;
169+
mutable std::unique_ptr<Tool> OffloadPackagerExtract;
169170
mutable std::unique_ptr<Tool> OffloadDeps;
170171
mutable std::unique_ptr<Tool> SPIRVTranslator;
171172
mutable std::unique_ptr<Tool> SYCLPostLink;
@@ -185,6 +186,7 @@ class ToolChain {
185186
Tool *getOffloadBundler() const;
186187
Tool *getOffloadWrapper() const;
187188
Tool *getOffloadPackager() const;
189+
Tool *getOffloadPackagerExtract() const;
188190
Tool *getOffloadDeps() const;
189191
Tool *getSPIRVTranslator() const;
190192
Tool *getSYCLPostLink() const;

clang/lib/Driver/Action.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ const char *Action::getClassName(ActionClass AC) {
4646
return "clang-offload-wrapper";
4747
case OffloadPackagerJobClass:
4848
return "clang-offload-packager";
49+
case OffloadPackagerExtractJobClass:
50+
return "clang-offload-packager-extract";
4951
case OffloadDepsJobClass:
5052
return "clang-offload-deps";
5153
case SPIRVTranslatorJobClass:
@@ -86,6 +88,15 @@ void Action::propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch,
8688
// Deps job uses the host kinds.
8789
if (Kind == OffloadDepsJobClass)
8890
return;
91+
// Packaging actions can use host kinds for preprocessing. When packaging
92+
// preprocessed files, these packaged files will contain both host and device
93+
// files, where the host side does not have any device info to propagate.
94+
bool hasPreprocessJob =
95+
std::any_of(Inputs.begin(), Inputs.end(), [](const Action *A) {
96+
return A->getKind() == PreprocessJobClass;
97+
});
98+
if (Kind == OffloadPackagerJobClass && hasPreprocessJob)
99+
return;
89100

90101
assert((OffloadingDeviceKind == OKind || OffloadingDeviceKind == OFK_None) &&
91102
"Setting device kind to a different device??");
@@ -485,6 +496,12 @@ OffloadPackagerJobAction::OffloadPackagerJobAction(ActionList &Inputs,
485496
types::ID Type)
486497
: JobAction(OffloadPackagerJobClass, Inputs, Type) {}
487498

499+
void OffloadPackagerExtractJobAction::anchor() {}
500+
501+
OffloadPackagerExtractJobAction::OffloadPackagerExtractJobAction(
502+
ActionList &Inputs, types::ID Type)
503+
: JobAction(OffloadPackagerExtractJobClass, Inputs, Type) {}
504+
488505
void OffloadDepsJobAction::anchor() {}
489506

490507
OffloadDepsJobAction::OffloadDepsJobAction(

0 commit comments

Comments
 (0)