Skip to content

Commit 8437b89

Browse files
committed
Merge branch 'sycl' of https://github.com/intel/llvm into unify-benchmark-ci
2 parents 1dad513 + 9ab27f1 commit 8437b89

File tree

182 files changed

+4280
-586
lines changed

Some content is hidden

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

182 files changed

+4280
-586
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ devops/ @intel/dpcpp-devops-reviewers
128128
# dev-igc driver update
129129
devops/dependencies-igc-dev.json @intel/sycl-matrix-reviewers @intel/dpcpp-esimd-reviewers @intel/dpcpp-devops-reviewers
130130

131+
# Benchmarking scripts
132+
devops/scripts/benchmarks/ @intel/llvm-reviewers-benchmarking
133+
131134
# Kernel fusion JIT compiler
132135
sycl-jit/ @intel/dpcpp-kernel-fusion-reviewers
133136
sycl/doc/design/KernelFusionJIT.md @intel/dpcpp-kernel-fusion-reviewers

.github/workflows/sycl-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ jobs:
257257
runner: '["Windows", "build-e2e"]'
258258
cts_testing_mode: 'build-only'
259259
tests_selector: cts
260-
ref: ${{ github.sha }}
260+
repo_ref: ${{ github.sha }}
261261
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
262262
sycl_cts_artifact: sycl_cts_bin_win
263263

@@ -278,7 +278,7 @@ jobs:
278278
cts_testing_mode: 'run-only'
279279
target_devices: ${{ matrix.target_devices }}
280280
tests_selector: cts
281-
ref: ${{ github.sha }}
281+
repo_ref: ${{ github.sha }}
282282
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
283283
sycl_cts_artifact: sycl_cts_bin_win
284284

.github/workflows/sycl-rel-nightly.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222
with:
23-
ref: sycl-rel-6_0_0
23+
ref: sycl-rel-6_1_0
2424
- run: git show --quiet | tee -a $GITHUB_STEP_SUMMARY
2525

2626
- id: is_new_commit
@@ -40,7 +40,7 @@ jobs:
4040
build_artifact_suffix: default
4141
build_configure_extra_args: '--hip --cuda'
4242
build_image: ghcr.io/intel/llvm/ubuntu2204_build:latest
43-
build_ref: sycl-rel-6_0_0
43+
build_ref: sycl-rel-6_1_0
4444

4545
# We upload the build for people to download/use, override its name and
4646
# prefer widespread gzip compression.
@@ -89,7 +89,7 @@ jobs:
8989
tests_selector: ${{ matrix.tests_selector }}
9090
extra_lit_opts: ${{ matrix.extra_lit_opts }}
9191
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
92-
repo_ref: sycl-rel-6_0_0
92+
repo_ref: sycl-rel-6_1_0
9393
devops_ref: sycl
9494
sycl_toolchain_artifact: sycl_linux_default
9595
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
@@ -100,7 +100,7 @@ jobs:
100100
if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }}
101101
uses: ./.github/workflows/sycl-windows-build.yml
102102
with:
103-
ref: sycl-rel-6_0_0
103+
ref: sycl-rel-6_1_0
104104

105105
# We upload both Linux/Windows build via Github's "Releases"
106106
# functionality, make sure Linux/Windows names follow the same pattern.
@@ -119,7 +119,7 @@ jobs:
119119
runner: '["Windows","gen12"]'
120120
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
121121
extra_lit_opts: --param gpu-intel-gen12=True
122-
ref: sycl-rel-6_0_0
122+
repo_ref: sycl-rel-6_1_0
123123
devops_ref: sycl
124124

125125
cuda-aws-start:
@@ -129,7 +129,7 @@ jobs:
129129
secrets: inherit
130130
with:
131131
mode: start
132-
ref: sycl-rel-6_0_0
132+
ref: sycl-rel-6_1_0
133133

