Skip to content

Commit ef83061

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into private/asachkov/accessor-iterator
2 parents 47e6c46 + fee486e commit ef83061

File tree

203 files changed

+6696
-2681
lines changed

Some content is hidden

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

203 files changed

+6696
-2681
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ llvm/lib/SYCLLowerIR/CMakeLists.txt @intel/dpcpp-tools-reviewers @intel/dpcpp-es
6363
# invoke_simd
6464
sycl/include/sycl/ext/oneapi/experimental/invoke_simd.hpp @rolandschulz @kbobrovs
6565
sycl/include/std/experimental/simd.hpp @rolandschulz @kbobrovs
66+
llvm/lib/SYCLLowerIR/LowerInvokeSimd.cpp @kbobrovs @v-klochkov @rolandschulz
67+
llvm/include/llvm/SYCLLowerIR/LowerInvokeSimd.h @kbobrovs @v-klochkov @rolandschulz
6668

6769
# DevOps configs
6870
.github/workflows/ @intel/dpcpp-devops-reviewers

.github/workflows/sycl_gen_test_matrix.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
type: string
2020
required: true
2121
default: ""
22+
cts_config:
23+
type: string
24+
required: false
25+
default: ""
2226
uniq:
2327
description: Unique string to name dynamic runners in AWS
2428
type: string
@@ -33,6 +37,9 @@ on:
3337
lts_matrix:
3438
description: "Generated Matrix"
3539
value: ${{ jobs.test_matrix.outputs.lts_matrix }}
40+
cts_matrix:
41+
description: "Generated SYCL CTS Matrix"
42+
value: ${{ jobs.test_matrix.outputs.cts_matrix }}
3643
lts_aws_matrix:
3744
description: "Generated Matrix AWS subset"
3845
value: ${{ jobs.test_matrix.outputs.lts_aws_matrix }}
@@ -42,6 +49,7 @@ jobs:
4249
runs-on: ubuntu-latest
4350
outputs:
4451
lts_matrix: ${{ steps.work.outputs.lts_matrix }}
52+
cts_matrix: ${{ steps.work.outputs.cts_matrix }}
4553
lts_aws_matrix: ${{ steps.work.outputs.lts_aws_matrix }}
4654
steps:
4755
- name: Download scripts and configs

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ on:
5656
type: number
5757
required: false
5858
default: 4
59+
cts_matrix:
60+
type: string
61+
required: false
62+
default: ""
63+
cts_cmake_extra_args:
64+
type: string
65+
required: false
66+
default: ""
67+
cts_ref:
68+
type: string
69+
required: false
70+
default: 'SYCL-2020'
5971

6072
jobs:
6173
build:
@@ -230,6 +242,53 @@ jobs:
230242
check_sycl_all: ${{ matrix.check_sycl_all }}
231243
results_name_suffix: ${{ matrix.config }}_${{ inputs.build_artifact_suffix }}
232244
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
245+
246+
khronos_sycl_cts:
247+
needs: build
248+
if: ${{ inputs.cts_matrix != '' }}
249+
strategy:
250+
fail-fast: false
251+
max-parallel: ${{ inputs.max_parallel }}
252+
matrix:
253+
include: ${{ fromJSON(inputs.cts_matrix) }}
254+
name: ${{ matrix.name }}
255+
runs-on: ${{ matrix.runs-on }}
256+
env: ${{ matrix.env }}
257+
container:
258+
image: ${{ matrix.image }}
259+
options: ${{ matrix.container_options }}
260+
steps:
261+
- name: Reset GPU
262+
if: ${{ contains(matrix.config, 'gen9') }}
263+
run: |
264+
sudo mount -t debugfs none /sys/kernel/debug
265+
sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged'
266+
- run: cp -r /actions .
267+
- name: Register cleanup after job is finished
268+
uses: ./actions/cleanup
269+
- name: Install drivers
270+
if: env.compute_runtime_tag != ''
271+
run: |
272+
if [ -e /opt/install_drivers.sh ]; then
273+
# TODO pack this script into container
274+
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/scripts/get_release.py
275+
sudo mv get_release.py /opt/
276+
sudo -E /opt/install_drivers.sh --all
277+
fi
278+
# FIXME cached_checkout fails here, but works everywhere else
279+
# TODO: figure out if we remove this action
280+
- uses: actions/checkout@v2
281+
with:
282+
path: llvm
283+
# TODO should this action be packed into container as well?
284+
- uses: ./llvm/devops/actions/khronos_cts_test
285+
name: Run Khronos SYCL CTS
286+
with:
287+
test_ref: ${{ inputs.cts_ref }}
288+
sycl_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
289+
sycl_archive: llvm_sycl.tar.xz
290+
sycl_device_filter: ${{ matrix.sycl_device_filter }}
291+
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.cts_cmake_extra_args }}'
233292

