Skip to content

Commit a2f639d

Browse files
committed
Merge branch 'sycl' into przemek/fix-vk-interop-on-igpu
2 parents 1b04c69 + b3f8f35 commit a2f639d

File tree

110 files changed

+1280
-1137
lines changed

Some content is hidden

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

110 files changed

+1280
-1137
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ on:
3232
build_artifact_suffix:
3333
type: string
3434
required: true
35+
build_target:
36+
type: string
37+
required: false
38+
default: sycl-toolchain
3539
artifact_archive_name:
3640
type: string
3741
default: llvm_sycl.tar.zst
@@ -177,7 +181,8 @@ jobs:
177181
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
178182
- name: Compile
179183
id: build
180-
run: cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain
184+
# Emulate default value for manual dispatch as we've run out of available arguments.
185+
run: cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }}
181186
- name: check-llvm
182187
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
183188
run: |

.github/workflows/sycl-nightly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
build_cache_suffix: sprod_shared
3434
build_artifact_suffix: sprod_shared
3535
build_configure_extra_args: '--shared-libs --hip --cuda --native_cpu --no-assertions'
36+
build_target: all
3637

3738
artifact_archive_name: sycl_linux_shared.tar.zst
3839

@@ -151,6 +152,7 @@ jobs:
151152
artifact_archive_name: sycl_windows.tar.gz
152153
# Disable the spirv-dis requirement as to not require SPIR-V Tools.
153154
build_configure_extra_args: -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off
155+
build_target: all
154156

155157
e2e-win:
156158
needs: build-win

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
build_configure_extra_args:
1111
type: string
1212
required: false
13+
build_target:
14+
type: string
15+
required: false
16+
default: sycl-toolchain
1317
changes:
1418
type: string
1519
description: 'Filter matches for the changed files in the PR'
@@ -58,6 +62,11 @@ on:
5862
build_configure_extra_args:
5963
type: string
6064
required: false
65+
build_target:
66+
type: choice
67+
options:
68+
- "sycl-toolchain"
69+
- "all"
6170
artifact_archive_name:
6271
type: choice
6372
options:
@@ -143,7 +152,7 @@ jobs:
143152
id: build
144153
shell: bash
145154
run: |
146-
cmake --build build --target sycl-toolchain
155+
cmake --build build --target ${{ inputs.build_target }}
147156
- name: check-llvm
148157
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
149158
shell: bash