134134
cuda-run-tests:
135135
needs: [ubuntu2204_build, cuda-aws-start]
@@ -141,7 +141,7 @@ jobs:
141141
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
142142
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
143143
target_devices: cuda:gpu
144-
repo_ref: sycl-rel-6_0_0
144+
repo_ref: sycl-rel-6_1_0
145145
devops_ref: sycl
146146

147147
sycl_toolchain_artifact: sycl_linux_default
@@ -155,7 +155,7 @@ jobs:
155155
secrets: inherit
156156
with:
157157
mode: stop
158-
ref: sycl-rel-6_0_0
158+
ref: sycl-rel-6_1_0
159159

160160
build-sycl-cts:
161161
needs: ubuntu2204_build
@@ -167,11 +167,13 @@ jobs:
167167
cts_testing_mode: 'build-only'
168168
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
169169
tests_selector: cts
170-
repo_ref: sycl-rel-6_0_0
170+
repo_ref: sycl-rel-6_1_0
171171
devops_ref: sycl
172+
tests_ref: ead7474b9cb2189ce48025550912ccad5a72bd30
172173
sycl_toolchain_artifact: sycl_linux_default
173174
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
174175
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
176+
sycl_cts_artifact: sycl_cts_bin_linux
175177

176178
run-sycl-cts:
177179
needs: [ubuntu2204_build, build-sycl-cts]
@@ -202,4 +204,4 @@ jobs:
202204
sycl_toolchain_artifact: sycl_linux_default
203205
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
204206
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
205-
sycl_cts_artifact: sycl_cts_bin
207+
sycl_cts_artifact: sycl_cts_bin_linux

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
name:
77
type: string
88
required: True
9+
910
runner:
1011
type: string
1112
required: True
@@ -27,19 +28,17 @@ on:
2728
Extra options to be added to LIT_OPTS.
2829
type: string
2930
default: ''
30-
ref:
31+
32+
repo_ref:
3133
type: string
3234
required: False
35+
description: |
36+
Commit SHA or branch to checkout the intel/llvm repo.
3337
devops_ref:
3438
type: string
3539
required: False
3640
description: |
37-
By default we checkout the devops directory from "inputs.ref" branch.
38-
devops_ref may be specified to checkout the devops dir from different
39-
branch.
40-
Note: it doesn't affect ./devops/actions/run-tests/* as these actions
41-
call checkout again and therefore override the devops directory, so
42-
configs/dependecies from input.ref are used.
41+
Commit SHA or branch to checkout the devops directory.
4342
tests_ref:
4443
type: string
4544
required: False
@@ -104,7 +103,7 @@ jobs:
104103
with:
105104
sparse-checkout: |
106105
devops/actions
107-
ref: ${{ inputs.devops_ref|| inputs.ref || github.sha }}
106+
ref: ${{ inputs.devops_ref|| inputs.repo_ref || github.sha }}
108107
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
109108
with:
110109
arch: amd64
@@ -122,7 +121,7 @@ jobs:
122121
if: inputs.tests_selector == 'e2e'
123122
with:
124123
path: llvm
125-
ref: ${{ inputs.ref || github.sha }}
124+
ref: ${{ inputs.repo_ref || github.sha }}
126125
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
127126
- name: Download compiler toolchain
128127
uses: actions/download-artifact@v4

clang/include/clang/Basic/LangOptions.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ LANGOPT(
318318
"SYCL compiler assumes value fits within MAX_INT for member function of "
319319
"get/operator[], get_id/operator[] and get_global_id/get_global_linear_id "
320320
"in SYCL class id, iterm and nd_iterm")
321+
LANGOPT(SYCLCUDACompat, 1, 0,
322+
"Enable CUDA definitions and implicit includes when building for the "
323+
"NVPTX backend. This mode can help SYCL program to run using the CUDA "
324+
"infrastructure on Nvidia's platforms. ")
321325
ENUM_LANGOPT(SYCLRangeRounding, SYCLRangeRoundingPreference, 2,
322326
SYCLRangeRoundingPreference::On,
323327
"Preference for SYCL parallel_for range rounding")