234293
aws-stop:
235294
name: Stop AWS
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Reusable SYCL macOS build and test workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build_ref:
7+
type: string
8+
required: false
9+
build_cache_suffix:
10+
type: string
11+
required: false
12+
default: "default"
13+
build_cache_size:
14+
type: string
15+
required: false
16+
default: 2G
17+
build_configure_extra_args:
18+
type: string
19+
required: false
20+
default: ""
21+
build_artifact_suffix:
22+
type: string
23+
required: false
24+
default: "default"
25+
26+
jobs:
27+
build:
28+
name: Build
29+
runs-on: macos-12
30+
steps:
31+
- name: Install dependencies
32+
run: brew install ccache ninja
33+
- uses: actions/checkout@v3
34+
with:
35+
ref: ${{ inputs.build_ref }}
36+
path: src
37+
- uses: actions/cache@v3
38+
with:
39+
path: build_cache_${{ inputs.build_cache_suffix }}
40+
key: sycl-${{ runner.os }}-${{ inputs.build_cache_suffix }}-${{ github.sha }}
41+
restore-keys: sycl-${{ runner.os }}-${{ inputs.build_cache_suffix }}-
42+
- name: Configure
43+
env:
44+
CACHE_SUFFIX: ${{ inputs.build_cache_suffix }}
45+
CACHE_SIZE: ${{ inputs.build_cache_size }}
46+
ARGS: ${{ inputs.build_configure_extra_args }}
47+
run: |
48+
mkdir -p $GITHUB_WORKSPACE/build_cache_$CACHE_SUFFIX
49+
mkdir -p $GITHUB_WORKSPACE/build
50+
cd $GITHUB_WORKSPACE/build
51+
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
52+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
53+
--ci-defaults $ARGS \
54+
--cmake-opt="-DLLVM_CCACHE_BUILD=ON" \
55+
--cmake-opt="-DLLVM_CCACHE_DIR=$GITHUB_WORKSPACE/build_cache_$CACHE_SUFFIX" \
56+
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE" \
57+
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" \
58+
--cmake-opt="-DSYCL_PI_TESTS=OFF"
59+
- name: Compile
60+
id: build
61+
run: cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain
62+
- name: Install
63+
run: |
64+
cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain
65+
66+
- name: Pack toolchain
67+
run: tar -cJf llvm_sycl.tar.xz -C $GITHUB_WORKSPACE/build/install .
68+
- name: Upload toolchain
69+
uses: actions/upload-artifact@v2
70+
with:
71+
name: sycl_macos_${{ inputs.build_artifact_suffix }}
72+
path: llvm_sycl.tar.xz
73+

.github/workflows/sycl_post_commit.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: ./.github/workflows/sycl_gen_test_matrix.yml
1818
with:
1919
lts_config: "l0_gen9"
20+
cts_config: "cuda"
2021
linux_default:
2122
name: Linux Default
2223
needs: test_matrix
@@ -26,6 +27,7 @@ jobs:
2627
build_cache_root: "/__w/llvm"
2728
build_artifact_suffix: "post_commit"
2829
lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }}
30+
cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }}
2931
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
3032
linux_no_assert:
3133
name: Linux (no assert)
@@ -111,3 +113,8 @@ jobs:
111113
name: Windows
112114
if: github.repository == 'intel/llvm'
113115
uses: ./.github/workflows/sycl_windows_build_and_test.yml
116+
117+
macos_default:
118+
name: macOS
119+
if: github.repository == 'intel/llvm'
120+
uses: ./.github/workflows/sycl_macos_build_and_test.yml

buildbot/configure.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ def do_configure(args):
1313
if not os.path.isdir(abs_obj_dir):
1414
os.makedirs(abs_obj_dir)
1515

16-
llvm_external_projects = 'sycl;llvm-spirv;opencl;libdevice;xpti;xptifw'
16+
llvm_external_projects = 'sycl;llvm-spirv;opencl;xpti;xptifw'
17+
18+
# libdevice build requires a working SYCL toolchain, which is not the case
19+
# with macOS target right now.
20+
if sys.platform != "darwin":
21+
llvm_external_projects += ';libdevice'
1722

1823
libclc_amd_target_names = ';amdgcn--;amdgcn--amdhsa'
19-
libclc_nvidia_target_names = 'nvptx64--;nvptx64--nvidiacl'
24+
libclc_nvidia_target_names = ';nvptx64--;nvptx64--nvidiacl'
2025

2126
if args.llvm_external_projects:
2227
llvm_external_projects += ";" + args.llvm_external_projects.replace(",", ";")
@@ -39,11 +44,14 @@ def do_configure(args):
3944
llvm_enable_sphinx = 'OFF'
4045
llvm_build_shared_libs = 'OFF'
4146
llvm_enable_lld = 'OFF'
42-
sycl_enabled_plugins = ["opencl", "level_zero"]
47+
sycl_enabled_plugins = ["opencl"]
4348

4449
sycl_enable_xpti_tracing = 'ON'
4550
xpti_enable_werror = 'OFF'
4651

52+
if sys.platform != "darwin":
53+
sycl_enabled_plugins.append("level_zero")
54+
4755
# lld is needed on Windows or for the HIP plugin on AMD
4856
if platform.system() == 'Windows' or (args.hip and args.hip_platform == 'AMD'):
4957
llvm_enable_projects += ';lld'
@@ -104,17 +112,19 @@ def do_configure(args):
104112

