Skip to content

Commit 50b2990

Browse files
Merge remote-tracking branch 'origin/sycl' into HEAD
2 parents a863949 + f0b7493 commit 50b2990

File tree

17 files changed

+422
-43
lines changed

17 files changed

+422
-43
lines changed

.github/workflows/sycl-aws.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
description: "JSON string with array of objects with aws-type, runs-on, aws-ami, aws-spot, aws-disk, aws-timebomb, one-job properties"
1616
type: string
1717
default: '[{"runs-on":"aws_cuda-${{ github.run_id }}-${{ github.run_attempt }}","aws-ami":"ami-01cb0573cb039ab24","aws-type":["g5.2xlarge","g5.4xlarge"],"aws-disk":"/dev/sda1:64","aws-spot":"false"}]'
18+
ref:
19+
type: string
20+
required: false
1821

1922
jobs:
2023
aws:
@@ -24,6 +27,7 @@ jobs:
2427
- uses: actions/checkout@v4
2528
with:
2629
sparse-checkout: devops/actions/aws-ec2
30+
ref: ${{ inputs.ref || github.sha }}
2731
- run: npm install ./devops/actions/aws-ec2
2832
- uses: ./devops/actions/aws-ec2
2933
with:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ on:
5050
description: 'Artifacts retention period'
5151
type: string
5252
default: 3
53+
ref:
54+
type: string
55+
required: false
5356