clang/include/clang/Driver/Options.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7031,6 +7031,13 @@ defm sycl_decompose_functor
70317031
NegFlag<SetFalse, [], [ClangOption, CLOption], "Do not">,
70327032
BothFlags<[], [ClangOption, CLOption, CC1Option],
70337033
" decompose SYCL functor if possible (experimental, CUDA only)">>;
7034+
defm sycl_cuda_compat
7035+
: BoolFOption<"sycl-cuda-compatibility", LangOpts<"SYCLCUDACompat">, DefaultFalse,
7036+
PosFlag<SetTrue, [], [ClangOption, CLOption, CC1Option], "Enable CUDA compatibility mode (experimental). "
7037+
"Enable the use of CUDA device code with SYCL device code. "
7038+
"Under this mode, a SYCL device function can call a CUDA device function (but not the other way around). "
7039+
"This implies the definition of CUDA macros and the inclusion of implicit header files.">,
7040+
NegFlag<SetFalse, [], [ClangOption, CLOption, CC1Option], "Disable CUDA compatibility mode.">>;
70347041
def flink_huge_device_code : Flag<["-"], "flink-huge-device-code">,
70357042
HelpText<"Generate and use a custom linker script for huge device code "
70367043
"sections">;

clang/include/clang/Sema/SemaBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class SemaBase {
110110
CudaAll = CudaDevice | CudaHost,
111111
/// SYCL specific diagnostic.
112112
Sycl = 1 << 4,
113+
SyclCudaCompat = Sycl | CudaAll,
113114
/// ESIMD specific diagnostic.
114115
Esimd = 1 << 5,
115116
/// A flag representing 'all'. This can be used to avoid the check

clang/include/clang/Sema/SemaCUDA.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ class SemaCUDA : public SemaBase {
157157

158158
// CUDA function call preference. Must be ordered numerically from
159159
// worst to best.
160+
// Note: in SYCL-CUDA compatibility mode: Native, SameSide and HostDevice
161+
// doesn't follow the naming, only the ranking system (e.g. 1st, 2nd or 3rd
162+
// choice). See table near IdentifyPreference.
160163
enum CUDAFunctionPreference {
161164
CFP_Never, // Invalid caller/callee combination.
162165
CFP_WrongSide, // Calls from host-device to host or device

clang/lib/Basic/LangOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void LangOptions::setLangDefaults(LangOptions &Opts, Language Lang,
183183
}
184184

185185
Opts.HIP = Lang == Language::HIP;
186-
Opts.CUDA = Lang == Language::CUDA || Opts.HIP;
186+
Opts.CUDA = Lang == Language::CUDA || Opts.HIP || Opts.SYCLCUDACompat;
187187
if (Opts.HIP) {
188188
// HIP toolchain does not support 'Fast' FPOpFusion in backends since it
189189
// fuses multiplication/addition instructions without contract flag from

clang/lib/Basic/Targets/NVPTX.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,13 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts,
294294
llvm_unreachable("unhandled OffloadArch");
295295
}();
296296

297-
if (Opts.SYCLIsDevice) {
297+
if (Opts.SYCLIsDevice)
298298
Builder.defineMacro("__SYCL_CUDA_ARCH__", CUDAArchCode);
299-
} else {
299+
// Don't define __CUDA_ARCH__ if in SYCL device mode unless we are in
300+
// SYCL-CUDA compatibility mode.
301+
// For all other cases, define the macro.
302+
if (!Opts.SYCLIsDevice || Opts.SYCLCUDACompat)
300303
Builder.defineMacro("__CUDA_ARCH__", CUDAArchCode);
301-
}
302304
if (GPU == OffloadArch::SM_90a)
303305
Builder.defineMacro("__CUDA_ARCH_FEAT_SM90_ALL", "1");
304306
if (GPU == OffloadArch::SM_100a)

0 commit comments

Comments
 (0)