.github/workflows/ur-build-hw.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ jobs:
164164
- name: Test adapter specific
165165
env:
166166
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
167-
run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV
167+
LIT_OPTS: "--timeout 120 --filter-out 'adapters/level_zero/memcheck.test'"
168+
run: cmake --build build -j $(nproc) -- check-unified-runtime-adapter
168169
# Don't run adapter specific tests when building multiple adapters
169170
if: ${{ matrix.adapter.other_name == '' }}
170171

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,8 @@ void CudaToolChain::addClangTargetOptions(
966966
if (FastRelaxedMath || UnsafeMathOpt)
967967
CC1Args.append({"-mllvm", "--nvptx-prec-divf32=0", "-mllvm",
968968
"--nvptx-prec-sqrtf32=0"});
969+
970+
CC1Args.append({"-mllvm", "-enable-memcpyopt-without-libcalls"});
969971
} else {
970972
CC1Args.append({"-fcuda-is-device", "-mllvm",
971973
"-enable-memcpyopt-without-libcalls",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %clang -### -nocudalib \
2+
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \
3+
// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
4+
5+
// CHECK-DEFAULT: "-enable-memcpyopt-without-libcalls"

devops/dependencies.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"linux": {
33
"compute_runtime": {
4-
"github_tag": "25.13.33276.19",
5-
"version": "25.13.33276.19",
6-
"url": "https://github.com/intel/compute-runtime/releases/tag/25.13.33276.19",
4+
"github_tag": "25.18.33578.6",
5+
"version": "25.18.33578.6",
6+
"url": "https://github.com/intel/compute-runtime/releases/tag/25.18.33578.6",
77
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
88
},
99
"igc": {
10-
"github_tag": "v2.10.10",
11-
"version": "v2.10.10",
12-
"url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.10.10",
10+
"github_tag": "v2.11.7",
11+
"version": "v2.11.7",
12+
"url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.11.7",
1313
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
1414
},
1515
"cm": {

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include(CheckCXXCompilerFlag)
12
set(obj_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
23
set(obj-new-offload_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
34
if (MSVC)
@@ -344,6 +345,7 @@ if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
344345
COMPONENT libsycldevice)
345346
endif()
346347

348+
check_cxx_compiler_flag(-Wno-invalid-noreturn HAS_NO_INVALID_NORETURN_WARN_FLAG)
347349
# Add all device libraries for each filetype except for the Intel math function
348350
# ones.
349351
add_devicelibs(libsycl-itt-stubs
@@ -358,7 +360,9 @@ add_devicelibs(libsycl-itt-user-wrappers
358360

359361
add_devicelibs(libsycl-crt
360362
SRC crt_wrapper.cpp
361-
DEPENDENCIES ${crt_obj_deps})
363+
DEPENDENCIES ${crt_obj_deps}
364+
EXTRA_OPTS $<$<BOOL:${HAS_NO_INVALID_NORETURN_WARN_FLAG}>:-Wno-invalid-noreturn>)
365+
362366
add_devicelibs(libsycl-complex
363367
SRC complex_wrapper.cpp
364368
DEPENDENCIES ${complex_obj_deps})

libdevice/crt_wrapper.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,24 @@ int memcmp(const void *s1, const void *s2, size_t n) {
5151
DEVICE_EXTERN_C_INLINE
5252
int rand() {
5353
size_t gid =
54+
#if defined(__NVPTX__) || defined(__AMDGCN__)
55+
(__spirv_GlobalInvocationId_x() * __spirv_GlobalSize_y() *
56+
__spirv_GlobalSize_z()) +
57+
(__spirv_GlobalInvocationId_y() * __spirv_GlobalSize_z()) +
58+
__spirv_GlobalInvocationId_z();
59+
#else
5460
(__spirv_BuiltInGlobalInvocationId.x * __spirv_BuiltInGlobalSize.y *
5561
__spirv_BuiltInGlobalSize.z) +
5662
(__spirv_BuiltInGlobalInvocationId.y * __spirv_BuiltInGlobalSize.z) +
5763
__spirv_BuiltInGlobalInvocationId.z;
58-
size_t global_size = __spirv_BuiltInGlobalSize.x *
59-
__spirv_BuiltInGlobalSize.y *
60-
__spirv_BuiltInGlobalSize.z;
64+
#endif
65+
size_t global_size =
66+
#if defined(__NVPTX__) || defined(__AMDGCN__)
67+
__spirv_GlobalSize_x() * __spirv_GlobalSize_y() * __spirv_GlobalSize_z();
68+
#else
69+
__spirv_BuiltInGlobalSize.x * __spirv_BuiltInGlobalSize.y *
70+
__spirv_BuiltInGlobalSize.z;
71+
#endif
6172
size_t gid1 =
6273
(global_size > RAND_NEXT_LEN) ? (gid & (RAND_NEXT_LEN - 1)) : gid;
6374
if (RAND_NEXT_ACC[gid1] == 0)
@@ -73,13 +84,24 @@ int rand() {
7384
DEVICE_EXTERN_C_INLINE
7485
void srand(unsigned int seed) {
7586
size_t gid =
87+
#if defined(__NVPTX__) || defined(__AMDGCN__)
88+
(__spirv_GlobalInvocationId_x() * __spirv_GlobalSize_y() *
89+
__spirv_GlobalSize_z()) +
90+
(__spirv_GlobalInvocationId_y() * __spirv_GlobalSize_z()) +
91+
__spirv_GlobalInvocationId_z();
92+
#else
7693
(__spirv_BuiltInGlobalInvocationId.x * __spirv_BuiltInGlobalSize.y *
7794
__spirv_BuiltInGlobalSize.z) +
7895
(__spirv_BuiltInGlobalInvocationId.y * __spirv_BuiltInGlobalSize.z) +
7996
__spirv_BuiltInGlobalInvocationId.z;
80-
size_t global_size = __spirv_BuiltInGlobalSize.x *
81-
__spirv_BuiltInGlobalSize.y *
82-
__spirv_BuiltInGlobalSize.z;
97+
#endif
98+
size_t global_size =
99+
#if defined(__NVPTX__) || defined(__AMDGCN__)
100+
__spirv_GlobalSize_x() * __spirv_GlobalSize_y() * __spirv_GlobalSize_z();
101+
#else
102+
__spirv_BuiltInGlobalSize.x * __spirv_BuiltInGlobalSize.y *
103+
__spirv_BuiltInGlobalSize.z;
104+
#endif
83105
size_t gid1 =
84106
(global_size > RAND_NEXT_LEN) ? (gid & (RAND_NEXT_LEN - 1)) : gid;
85107
RAND_NEXT_ACC[gid1] = seed;

libdevice/spirv_vars.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,23 @@
1010
#define __LIBDEVICE_SPIRV_VARS_H
1111

1212
#include "device.h"
13+
#include <cstddef>
1314

14-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
15-
defined(__AMDGCN__)
15+
#if defined(__NVPTX__) || defined(__AMDGCN__)
16+
// For AMD/Cuda those symbols will be provided by libclc.
17+
DEVICE_EXTERNAL size_t __spirv_GlobalInvocationId_x();
18+
DEVICE_EXTERNAL size_t __spirv_GlobalInvocationId_y();
19+
DEVICE_EXTERNAL size_t __spirv_GlobalInvocationId_z();
20+
DEVICE_EXTERNAL size_t __spirv_LocalInvocationId_x();
21+
DEVICE_EXTERNAL size_t __spirv_LocalInvocationId_y();
22+
DEVICE_EXTERNAL size_t __spirv_LocalInvocationId_z();
23+
DEVICE_EXTERNAL size_t __spirv_GlobalSize_x();
24+
DEVICE_EXTERNAL size_t __spirv_GlobalSize_y();
25+
DEVICE_EXTERNAL size_t __spirv_GlobalSize_z();
26+
#endif // __NVPTX__ || __AMDGCN__
27+
28+
#if defined(__SPIR__) || defined(__SPIRV__)
1629

17-
#include <cstddef>
1830
#include <cstdint>
1931

2032
#define __SPIRV_VAR_QUALIFIERS EXTERN_C const
@@ -63,5 +75,5 @@ const size_t_vec __spirv_BuiltInGlobalInvocationId{};
6375
const size_t_vec __spirv_BuiltInLocalInvocationId{};
6476
#endif // !__SPIR__ && !__SPIRV__
6577

66-
#endif // __SPIR__ || __SPIRV__ || __NVPTX__ || __AMDGCN__
78+
#endif // __SPIR__ || __SPIRV__
6779
#endif // __LIBDEVICE_SPIRV_VARS_H

llvm/lib/SYCLPostLink/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ add_llvm_component_library(LLVMSYCLPostLink
2222
BitWriter
2323
Core
2424
Demangle
25+
InstCombine
2526
IRPrinter
2627
Passes
28+
ScalarOpts
2729
Support
2830
ipo
2931
)

0 commit comments

Comments
 (0)