5457
outputs:
5558
build_conclusion:
@@ -143,6 +146,7 @@ jobs:
143146
with:
144147
sparse-checkout: |
145148
devops/actions
149+
ref: ${{ inputs.ref || github.sha }}
146150
# Cleanup will be run after all actions are completed.
147151
- name: Register cleanup after job is finished
148152
uses: ./devops/actions/cleanup
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: SYCL Release Branch Nightly
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 3 * * *'
7+
8+
permissions: read-all
9+
10+
env:
11+
# NOTE: so that GitHub Actions can trigger the scheduled workflow run - the
12+
# workflow file should be on the default branch. Therefore every job should
13+
# checkout the release branch.
14+
SYCL_REL_BRANCH: "draft-sycl-rel-6_0_0"
15+
16+
jobs:
17+
# To avoid unnecessary scheduled runs this job checks if there are new commits
18+
# since the last run. More precisely, it checks if the last commit is older
19+
# than 24h. That means the previous Nightly already tested this commit.
20+
check_for_new_commits:
21+
runs-on: ubuntu-latest
22+
name: Check for new commits
23+
outputs:
24+
is_new_commit: ${{ steps.is_new_commit.outputs.is_new_commit }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: ${{ env.SYCL_REL_BRANCH }}
29+
- run: git show --quiet | tee -a $GITHUB_STEP_SUMMARY
30+
31+
- id: is_new_commit
32+
if: ${{ github.event_name == 'schedule' }}
33+
run: |
34+
if [ -z "$(git rev-list --after="24 hours" HEAD)" ]; then
35+
echo "is_new_commit=false" >> $GITHUB_OUTPUT
36+
fi
37+
38+
ubuntu2204_build:
39+
needs: [check_for_new_commits]
40+
if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }}
41+
uses: ./.github/workflows/sycl-linux-build.yml
42+
secrets: inherit
43+
with:
44+
build_cache_root: "/__w/"
45+
build_artifact_suffix: v6
46+
build_configure_extra_args: '--hip --cuda'
47+
merge_ref: ''
48+
ref: ${{ env.SYCL_REL_BRANCH }}
49+
50+
# We upload the build for people to download/use, override its name and
51+
# prefer widespread gzip compression.
52+
artifact_archive_name: sycl_linux.tar.gz
53+
54+
ubuntu2204_test:
55+
needs: [ubuntu2204_build]
56+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
include:
61+
- name: AMD/HIP
62+
runner: '["Linux", "amdgpu"]'
63+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
64+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
65+
target_devices: ext_oneapi_hip:gpu
66+
tests_selector: e2e
67+
68+
- name: Intel L0 GPU
69+
runner: '["Linux", "gen12"]'
70+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
71+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
72+
target_devices: level_zero:gpu
73+
reset_intel_gpu: true
74+
tests_selector: e2e
75+
extra_lit_opts: --param gpu-intel-gen12=True
76+
77+
- name: Intel OCL GPU
78+
runner: '["Linux", "gen12"]'
79+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
80+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
81+
target_devices: opencl:gpu
82+
reset_intel_gpu: true
83+
tests_selector: e2e
84+
extra_lit_opts: --param gpu-intel-gen12=True
85+
86+
- name: Intel OCL CPU
87+
runner: '["Linux", "gen12"]'
88+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
89+
image_options: -u 1001 --privileged --cap-add SYS_ADMIN
90+
target_devices: opencl:cpu
91+
tests_selector: e2e
92+
93+
- name: SYCL-CTS on OCL CPU
94+
runner: '["Linux", "gen12"]'
95+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
96+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
97+
target_devices: opencl:cpu
98+
tests_selector: cts
99+
100+
- name: SYCL-CTS on L0 gen12
101+
runner: '["Linux", "gen12"]'
102+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
103+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
104+
target_devices: level_zero:gpu
105+
tests_selector: cts
106+
uses: ./.github/workflows/sycl-linux-run-tests.yml
107+
with:
108+
name: ${{ matrix.name }}
109+
runner: ${{ matrix.runner }}
110+
image: ${{ matrix.image }}
111+
image_options: ${{ matrix.image_options }}
112+
target_devices: ${{ matrix.target_devices }}
113+
tests_selector: ${{ matrix.tests_selector }}
114+
extra_lit_opts: ${{ matrix.extra_lit_opts }}
115+
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
116+
ref: ${{ env.SYCL_REL_BRANCH }}
117+
merge_ref: ''
118+
sycl_toolchain_artifact: sycl_linux_default
119+
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
120+
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
121+
122+
build-win:
123+
needs: [check_for_new_commits]
124+
if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }}
125+
uses: ./.github/workflows/sycl-windows-build.yml
126+
with:
127+
# We upload both Linux/Windows build via Github's "Releases"
128+
# functionality, make sure Linux/Windows names follow the same pattern.
129+
artifact_archive_name: sycl_windows.tar.gz
130+
build_ref: ${{ env.SYCL_REL_BRANCH }}
131+
132+
e2e-win:
133+
needs: build-win
134+
# Continue if build was successful.
135+
if: |
136+
always()
137+
&& !cancelled()
138+
&& needs.build-win.outputs.build_conclusion == 'success'
139+
uses: ./.github/workflows/sycl-windows-run-tests.yml
140+
with:
141+
name: Intel GEN12 Graphics with Level Zero
142+
runner: '["Windows","gen12"]'
143+
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
144+
extra_lit_opts: --param gpu-intel-gen12=True
145+
ref: ${{ env.SYCL_REL_BRANCH }}
146+
147+
cuda-aws-start:
148+
needs: [ubuntu2204_build]
149+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
150+
uses: ./.github/workflows/sycl-aws.yml
151+
secrets: inherit
152+
with:
153+
mode: start
154+
ref: ${{ env.SYCL_REL_BRANCH }}
155+
156+
cuda-run-tests:
157+
needs: [ubuntu2204_build, cuda-aws-start]
158+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
159+
uses: ./.github/workflows/sycl-linux-run-tests.yml
160+
with:
161+
name: CUDA E2E
162+
runner: '["aws_cuda-${{ github.run_id }}-${{ github.run_attempt }}"]'
163+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
164+
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
165+
target_devices: ext_oneapi_cuda:gpu
166+
ref: ${{ env.SYCL_REL_BRANCH }}
167+
merge_ref: ''
168+
169+
sycl_toolchain_artifact: sycl_linux_default
170+
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
171+
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
172+
173+
cuda-aws-stop:
174+
needs: [cuda-aws-start, cuda-run-tests]
175+
if: always()
176+
uses: ./.github/workflows/sycl-aws.yml
177+
secrets: inherit
178+
with:
179+
mode: stop
180+
ref: ${{ env.SYCL_REL_BRANCH }}

clang/test/CodeGenSYCL/nvptx-short-ptr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Check that when we see the expected data layouts for NVPTX when we pass the
22
// -nvptx-short-ptr option.
3+
// REQUIRES: nvptx-registered-target
34