105113
# For clang-format, clang-tidy and code coverage
106114
llvm_enable_projects += ";clang-tools-extra;compiler-rt"
107-
# libclc is required for CI validation
108-
if 'libclc' not in llvm_enable_projects:
109-
llvm_enable_projects += ';libclc'
110-
# libclc passes `--nvvm-reflect-enable=false`, build NVPTX to enable it
111-
if 'NVPTX' not in llvm_targets_to_build:
112-
llvm_targets_to_build += ';NVPTX'
113-
# Add both NVIDIA and AMD libclc targets
114-
if libclc_amd_target_names not in libclc_targets_to_build:
115-
libclc_targets_to_build += libclc_amd_target_names
116-
if libclc_nvidia_target_names not in libclc_targets_to_build:
117-
libclc_targets_to_build += libclc_nvidia_target_names
115+
if sys.platform != "darwin":
116+
# libclc is required for CI validation
117+
if 'libclc' not in llvm_enable_projects:
118+
llvm_enable_projects += ';libclc'
119+
# libclc passes `--nvvm-reflect-enable=false`, build NVPTX to enable it
120+
if 'NVPTX' not in llvm_targets_to_build:
121+
llvm_targets_to_build += ';NVPTX'
122+
# Add both NVIDIA and AMD libclc targets
123+
if libclc_amd_target_names not in libclc_targets_to_build:
124+
libclc_targets_to_build += libclc_amd_target_names
125+
if libclc_nvidia_target_names not in libclc_targets_to_build:
126+
libclc_targets_to_build += libclc_nvidia_target_names
127+
libclc_gen_remangled_variants = 'ON'
118128

119129
if args.enable_plugin:
120130
sycl_enabled_plugins += args.enable_plugin

clang/include/clang/Basic/Attr.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,14 @@ def SYCLRequiresDecomposition : InheritableAttr {
14291429
let Documentation = [InternalOnly];
14301430
}
14311431

1432+
def SYCLGenerateNewType : InheritableAttr {
1433+
// No spellings, as this is for internal use.
1434+
let Spellings = [];
1435+
let Subjects = SubjectList<[Named]>;
1436+
let LangOpts = [SYCLIsDevice, SYCLIsHost];
1437+
let Documentation = [InternalOnly];
1438+
}
1439+
14321440
def SYCLIntelKernelArgsRestrict : InheritableAttr {
14331441
let Spellings = [CXX11<"intel", "kernel_args_restrict">];
14341442
let Subjects = SubjectList<[Function], ErrorDiag>;

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ CODEGENOPT(SkipRaxSetup, 1, 0)
488488
ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind,
489489
5, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind::Skip)
490490

491+
/// Whether to expect -main-file-name to be an absolute path to use it for
492+
/// checksum calculations or not.
493+
CODEGENOPT(SYCLUseMainFileName, 1, 0)
494+
491495
/// Whether to use opaque pointers.
492496
CODEGENOPT(OpaquePointers, 1, 0)
493497

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
220220
/// file, for example with -save-temps.
221221
std::string MainFileName;
222222

223+
/// The user provided name for the "main file", with its full path.
224+
std::string FullMainFileName;
225+
223226
/// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name
224227
/// attribute in the skeleton CU.
225228
std::string SplitDwarfFile;

clang/include/clang/Driver/Options.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6156,6 +6156,10 @@ def main_file_name : Separate<["-"], "main-file-name">,
61566156
HelpText<"Main file name to use for debug info and source if missing">,
61576157
Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
61586158
MarshallingInfoString<CodeGenOpts<"MainFileName">>;
6159+
def full_main_file_name : Separate<["-"], "full-main-file-name">,
6160+
HelpText<"File name with full path to use for debug info during host and device compile">,
6161+
Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
6162+
MarshallingInfoString<CodeGenOpts<"FullMainFileName">>;
61596163
def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
61606164
HelpText<"File name to use for split dwarf debug info output">,
61616165
Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
@@ -6517,6 +6521,10 @@ def fsycl_disable_range_rounding : Flag<["-"], "fsycl-disable-range-rounding">,
65176521
def fsycl_enable_int_header_diags: Flag<["-"], "fsycl-enable-int-header-diags">,
65186522
HelpText<"Enable diagnostics that require the SYCL integration header.">,
65196523
MarshallingInfoFlag<LangOpts<"SYCLEnableIntHeaderDiags">>;
6524+
def fsycl_use_main_file_name : Flag<["-"], "fsycl-use-main-file-name">,
6525+
HelpText<"Tells compiler that -main-file-name contains an absolute path and "
6526+
"file specified there should be used for checksum calculation.">,
6527+
MarshallingInfoFlag<CodeGenOpts<"SYCLUseMainFileName">>;
65206528

65216529
} // let Flags = [CC1Option, NoDriverOption]
65226530

0 commit comments

Comments
 (0)