Skip to content

Commit f9761f8

Browse files
committed
Merge branch 'sycl' into sean/async-alloc-properties-ext
2 parents 1f85298 + 2532282 commit f9761f8

File tree

240 files changed

+2859
-2326
lines changed

Some content is hidden

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

240 files changed

+2859
-2326
lines changed

.github/workflows/coverity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
cd $GITHUB_WORKSPACE/build
4646
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
4747
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
48-
--ci-defaults --use-zstd --hip --cuda \
48+
--ci-defaults --hip --cuda \
4949
-DNATIVECPU_USE_OCK=Off \
5050
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
5151

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jobs:
173173
cd $GITHUB_WORKSPACE/build
174174
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
175175
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
176-
--ci-defaults --use-zstd ${{ inputs.build_configure_extra_args }} \
176+
--ci-defaults ${{ inputs.build_configure_extra_args }} \
177177
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
178178
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
179179
-DLLVM_INSTALL_UTILS=ON \
@@ -322,3 +322,18 @@ jobs:
322322
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_spirv_backend
323323
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
324324
extra_lit_opts: --param spirv-backend=True
325+
326+
- name: Remove E2E tests before preview-mode run
327+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
328+
run: rm -rf build-e2e
329+
330+
- name: Build E2E tests in Preview Mode
331+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
332+
uses: ./devops/actions/run-tests/e2e
333+
with:
334+
ref: ${{ inputs.ref || github.sha }}
335+
testing_mode: build-only
336+
target_devices: all
337+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_preview
338+
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
339+
extra_lit_opts: --param test-preview-mode=True

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
- '.github/workflows/sycl-macos-*.yml'
2323
- '.github/workflows/sycl-nightly.yml'
2424
- '.github/workflows/sycl-rel-nightly.yml'
25+
- '.github/workflows/sycl-rel-nightly-launch.yml'
2526
- '.github/workflows/trivy.yml'
2627
- 'devops/containers/**'
2728
- 'devops/actions/build_container/**'
@@ -120,13 +121,20 @@ jobs:
120121
- name: Intel Battlemage Graphics
121122
runner: '["Linux", "bmg"]'
122123
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
123-
target_devices: level_zero:gpu
124+
target_devices: level_zero:gpu;level_zero_v2:gpu
124125
- name: SPIR-V Backend / Intel Battlemage Graphics
125126
runner: '["Linux", "bmg"]'
126127
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
127128
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
128129
extra_lit_opts: --param spirv-backend=True
129130
e2e_binaries_artifact: sycl_e2e_bin_default_spirv_backend
131+
- name: Preview Mode
132+
runner: '["Linux", "gen12"]'
133+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
134+
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
135+
extra_lit_opts: --param test-preview-mode=True
136+
e2e_binaries_artifact: sycl_e2e_bin_default_preview
137+
130138
uses: ./.github/workflows/sycl-linux-run-tests.yml
131139
with:
132140
name: ${{ matrix.name }}

.github/workflows/sycl-macos-build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
cd $GITHUB_WORKSPACE/build
5050
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
5151
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
52-
--ci-defaults --use-zstd $ARGS \
52+
--ci-defaults $ARGS \
5353
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
5454
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
5555
-DLLVM_INSTALL_UTILS=ON

.github/workflows/sycl-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ jobs:
333333
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
334334
fi
335335
- name: Upload binaries
336-
uses: softprops/[email protected].0
336+
uses: softprops/[email protected].2
337337
with:
338338
files: |
339339
sycl_linux.tar.gz
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Gihub Actions launch scheduled workflows of the main branch only (sycl).
2+
# This is a workaround to set a scheduled launch of the sycl-rel-nightly.yml
3+
# workflow, which is located on the sycl-rel-* branch.
4+
5+
name: Scheduled sycl-rel-nightly launch
6+
7+
permissions: read-all
8+
9+
on:
10+
# The sycl-rel-nightly.yml workflow file on the sycl-rel-6_2 branch is most
11+
# likely stale. Do not schedule before it's updated.
12+
# schedule:
13+
# - cron: '0 3 * * *'
14+
workflow_dispatch:
15+
16+
jobs:
17+
launch:
18+
if: github.repository == 'intel/llvm'
19+
permissions:
20+
actions: write
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Launch
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
run: |
27+
gh workflow run sycl-rel-nightly.yml --repo ${{ github.repository }} --ref sycl-rel-6_2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
141141
IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
142142
python.exe src/buildbot/configure.py -o build ^
143-
--ci-defaults --use-zstd %ARGS% ^
143+
--ci-defaults %ARGS% ^
144144
"-DCMAKE_C_COMPILER=${{inputs.cxx}}" ^
145145
"-DCMAKE_CXX_COMPILER=${{inputs.cxx}}" ^
146146
"-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- '.github/workflows/sycl-macos-*.yml'
2222
- '.github/workflows/sycl-nightly.yml'
2323
- '.github/workflows/sycl-rel-nightly.yml'
24+
- '.github/workflows/sycl-rel-nightly-launch.yml'
2425
- '.github/workflows/trivy.yml'
2526
- 'devops/containers/**'
2627
- 'devops/actions/build_container/**'