45
// RUN: %clang_cc1 -fsycl-is-device -disable-llvm-passes \
56
// RUN: -triple nvptx-nvidia-cuda -emit-llvm %s -o - \

clang/test/Driver/sycl-instrumentation-old-model.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,27 @@
2020
// CHECK-SPIRV-SAME: "{{.*}}libsycl-itt-stubs.bc"
2121
// CHECK-HOST-NOT: "-cc1"{{.*}} "-fsycl-is-host"{{.*}} "-fsycl-instrument-device-code"
2222

23-
// ITT annotations in device code are disabled by default. However, for SYCL offloading,
24-
// we still link ITT annotations libraries to ensure ABI compatibility with previous release.
25-
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=spir64 -### %s 2>&1 \
23+
// ITT annotations in device code are disabled by default. However, for SYCL
24+
// offloading, we still link ITT annotations libraries to ensure ABI
25+
// compatibility with previous release.
26+
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=spir64 -### \
27+
// RUN: --sysroot=%S/Inputs/SYCL %s 2>&1 \
2628
// RUN: | FileCheck -check-prefixes=CHECK-ITT-LINK-ONLY %s
27-
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -### %s 2>&1 \
28-
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
2929

3030
// CHECK-ITT-LINK-ONLY-NOT: "-fsycl-instrument-device-code"
3131
// CHECK-ITT-LINK-ONLY: llvm-link{{.*}} {{.*}}libsycl-itt-{{.*}}
3232

33-
// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fsycl-targets=spir64 -### %s 2>&1 \
33+
// Verify that ITT annotations are not pulled in for non-SPIR-V targets as
34+
// well as when device code instrumentation is explicitly turned off.
35+
// RUN: %clangxx -fsycl --no-offload-new-driver --sysroot=%S/Inputs/SYCL \
36+
// RUN: -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -### %s 2>&1 \
37+
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
38+
// RUN: %clangxx -fsycl --no-offload-new-driver --sysroot=%S/Inputs/SYCL \
39+
// RUN: -fno-sycl-instrument-device-code -fsycl-targets=spir64 -### %s 2>&1 \
3440
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
35-
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code -nocudalib -### %s 2>&1 \
41+
// RUN: %clangxx -fsycl --no-offload-new-driver --sysroot=%s/Inputs/SYCL \
42+
// RUN: -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code \
43+
// RUN: -nocudalib -### %s 2>&1 \
3644
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
3745

3846
// CHECK-NONPASSED-NOT: "-fsycl-instrument-device-code"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# commit 06f48f674445532d8c04be431474901b82c3c449
2-
# Merge: 098deca1f9f3 1b373f83c71e
1+
# commit b7047f6c36ec17b8560c2f1cd9ac9521715a9127
2+
# Merge: 73e5f3c6ff2d fcddf077c290
33
# Author: Martin Grant <[email protected]>
4-
# Date: Thu Dec 12 11:04:15 2024 +0000
5-
# Merge pull request #2356 from npmiller/hip-images
6-
# [HIP] Disable SYCL images by default
7-
set(UNIFIED_RUNTIME_TAG 06f48f674445532d8c04be431474901b82c3c449)
4+
# Date: Fri Dec 13 14:20:15 2024 +0000
5+
# Merge pull request #2454 from Bensuo/l0_cmd-buf_multi-device
6+
# Fix L0 command-buffer consumption of multi-device kernels
7+
set(UNIFIED_RUNTIME_TAG b7047f6c36ec17b8560c2f1cd9ac9521715a9127)

sycl/source/detail/helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ retrieveKernelBinary(const QueueImplPtr &Queue, const char *KernelName,
9494
DeviceImage = &detail::ProgramManager::getInstance().getDeviceImage(
9595
KernelName, Context, Device);
9696
Program = detail::ProgramManager::getInstance().createURProgram(
97-
*DeviceImage, Context, {Device});
97+
*DeviceImage, Context, {std::move(Device)});
9898
}
9999
return {DeviceImage, Program};
100100
}

