Skip to content

Commit 73f0476

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents a2aef53 + d2982c6 commit 73f0476

File tree

71 files changed

+5200
-453
lines changed

Some content is hidden

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

71 files changed

+5200
-453
lines changed

.github/workflows/sycl_nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
lts_config: "ocl_gen9;ocl_x64;hip_amdgpu"
2020

2121
windows_default:
22-
name: Windows (experimental)
22+
name: Windows
2323
if: github.repository == 'intel/llvm'
2424
uses: ./.github/workflows/sycl_windows_build_and_test.yml
2525

.github/workflows/sycl_post_commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,5 @@ jobs:
9898

9999
windows_default:
100100
name: Windows
101+
if: github.repository == 'intel/llvm'
101102
uses: ./.github/workflows/sycl_windows_build_and_test.yml

.github/workflows/sycl_windows_build_and_test.yml

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,80 @@ name: SYCL Windows Test
22

33
on:
44
workflow_call:
5+
inputs:
6+
build_cache_suffix:
7+
type: string
8+
required: false
9+
default: "default"
510

611
jobs:
712
build:
813
name: Build
9-
runs-on: windows-2022
14+
runs-on: [Windows, build]
15+
# TODO use cached checkout
1016
steps:
11-
- uses: actions/checkout@v2
12-
with:
13-
path: src
14-
fetch-depth: 1
15-
- name: Install dependencies
16-
shell: cmd
17-
run: |
18-
choco install -y ninja
19-
choco install -y sccache --version 0.2.15
20-
refreshenv
2117
- uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f
2218
with:
2319
arch: amd64
24-
- name: Setup Cache
25-
uses: actions/cache@v2
26-
if: ${{ github.event_name != 'pull_request' }}
27-
id: cache
20+
- name: Set env
21+
run: |
22+
git config --system core.longpaths true
23+
git config --global core.autocrlf false
24+
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
25+
echo "SCCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
26+
- uses: actions/checkout@v2
2827
with:
29-
path: cache
30-
key: sycl-win-build-${{ github.sha }}
31-
restore-keys: |
32-
sycl-win-build-
33-
- name: Build
28+
path: src
29+
fetch-depth: 1
30+
- name: Register cleanup after job is finished
31+
uses: ./src/devops/actions/cleanup
32+
- name: Configure
3433
shell: cmd
3534
# TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83
36-
# TODO enable sccache, when problems with PDB are resolved
3735
run: |
3836
mkdir build
3937
mkdir install
40-
IF NOT EXIST cache MKDIR cache
41-
set SCCACHE_DIR=%GITHUB_WORKSPACE%\cache
42-
set PATH=C:\ProgramData\chocolatey\lib\sccache\tools\sccache-v0.2.15-x86_64-pc-windows-msvc;%PATH%
38+
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
39+
IF NOT EXIST D:\github\_work\cache\sycl_${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
4340
python.exe src/buildbot/configure.py -o build ^
41+
--ci-default ^
4442
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
4543
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
4644
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
4745
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^
4846
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache"
47+
- name: Build
48+
id: build
49+
run: |
4950
cmake --build build --target sycl-toolchain
5051
sccache --show-stats
52+
- name: check-llvm
53+
shell: bash
54+
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
55+
run: |
56+
cmake --build build --target check-llvm
57+
- name: check-clang
58+
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
59+
shell: bash
60+
run: |
61+
cmake --build build --target check-clang
62+
- name: check-sycl
63+
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
64+
shell: bash
65+
run: |
66+
cmake --build build --target check-sycl
67+
- name: check-llvm-spirv
68+
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
69+
shell: bash
70+
run: |
71+
cmake --build build --target check-llvm-spirv
72+
- name: check-xptifw
73+
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
74+
shell: bash
75+
run: |
76+
cmake --build build --target check-xptifw
5177
- name: Install
52-
shell: cmd
78+
shell: bash
5379
run: cmake --build build --target deploy-sycl-toolchain
5480
- name: Upload toolchain
5581
uses: actions/upload-artifact@v2

buildbot/configure.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,25 @@ def do_configure(args):
3131
llvm_enable_projects = 'clang;' + llvm_external_projects
3232
libclc_targets_to_build = ''
3333
libclc_gen_remangled_variants = 'OFF'
34-
sycl_build_pi_cuda = 'OFF'
35-
sycl_build_pi_esimd_emulator = 'OFF'
36-
sycl_build_pi_hip = 'OFF'
3734
sycl_build_pi_hip_platform = 'AMD'
3835
sycl_clang_extra_flags = ''
39-
sycl_werror = 'ON'
36+
sycl_werror = 'OFF'
4037
llvm_enable_assertions = 'ON'
4138
llvm_enable_doxygen = 'OFF'
4239
llvm_enable_sphinx = 'OFF'
4340
llvm_build_shared_libs = 'OFF'
4441
llvm_enable_lld = 'OFF'
42+
sycl_enabled_plugins = ["opencl", "level_zero"]
4543

4644
sycl_enable_xpti_tracing = 'ON'
47-
xpti_enable_werror = 'ON'
45+
xpti_enable_werror = 'OFF'
4846

4947
# replace not append, so ARM ^ X86
5048
if args.arm:
5149
llvm_targets_to_build = 'ARM;AArch64'
5250

5351
if args.enable_esimd_emulator:
54-
sycl_build_pi_esimd_emulator = 'ON'
52+
sycl_enabled_plugins.append("esimd_emulator")
5553

5654
if args.cuda or args.hip:
5755
llvm_enable_projects += ';libclc'
@@ -60,7 +58,7 @@ def do_configure(args):
6058
llvm_targets_to_build += ';NVPTX'
6159
libclc_targets_to_build = libclc_nvidia_target_names
6260
libclc_gen_remangled_variants = 'ON'
63-
sycl_build_pi_cuda = 'ON'
61+
sycl_enabled_plugins.append("cuda")
6462

6563
if args.hip:
6664
if args.hip_platform == 'AMD':
@@ -75,11 +73,11 @@ def do_configure(args):
7573
libclc_gen_remangled_variants = 'ON'
7674

7775
sycl_build_pi_hip_platform = args.hip_platform
78-
sycl_build_pi_hip = 'ON'
76+
sycl_enabled_plugins.append("hip")
7977

80-
if args.no_werror:
81-
sycl_werror = 'OFF'
82-
xpti_enable_werror = 'OFF'
78+
if args.werror or args.ci_defaults:
79+
sycl_werror = 'ON'
80+
xpti_enable_werror = 'ON'
8381

8482
if args.no_assertions:
8583
llvm_enable_assertions = 'OFF'
@@ -115,6 +113,9 @@ def do_configure(args):
115113
if libclc_nvidia_target_names not in libclc_targets_to_build:
116114
libclc_targets_to_build += libclc_nvidia_target_names
117115

116+
if args.enable_plugin:
117+
sycl_enabled_plugins += args.enable_plugin
118+
118119
install_dir = os.path.join(abs_obj_dir, "install")
119120

120121
cmake_cmd = [
@@ -133,8 +134,6 @@ def do_configure(args):
133134
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
134135
"-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build),
135136
"-DLIBCLC_GENERATE_REMANGLED_VARIANTS={}".format(libclc_gen_remangled_variants),
136-
"-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda),
137-
"-DSYCL_BUILD_PI_HIP={}".format(sycl_build_pi_hip),
138137
"-DSYCL_BUILD_PI_HIP_PLATFORM={}".format(sycl_build_pi_hip_platform),
139138
"-DLLVM_BUILD_TOOLS=ON",
140139
"-DSYCL_ENABLE_WERROR={}".format(sycl_werror),
@@ -145,9 +144,9 @@ def do_configure(args):
145144
"-DBUILD_SHARED_LIBS={}".format(llvm_build_shared_libs),
146145
"-DSYCL_ENABLE_XPTI_TRACING={}".format(sycl_enable_xpti_tracing),
147146
"-DLLVM_ENABLE_LLD={}".format(llvm_enable_lld),
148-
"-DSYCL_BUILD_PI_ESIMD_EMULATOR={}".format(sycl_build_pi_esimd_emulator),
149147
"-DXPTI_ENABLE_WERROR={}".format(xpti_enable_werror),
150-
"-DSYCL_CLANG_EXTRA_FLAGS={}".format(sycl_clang_extra_flags)
148+
"-DSYCL_CLANG_EXTRA_FLAGS={}".format(sycl_clang_extra_flags),
149+
"-DSYCL_ENABLE_PLUGINS={}".format(';'.join(set(sycl_enabled_plugins)))
151150
]
152151

153152
if args.l0_headers and args.l0_loader:
@@ -213,7 +212,7 @@ def main():
213212
parser.add_argument("--enable-esimd-emulator", action='store_true', help="build with ESIMD emulation support")
214213
parser.add_argument("--no-assertions", action='store_true', help="build without assertions")
215214
parser.add_argument("--docs", action='store_true', help="build Doxygen documentation")
216-
parser.add_argument("--no-werror", action='store_true', help="Don't treat warnings as errors")
215+
parser.add_argument("--werror", action='store_true', help="Don't treat warnings as errors")
217216
parser.add_argument("--shared-libs", action='store_true', help="Build shared libraries")
218217
parser.add_argument("--cmake-opt", action='append', help="Additional CMake option not configured via script parameters")
219218
parser.add_argument("--cmake-gen", default="Ninja", help="CMake generator")
@@ -223,6 +222,7 @@ def main():
223222
parser.add_argument("--use-lld", action="store_true", help="Use LLD linker for build")
224223
parser.add_argument("--llvm-external-projects", help="Add external projects to build. Add as comma seperated list.")
225224
parser.add_argument("--ci-defaults", action="store_true", help="Enable default CI parameters")
225+
parser.add_argument("--enable-plugin", action='append', help="Enable SYCL plugin")
226226
args = parser.parse_args()
227227

228228
print("args:{}".format(args))

buildbot/dependency.conf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[VERSIONS]
2-
# https://github.com/intel/llvm/releases/download/2021-WW50/oclcpuexp-2021.13.11.0.23_rel.tar.gz
3-
ocl_cpu_rt_ver=2021.13.11.0.23
4-
# https://github.com/intel/llvm/releases/download/2021-WW50/win-oclcpuexp-2021.13.11.0.23_rel.zip
5-
ocl_cpu_rt_ver_win=2021.13.11.0.23
2+
# https://github.com/intel/llvm/releases/download/2022-WW13/oclcpuexp-2022.13.3.0.16_rel.tar.gz
3+
ocl_cpu_rt_ver=2022.13.3.0.16
4+
# https://github.com/intel/llvm/releases/download/2022-WW13/win-oclcpuexp-2022.13.3.0.16_rel.zip
5+
ocl_cpu_rt_ver_win=2022.13.3.0.16
66
# Same GPU driver supports Level Zero and OpenCL
77
# https://github.com/intel/compute-runtime/releases/tag/22.10.22597
88
ocl_gpu_rt_ver=22.10.22597
@@ -15,26 +15,26 @@ intel_sycl_ver=build
1515
# https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md
1616
# or downloaded using links below:
1717
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.5.0/oneapi-tbb-2021.5.0-lin.tgz
18-
tbb_ver=2021.5.0
18+
tbb_ver=2021.6.0.755
1919
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.5.0/oneapi-tbb-2021.5.0-win.zip
20-
tbb_ver_win=2021.5.0
20+
tbb_ver_win=2021.6.0.755
2121

22-
# https://github.com/intel/llvm/releases/download/2021-WW50/fpgaemu-2021.13.11.0.23_rel.tar.gz
23-
ocl_fpga_emu_ver=2021.13.11.0.23
24-
# https://github.com/intel/llvm/releases/download/2021-WW50/win-fpgaemu-2021.13.11.0.23_rel.zip
25-
ocl_fpga_emu_ver_win=2021.13.11.0.23
26-
fpga_ver=20211014_000004
27-
fpga_ver_win=20211014_000004
22+
# https://github.com/intel/llvm/releases/download/2022-WW13/fpgaemu-2022.13.3.0.16_rel.tar.gz
23+
ocl_fpga_emu_ver=2022.13.3.0.16
24+
# https://github.com/intel/llvm/releases/download/2022-WW13/win-fpgaemu-2022.13.3.0.16_rel.zip
25+
ocl_fpga_emu_ver_win=2022.13.3.0.16
26+
fpga_ver=20220120_000001
27+
fpga_ver_win=20220120_000001
2828
# https://downloadmirror.intel.com/723911/igfx_win_101.1404.zip
2929
ocloc_ver_win=101.1404
3030

3131
[DRIVER VERSIONS]
32-
cpu_driver_lin=2021.13.11.0.23
33-
cpu_driver_win=2021.13.11.0.23
32+
cpu_driver_lin=2022.13.3.0.16
33+
cpu_driver_win=2022.13.3.0.16
3434
gpu_driver_lin=22.10.22597
3535
gpu_driver_win=101.1404
36-
fpga_driver_lin=2021.13.11.0.23
37-
fpga_driver_win=2021.13.11.0.23
36+
fpga_driver_lin=2022.13.3.0.16
37+
fpga_driver_win=2022.13.3.0.16
3838
# NVidia CUDA driver
3939
# TODO provide URL for CUDA driver
4040
nvidia_gpu_driver_lin=435.21

clang/include/clang/Basic/Attr.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,16 @@ def SYCLAddIRAttributesGlobalVariable : InheritableAttr {
16961696
let Documentation = [SYCLAddIRAttributesGlobalVariableDocs];
16971697
}
16981698

1699+
def SYCLAddIRAnnotationsMember : InheritableAttr {
1700+
let Spellings = [CXX11<"__sycl_detail__", "add_ir_annotations_member">];
1701+
let Args = [VariadicExprArgument<"Args">];
1702+
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
1703+
let Subjects = SubjectList<[Field], ErrorDiag>;
1704+
let AcceptsExprPack = 1;
1705+
let AdditionalMembers = SYCLAddIRAttrCommonMembers.MemberCode;
1706+
let Documentation = [SYCLAddIRAnnotationsMemberDocs];
1707+
}
1708+
16991709
def C11NoReturn : InheritableAttr {
17001710
let Spellings = [Keyword<"_Noreturn">];
17011711
let Subjects = SubjectList<[Function], ErrorDiag>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3611,6 +3611,83 @@ where the last N*2 are as described above.
36113611
}];
36123612
}
36133613

