Skip to content

Commit 68671fa

Browse files
Merge remote-tracking branch 'origin/sycl' into HEAD
2 parents b9335e2 + a03dc0d commit 68671fa

File tree

311 files changed

+6338
-2462
lines changed

Some content is hidden

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

311 files changed

+6338
-2462
lines changed

.github/workflows/sycl-docs.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,21 @@ on:
1010
- '.github/workflows/sycl-docs.yml'
1111
- 'clang/docs/**'
1212
- 'sycl/doc/**'
13+
push:
14+
branches:
15+
- sycl
16+
paths:
17+
- '.github/workflows/sycl-docs.yml'
18+
- 'clang/docs/**'
19+
- 'sycl/doc/**'
1320

14-
permissions: read-all
21+
permissions:
22+
contents: read
23+
pages: write
24+
id-token: write
1525

1626
jobs:
1727
build:
18-
permissions:
19-
contents: write # for Git to git push
2028
runs-on: ubuntu-latest
2129
if: github.repository == 'intel/llvm'
2230
steps:
@@ -35,24 +43,18 @@ jobs:
3543
-s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs
3644
cmake --build . --target docs-sycl-html
3745
cmake --build . --target docs-clang-html
38-
- name: Deploy
39-
if: ${{ github.event_name == 'schedule' }}
40-
env:
41-
SSH_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
42-
run: |
43-
mkdir -p ~/.ssh
44-
echo "$SSH_KEY" > ~/.ssh/id_rsa
45-
chmod 600 ~/.ssh/id_rsa
46-
eval "$(ssh-agent -s)"
47-
ssh-add -k ~/.ssh/id_rsa
48-
git clone [email protected]:intel/llvm-docs.git docs
49-
cd $GITHUB_WORKSPACE/docs
50-
git rm -rf .
46+
# Copy the generated docs to a separate directory for uploading.
47+
mkdir $GITHUB_WORKSPACE/install_docs
48+
cd $GITHUB_WORKSPACE/install_docs
49+
mkdir clang
50+
mv $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* .
51+
mv $GITHUB_WORKSPACE/build/tools/clang/docs/html/* clang/
5152
touch .nojekyll
52-
yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* .
53-
mv $GITHUB_WORKSPACE/build/tools/clang/docs/html clang/
54-
git config --global user.name "iclsrc"
55-
git config --global user.email "[email protected]"
56-
git add .
57-
git diff-index --quiet HEAD || git commit --amend -m "Update docs" -s
58-
git push -f
53+
# Upload the generated docs as an artifact and deploy to GitHub Pages.
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v3
56+
with:
57+
path: ./install_docs
58+
- name: Deploy to GitHub Pages
59+
if: ${{ github.event_name == 'push' }}
60+
uses: actions/deploy-pages@v4

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ jobs:
8383
- name: Intel
8484
runner: '["Linux", "gen12"]'
8585
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
86-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
86+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
8787
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
8888
reset_intel_gpu: true
8989
extra_lit_opts: --param gpu-intel-gen12=True
9090
- name: E2E tests on Intel Arc A-Series Graphics
9191
runner: '["Linux", "arc"]'
9292
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
93-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
93+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
9494
target_devices: level_zero:gpu;opencl:gpu
9595
reset_intel_gpu: true
9696
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
9797
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
9898
- name: E2E tests with dev igc on Intel Arc A-Series Graphics
9999
runner: '["Linux", "arc"]'
100100
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:devigc
101-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
101+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
102102
target_devices: level_zero:gpu;opencl:gpu
103103
reset_intel_gpu: true
104104
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
@@ -116,8 +116,16 @@ jobs:
116116
extra_lit_opts: ${{ matrix.extra_lit_opts }}
117117
env: ${{ matrix.env || '{}' }}
118118

119-
install_igc_driver: ${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}
120-
install_dev_igc_driver: ${{ matrix.use_igc_dev && contains(needs.detect_changes.outputs.filters, 'devigccfg') || 'false' }}
119+
# Do not install drivers on AMD and CUDA runners.
120+
install_igc_driver: >-
121+
${{ !contains(matrix.target_devices, 'ext_oneapi_cuda') &&
122+
!contains(matrix.target_devices, 'ext_oneapi_hip') &&
123+
contains(needs.detect_changes.outputs.filters, 'drivers') }}
124+
install_dev_igc_driver: >-
125+
${{ !contains(matrix.target_devices, 'ext_oneapi_cuda') &&
126+
!contains(matrix.target_devices, 'ext_oneapi_hip') &&
127+
matrix.use_igc_dev && contains(needs.detect_changes.outputs.filters, 'devigccfg') ||
128+
'false' }}
121129
# Run only if the PR does not have the 'ci-no-devigc' label.
122130
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
123131

.github/workflows/sycl-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Intel L0 GPU
5454
runner: '["Linux", "gen12"]'
5555
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
56-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
56+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
5757
target_devices: level_zero:gpu
5858
reset_intel_gpu: true
5959
tests_selector: e2e
@@ -62,7 +62,7 @@ jobs:
6262
- name: Intel OCL GPU
6363
runner: '["Linux", "gen12"]'
6464
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
65-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
65+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
6666
target_devices: opencl:gpu
6767
reset_intel_gpu: true
6868
tests_selector: e2e

.github/workflows/sycl-post-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
name: ${{ matrix.name }}
8888
runner: ${{ matrix. runner }}
8989
image: ${{ matrix.image || 'ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest' }}
90-
image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN' }}
90+
image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN' }}
9191
target_devices: ${{ matrix.target_devices || 'level_zero:gpu' }}
9292
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
9393

.github/workflows/sycl-windows-run-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ jobs:
8686
# Run E2E tests.
8787
export LIT_OPTS="-v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests ${{ inputs.extra_lit_opts }}"
8888
cmake --build build-e2e --target check-sycl-e2e
89+
- name: Detect hung tests
90+
shell: powershell
91+
run: |
92+
$exitCode = 0
93+
$hungTests = Get-Process | Where-Object { ($_.Path -match "llvm\\install") -or ($_.Path -match "llvm\\build-e2e") }
94+
$hungTests | Foreach-Object {
95+
$exitCode = 1
96+
echo "Test $($_.Path) hung!"
97+
Stop-Process -Force $_
98+
}
99+
exit $exitCode
89100
- name: Cleanup
90101
shell: cmd
91102
if: always()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ source project. One of the examples is
4242
Features parity between this project and downstream projects is not guaranteed.
4343

4444
Project documentation is available at:
45-
[DPC++ Documentation](https://intel.github.io/llvm-docs/).
45+
[DPC++ Documentation](https://intel.github.io/llvm/).
4646

4747
### How to use DPC++
4848

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12433,6 +12433,12 @@ def err_sycl_kernel_incorrectly_named : Error<
1243312433
"'-fsycl-unnamed-lambda' to enable unnamed kernel lambdas"
1243412434
"}0">;
1243512435

12436+
// SYCL free function kernels extension.
12437+
def note_free_function_kernel_param_type_not_fwd_declarable : Note<
12438+
"%0 is not forward declarable">;
12439+
def note_free_function_kernel_param_type_not_supported : Note<
12440+
"%0 is not yet supported as a free function kernel parameter">;
12441+
1243612442
def err_sycl_kernel_not_function_object
1243712443
: Error<"kernel parameter must be a lambda or function object">;
1243812444
def err_sycl_restrict : Error<

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ LANGOPT(SYCLAllowFuncPtr , 1, 0, "Allow function pointers in SYCL device code")
307307
LANGOPT(SYCLStdLayoutKernelParams, 1, 0, "Enable standard layout requirement for SYCL kernel parameters")
308308
LANGOPT(SYCLUnnamedLambda , 1, 0, "Allow unnamed lambda SYCL kernels")
309309
LANGOPT(SYCLForceInlineKernelLambda , 1, 0, "Force inline SYCL kernel lambdas in entry point")
310-
LANGOPT(SYCLAllowAllFeaturesInConstexpr, 1, 0, "Allow all C++ features in SYCL device code in manifestly constant-evaluated expressions")
311310
LANGOPT(SYCLESIMDForceStatelessMem, 1, 0, "Make accessors use USM memory in ESIMD kernels")
312311
LANGOPT(SYCLESIMDBuildHostCode, 1, 1, "Build the host implementation of ESIMD functions")
313312
ENUM_LANGOPT(SYCLVersion , SYCLMajorVersion, 2, SYCL_None, "Version of the SYCL standard used")

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8628,11 +8628,6 @@ def fsycl_is_native_cpu : Flag<["-"], "fsycl-is-native-cpu">,
86288628
HelpText<"Perform device compilation for Native CPU.">,
86298629
Visibility<[CC1Option]>,
86308630
MarshallingInfoFlag<LangOpts<"SYCLIsNativeCPU">>;
8631-
defm sycl_allow_all_features_in_constexpr
8632-
: BoolFOption<
8633-
"sycl-allow-all-features-in-constexpr", LangOpts<"SYCLAllowAllFeaturesInConstexpr">,
8634-
DefaultFalse,
8635-
PosFlag<SetTrue, [], [CC1Option], "Allow all C++ features in SYCL device code in manifestly constant-evaluated expressions">, NegFlag<SetFalse>>;
86368631

86378632
} // let Visibility = [CC1Option]
86388633

clang/lib/Driver/Driver.cpp

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6350,7 +6350,7 @@ class OffloadingActionBuilder final {
63506350
if (GpuInitHasErrors)
63516351
return true;
63526352

6353-
int I = 0;
6353+
int GenIndex = 0;
63546354
// Fill SYCLTargetInfoList
63556355
for (auto &TT : SYCLTripleList) {
63566356
auto TCIt = llvm::find_if(
@@ -6363,10 +6363,21 @@ class OffloadingActionBuilder final {
63636363
// is the target device.
63646364
if (TT.isSPIR() &&
63656365
TT.getSubArch() == llvm::Triple::SPIRSubArch_gen) {
6366-
StringRef Device(GpuArchList[I].second);
6366+
// Multiple spir64_gen targets are allowed to be used via the
6367+
// -fsycl-targets=spir64_gen and -fsycl-targets=intel_gpu_*
6368+
// specifiers. Using an index through the known GpuArchList
6369+
// values, increment through them accordingly to allow for
6370+
// the multiple settings as well as preventing re-use.
6371+
while (TT != GpuArchList[GenIndex].first &&
6372+
GenIndex < GpuArchList.size())
6373+
++GenIndex;
6374+
if (GpuArchList[GenIndex].first != TT)
6375+
// No match.
6376+
continue;
6377+
StringRef Device(GpuArchList[GenIndex].second);
63676378
SYCLTargetInfoList.emplace_back(
63686379
*TCIt, Device.empty() ? nullptr : Device.data());
6369-
++I;
6380+
++GenIndex;
63706381
continue;
63716382
}
63726383
SYCLTargetInfoList.emplace_back(*TCIt, nullptr);
@@ -6380,7 +6391,6 @@ class OffloadingActionBuilder final {
63806391
}
63816392
assert(OffloadArch && "Failed to find matching arch.");
63826393
SYCLTargetInfoList.emplace_back(*TCIt, OffloadArch);
6383-
++I;
63846394
}
63856395
}
63866396
}
@@ -6776,13 +6786,10 @@ class OffloadingActionBuilder final {
67766786
// Do not use unbundler if the Host does not depend on device action.
67776787
// Now that we have unbundled the object, when doing -fsycl-link we
67786788
// want to continue the host link with the input object.
6779-
// For unbundling of an FPGA AOCX binary, we want to link with the original
6780-
// FPGA device archive.
67816789
if ((OffloadKind == Action::OFK_None && CanUseBundler) ||
67826790
(Args.hasArg(options::OPT_fsycl_link_EQ) && !HasFPGATarget) ||
67836791
(HasFPGATarget && ((Args.hasArg(options::OPT_fsycl_link_EQ) &&
6784-
HostAction->getType() == types::TY_Object) ||
6785-
HostAction->getType() == types::TY_FPGA_AOCX)))
6792+
HostAction->getType() == types::TY_Object))))
67866793
if (auto *UA = dyn_cast<OffloadUnbundlingJobAction>(HostAction))
67876794
HostAction = UA->getInputs().back();
67886795

@@ -7433,14 +7440,12 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
74337440

74347441
// For an FPGA archive, we add the unbundling step above to take care of
74357442
// the device side, but also unbundle here to extract the host side
7436-
bool EarlyLink = false;
7437-
if (const Arg *A = Args.getLastArg(options::OPT_fsycl_link_EQ))
7438-
EarlyLink = A->getValue() == StringRef("early");
74397443
for (auto &LI : LinkerInputs) {
74407444
Action *UnbundlerInput = nullptr;
74417445
auto wrapObject = [&] {
7442-
if (EarlyLink && Args.hasArg(options::OPT_fintelfpga)) {
7443-
// Only wrap the object with -fsycl-link=early
7446+
if (Args.hasArg(options::OPT_fsycl_link_EQ) &&
7447+
Args.hasArg(options::OPT_fintelfpga)) {
7448+
// Wrap the object when creating an FPGA AOCX or AOCR binary.
74447449
auto *BC = C.MakeAction<OffloadWrapperJobAction>(LI, types::TY_LLVM_BC);
74457450
auto *ASM = C.MakeAction<BackendJobAction>(BC, types::TY_PP_Asm);
74467451
auto *OBJ = C.MakeAction<AssembleJobAction>(ASM, types::TY_Object);

0 commit comments

Comments
 (0)