.github/workflows/trivy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
name: Trivy
44

5+
permissions: read-all
6+
57
on:
68
pull_request:
79
paths:

.github/workflows/ur-benchmarks-reusable.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/ur-benchmarks.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

buildbot/configure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def do_configure(args, passthrough_args):
6666
xpti_enable_werror = "OFF"
6767
llvm_enable_zstd = "ON"
6868
spirv_enable_dis = "OFF"
69+
sycl_install_device_config_file = "OFF"
6970

7071
if sys.platform != "darwin":
7172
# For more info on the enablement of level_zero_v2 refer to this document:
@@ -160,6 +161,10 @@ def do_configure(args, passthrough_args):
160161
libclc_targets_to_build += libclc_nvidia_target_names
161162
libclc_gen_remangled_variants = "ON"
162163
spirv_enable_dis = "ON"
164+
sycl_install_device_config_file = "ON"
165+
166+
# Build compiler with zstd in CI.
167+
llvm_enable_zstd = "FORCE_ON"
163168

164169
if args.enable_backends:
165170
sycl_enabled_backends += args.enable_backends
@@ -208,6 +213,7 @@ def do_configure(args, passthrough_args):
208213
"-DSYCL_ENABLE_EXTENSION_JIT={}".format(sycl_enable_jit),
209214
"-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB={}".format(sycl_preview_lib),
210215
"-DBUG_REPORT_URL=https://github.com/intel/llvm/issues",
216+
"-DSYCL_INSTALL_DEVICE_CONFIG_FILE={}".format(sycl_install_device_config_file),
211217
]
212218

213219
if libclc_enabled:

clang/lib/AST/StmtPrinter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,9 @@ void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) {
13161316
if (Node->hasTemplateKeyword())
13171317
OS << "template ";
13181318

1319-
bool ForceAnonymous =
1320-
Policy.PrintAsCanonical && VD->getKind() == Decl::NonTypeTemplateParm;
1319+
bool ForceAnonymous = Policy.PrintAsCanonical &&
1320+
!Policy.SkipCanonicalizationOfTemplateTypeParms &&
1321+
VD->getKind() == Decl::NonTypeTemplateParm;
13211322
DeclarationNameInfo NameInfo = Node->getNameInfo();
13221323
if (IdentifierInfo *ID = NameInfo.getName().getAsIdentifierInfo();
13231324
!ForceAnonymous &&

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ static bool isDeclaredInSYCLNamespace(const Decl *D) {
846846
ND = cast<NamespaceDecl>(Parent);
847847
}
848848

849-
return ND && ND->getName() == "sycl";
849+
return ND->getName() == "sycl";
850850
}
851851

852852
static bool isSYCLPrivateMemoryVar(VarDecl *VD) {

clang/test/CodeGenSYCL/int_header_nttp.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// CHECK: Forward declarations of templated kernel function types:
99
// CHECK-NEXT: template <typename T, T nttp> struct SelfReferentialNTTP;
1010
// CHECK-NEXT: template <typename U, int nttp> struct NonSelfRef;
11+
// CHECK-NEXT: template <int N> struct alignas(N) OpaqueType;
1112

1213
template<typename T, T nttp>
1314
struct SelfReferentialNTTP {};
@@ -17,7 +18,15 @@ using Foo = int;
1718
template<typename U, Foo nttp>
1819
struct NonSelfRef {};
1920

21+
template <int N> struct alignas(N) OpaqueType {
22+
char data[N];
23+
};
24+
template <typename T> class Kernel;
25+
2026
void foo() {
21-
sycl::kernel_single_task<SelfReferentialNTTP<int, 1>>([](){});
22-
sycl::kernel_single_task<NonSelfRef<int, 1>>([](){});
27+
auto Lambda = [](){};
28+
sycl::kernel_single_task<SelfReferentialNTTP<int, 1>>(Lambda);
29+
sycl::kernel_single_task<NonSelfRef<int, 1>>(Lambda);
30+
using scalar_t = OpaqueType<sizeof(int)>;
31+
sycl::kernel_single_task<class Kernel<scalar_t>>(Lambda);
2332
}

devops/scripts/benchmarks/utils/compute_runtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def __init__(self):
3030

3131
def ld_libraries(self) -> list[str]:
3232
paths = [
33-
os.path.join(self.gmmlib, "lib64"),
34-
os.path.join(self.level_zero, "lib64"),
33+
os.path.join(self.gmmlib, "lib"),
34+
os.path.join(self.level_zero, "lib"),
3535
os.path.join(self.compute_runtime, "bin"),
3636
]
3737

devops/scripts/benchmarks/utils/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def run(
3434
env = os.environ.copy()
3535

3636
for ldlib in ld_library:
37-
env["LD_LIBRARY_PATH"] = ldlib + os.pathsep + env.get("LD_LIBRARY_PATH", "")
37+
if os.path.isdir(ldlib):
38+
env["LD_LIBRARY_PATH"] = (
39+
ldlib + os.pathsep + env.get("LD_LIBRARY_PATH", "")
40+
)
41+
else:
42+
print(f"Warning: LD_LIBRARY_PATH component does not exist: {ldlib}")
3843

3944
# order is important, we want provided sycl rt libraries to be first
4045
if add_sycl:

libclc/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,17 +489,12 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
489489
set( MACRO_ARCH ${ARCH} )
490490
endif()
491491

492-
# Enable SPIR-V builtin function declarations, so they don't
493-
# have to be explicity declared in the soruce.
494-
list( APPEND build_flags -Xclang -fdeclare-spirv-builtins)
495492
set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" )
496493
file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} )
497494

498495
# OpenCL 3.0 extensions
499496
string(CONCAT CL_3_0_EXTENSIONS
500497
"-cl-ext="
501-
"+cl_khr_fp64,"
502-
"+cl_khr_fp16,"
503498
"+__opencl_c_3d_image_writes,"
504499
"+__opencl_c_images,"
505500
"+cl_khr_3d_image_writes")
@@ -573,10 +568,11 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
573568
if( BUILD_LIBSPIRV_${t} )
574569
set( spirv_build_flags ${build_flags} )
575570
list( APPEND spirv_build_flags
571+
# Enable SPIR-V builtin function declarations, so they don't have to be
572+
# explicity declared in the soruce.
573+
-Xclang -fdeclare-spirv-builtins
576574
-I${CMAKE_CURRENT_SOURCE_DIR}/opencl/include
577575
-I${CMAKE_CURRENT_SOURCE_DIR}/libspirv/include/
578-
# FIXME: Fix libspirv to not require disabling this noisy warning
579-
-Wno-bitwise-conditional-parentheses
580576
)
581577

582578
add_libclc_builtin_set(

libclc/libspirv/lib/generic/SOURCES

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ math/cbrt.cl
6767
math/ceil.cl
6868
math/clc_exp10.cl
6969
math/clc_fmod.cl
70-
math/clc_pow.cl
71-
math/clc_pown.cl
72-
math/clc_powr.cl
7370
math/clc_remainder.cl
7471
math/clc_remquo.cl
7572
math/clc_rootn.cl

libclc/libspirv/lib/generic/integer/integer-gentype.inc

Lines changed: 0 additions & 58 deletions
This file was deleted.

libclc/libspirv/lib/generic/integer/mad24.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
#include <libspirv/spirv.h>
1111

1212
#define __CLC_BODY <mad24.inc>
13-
#include <integer-gentype.inc>
13+
#include <clc/integer/gentype.inc>

libclc/libspirv/lib/generic/integer/mad24.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#if __CLC_GENSIZE == 32
10+
911
#ifdef __CLC_GEN_S
1012
#define DECL __spirv_ocl_s_mad24
1113
#else
@@ -18,3 +20,5 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE DECL(__CLC_GENTYPE x, __CLC_GENTYPE y,
1820
}
1921

2022
#undef DECL
23+
24+
#endif // __CLC_GENSIZE == 32

libclc/libspirv/lib/generic/integer/mul24.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
#include <libspirv/spirv.h>
1111

1212
#define __CLC_BODY <mul24.inc>
13-
#include <integer-gentype.inc>
13+
#include <clc/integer/gentype.inc>

0 commit comments

Comments
 (0)