sycl/source/detail/persistent_device_code_cache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ std::vector<std::vector<char>> PersistentDeviceCodeCache::getItemFromDisc(
320320
std::vector<std::vector<char>>
321321
PersistentDeviceCodeCache::getCompiledKernelFromDisc(
322322
const std::vector<device> &Devices, const std::string &BuildOptionsString,
323-
const std::string SourceStr) {
323+
const std::string &SourceStr) {
324324
assert(!Devices.empty());
325325
std::vector<std::vector<char>> Binaries(Devices.size());
326326
std::string FileNames;
@@ -518,7 +518,7 @@ std::string PersistentDeviceCodeCache::getCacheItemPath(
518518

519519
std::string PersistentDeviceCodeCache::getCompiledKernelItemPath(
520520
const device &Device, const std::string &BuildOptionsString,
521-
const std::string SourceString) {
521+
const std::string &SourceString) {
522522

523523
std::string cache_root{getRootDir()};
524524
if (cache_root.empty()) {

sycl/source/detail/persistent_device_code_cache.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class PersistentDeviceCodeCache {
170170
static std::string
171171
getCompiledKernelItemPath(const device &Device,
172172
const std::string &BuildOptionsString,
173-
const std::string SourceString);
173+
const std::string &SourceString);
174174

175175
/* Program binaries built for one or more devices are read from persistent
176176
* cache and returned in form of vector of programs. Each binary program is
@@ -185,7 +185,7 @@ class PersistentDeviceCodeCache {
185185
static std::vector<std::vector<char>>
186186
getCompiledKernelFromDisc(const std::vector<device> &Devices,
187187
const std::string &BuildOptionsString,
188-
const std::string SourceStr);
188+
const std::string &SourceStr);
189189

190190
/* Stores build program in persistent cache
191191
*/

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static ur_program_handle_t
7676
createBinaryProgram(const ContextImplPtr Context,
7777
const std::vector<device> &Devices,
7878
const uint8_t **Binaries, size_t *Lengths,
79-
const std::vector<ur_program_metadata_t> Metadata) {
79+
const std::vector<ur_program_metadata_t> &Metadata) {
8080
const AdapterPtr &Adapter = Context->getAdapter();
8181
ur_program_handle_t Program;
8282
std::vector<ur_device_handle_t> DeviceHandles;
@@ -230,7 +230,7 @@ ProgramManager::createURProgram(const RTDeviceBinaryImage &Img,
230230
"SPIR-V online compilation is not supported in this context");
231231

232232
// Get program metadata from properties
233-
auto ProgMetadata = Img.getProgramMetadataUR();
233+
const auto &ProgMetadata = Img.getProgramMetadataUR();
234234

235235
// Load the image
236236
const ContextImplPtr Ctx = getSyclObjImpl(Context);
@@ -990,7 +990,15 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(
990990
// emplace all subsets of the current set of devices into the cache.
991991
// Set of all devices is not included in the loop as it was already added
992992
// into the cache.
993-
for (int Mask = 1; Mask < (1 << URDevicesSet.size()) - 1; ++Mask) {
993+
int Mask = 1;
994+
if (URDevicesSet.size() > sizeof(Mask) * 8 - 1) {
995+
// Protection for the algorithm below. Although overflow is very unlikely
996+
// to be reached.
997+
throw sycl::exception(
998+
make_error_code(errc::runtime),
999+
"Unable to cache built program for more than 31 devices");
1000+
}
1001+
for (; Mask < (1 << URDevicesSet.size()) - 1; ++Mask) {
9941002
std::set<ur_device_handle_t> Subset;
9951003
int Index = 0;
9961004
for (auto It = URDevicesSet.begin(); It != URDevicesSet.end();
@@ -1124,7 +1132,7 @@ ProgramManager::getUrProgramFromUrKernel(ur_kernel_handle_t Kernel,
11241132

11251133
std::string
11261134
ProgramManager::getProgramBuildLog(const ur_program_handle_t &Program,
1127-
const ContextImplPtr Context) {
1135+
const ContextImplPtr &Context) {
11281136
size_t URDevicesSize = 0;
11291137
const AdapterPtr &Adapter = Context->getAdapter();
11301138
Adapter->call<UrApiKind::urProgramGetInfo>(Program, UR_PROGRAM_INFO_DEVICES,

0 commit comments

Comments
 (0)