3614+
def SYCLAddIRAnnotationsMemberDocs : Documentation {
3615+
let Category = DocCatVariable;
3616+
let Heading = "add_ir_annotations_member";
3617+
let Content = [{
3618+
This attribute can be applied to a non-static field. Access to a field with this
3619+
attribute will generate a call to ``llvm.ptr.annotation`` with the arguments
3620+
paired.
3621+
The attribute must contain N*2 arguments. Each of the first N of these arguments
3622+
must be either string literals or ``constexpr const char *``. The following N
3623+
must be integer, floating point, character, boolean, ``const char *``, or an
3624+
enumeration as either a literal or ``constexpr`` value. The first N arguments
3625+
and the second N arguments are zipped into pairs when creating the call to
3626+
``llvm.ptr.annotation``, i.e. in the constant global variable pointed to by the
3627+
generated annotation intrinsic call, the N+1'th argument of the attribute will
3628+
occur after the first argument of the attribute, the N+2'th argument of the
3629+
attribute will occur after the second argument of the attribute, etc.
3630+
The generated call to ``llvm.ptr.annotation`` will have the following arguments
3631+
in this order:
3632+
* First argument is a pointer to the field.
3633+
* A pointer to a string literal in a constant global variable. This will
3634+
always be "sycl-properties".
3635+
* A pointer to a string literal in a constant global variable with the name of
3636+
the source file.
3637+
* The line number of the field declaration in the source file.
3638+
* A pointer to a constant global variable containing pointers to string
3639+
literals in constant global variables. These pointers to string literals
3640+
occur in pairs. If the second value of a pair was a ``nullptr`` or an empty
3641+
string then the pointer will be a null-pointer.
3642+
A pair will not be in the call to ``llvm.ptr.annotation`` if the first value of
3643+
the pair is an empty string.
3644+
3645+
.. code-block:: c++
3646+
3647+
struct Foo {
3648+
int *ptr
3649+
#ifdef __SYCL_DEVICE_ONLY__
3650+
[[__sycl_detail__::add_ir_annotations_member(
3651+
"Attr1", "Attr2", "Attribute value", 3.14)]]
3652+
#endif
3653+
;
3654+
};
3655+
// Accessing the 'ptr' field of 'Foo' will result in a call to
3656+
// 'llvm.ptr.annotation' with the second argument pointing to a constant
3657+
// global variable containing "sycl-properties" and the fifth argument
3658+
// pointing to a constant global variable with pointers to string literals
3659+
// "Attr1", "Attribute value", "Attr2", "3.14" in that order.
3660+
3661+
Optionally, the first argument of the attribute can be an initializer list
3662+
containing only string literals. This initializer list acts as a filter,
3663+
allowing only pairs with the first value in the initializer list to be
3664+
generated. If this intializer list is present, the attribute must have N*2+1
3665+
arguments, where the last N*2 are as described above.
3666+
3667+
.. code-block:: c++
3668+
3669+
struct Foo {
3670+
int *ptr
3671+
#ifdef __SYCL_DEVICE_ONLY__
3672+
[[__sycl_detail__::add_ir_annotations_member(
3673+
{"Attr2"}, "Attr1", "Attr2", "Attribute value", 3.14)]]
3674+
#endif
3675+
;
3676+
};
3677+
// Accessing the 'ptr' field of 'Foo' will result in a call to
3678+
// 'llvm.ptr.annotation' with the second argument pointing to a constant
3679+
// global variable containing "sycl-properties" and the fifth argument
3680+
// pointing to a constant global variable with pointers to string literals
3681+
// "Attr2", "3.14" in that order.
3682+
3683+
.. Note:: This attribute will only generate a call to ``llvm.ptr.annotation`` in
3684+
SYCL device code.
3685+
3686+
.. Note:: This attribute is intended as an internal implementation detail and is
3687+
not intended to be used by external users.
3688+
}];
3689+
}
3690+
36143691
def SYCLDeviceIndirectlyCallableDocs : Documentation {
36153692
let Category = DocCatFunction;
36163693
let Heading = "intel::device_indirectly_callable";

0 commit comments

Comments
 (0)