Skip to content

Commit fcd3ec4

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into llvmspirv_pulldown
2 parents 83f5b87 + ec26b92 commit fcd3ec4

File tree

583 files changed

+8662
-11970
lines changed

Some content is hidden

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

583 files changed

+8662
-11970
lines changed

.github/workflows/sycl-detect-changes.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ jobs:
8484
- .github/workflows/ur-*
8585
ur_cuda_adapter:
8686
- 'unified-runtime/source/adapters/cuda/**'
87+
ur_offload_adapter:
88+
- 'unified-runtime/include/**'
89+
- 'unified-runtime/source/adapters/offload/**'
90+
- '.github/workflows/ur-build-offload.yml'
8791
8892
- name: Set output
8993
id: result
@@ -94,7 +98,7 @@ jobs:
9498
return '${{ steps.changes.outputs.changes }}';
9599
}
96100
// Treat everything as changed for huge PRs.
97-
return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd", "ur", "ur_cuda_adapter"];
101+
return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd", "ur", "ur_cuda_adapter", "ur_offload_adapter"];
98102
99103
- run: echo '${{ steps.result.outputs.result }}'
100104

.github/workflows/sycl-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
touch .nojekyll
5454
# Update benchmarking dashboard configuration
5555
cat << EOF > benchmarks/config.js
56-
remoteDataUrl = 'https://raw.githubusercontent.com/intel/llvm-ci-perf-results/refs/heads/unify-ci/data.json';
56+
remoteDataUrl = 'https://raw.githubusercontent.com/intel/llvm-ci-perf-results/refs/heads/unify-ci/';
5757
defaultCompareNames = ["Baseline_PVC_L0"];
5858
EOF
5959
# Upload the generated docs as an artifact and deploy to GitHub Pages.

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ jobs:
105105
runner: '["Linux", "arc"]'
106106
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
107107
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
108-
target_devices: level_zero:gpu;opencl:gpu
108+
target_devices: level_zero:gpu
109109
extra_lit_opts: --param matrix-xmx8=True
110110
use_igc_dev: true
111+
env: '{"LIT_FILTER":"Matrix/"}'
111112
- name: E2E tests on Intel Ponte Vecchio GPU
112113
runner: '["Linux", "pvc"]'
113114
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
@@ -116,8 +117,9 @@ jobs:
116117
runner: '["Linux", "pvc"]'
117118
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
118119
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
119-
target_devices: level_zero:gpu;opencl:gpu
120+
target_devices: level_zero:gpu
120121
use_igc_dev: true
122+
env: '{"LIT_FILTER":"Matrix/"}'
121123
- name: Intel Battlemage Graphics
122124
runner: '["Linux", "bmg"]'
123125
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
@@ -163,7 +165,7 @@ jobs:
163165
'false' }}
164166
# Run only if the PR does not have the 'ci-no-devigc' label.
165167
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
166-
env: ${{ contains(needs.detect_changes.outputs.filters, 'esimd') && '{}' || '{"LIT_FILTER_OUT":"ESIMD/"}' }}
168+
env: ${{ matrix.env || (contains(needs.detect_changes.outputs.filters, 'esimd') && '{}' || '{"LIT_FILTER_OUT":"ESIMD/"}') }}
167169

168170
test-perf:
169171
needs: [build, detect_changes]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: UR - Build offload adapter
2+
3+
permissions: read-all
4+
5+
on: [ workflow_call, workflow_dispatch ]
6+
7+
jobs:
8+
offload_build:
9+
name: Build
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
build_type: [Release]
14+
compiler: [{c: gcc, cxx: g++}]
15+
16+
runs-on: [ "Linux", "build" ]
17+
container:
18+
image: 'ghcr.io/intel/llvm/ubuntu2404_base'
19+
20+
steps:
21+
- name: Checkout LLVM
22+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
24+
- name: Install liboffload
25+
run: sudo apt-get update -qq && sudo apt-get install --no-install-recommends -yqq liboffload-21 liboffload-21-dev
26+
27+
- name: Configure Unified Runtime project
28+
# ">" is used to avoid adding "\" at the end of each line; this command is quite long
29+
run: >
30+
cmake
31+
-S unified-runtime
32+
-B $GITHUB_WORKSPACE/build
33+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
34+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
35+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
36+
-DUR_ENABLE_TRACING=ON
37+
-DUR_DEVELOPER_MODE=ON
38+
-DUR_BUILD_TESTS=OFF
39+
-DUR_BUILD_ADAPTER_OFFLOAD=ON
40+
-DUR_OFFLOAD_INSTALL_DIR="/usr/lib/llvm-21"
41+
-DUR_OFFLOAD_INCLUDE_DIR="/usr/lib/llvm-21/include"
42+
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install
43+
44+
- name: Build
45+
# This is so that device binaries can find the sycl runtime library
46+
run: cmake --build $GITHUB_WORKSPACE/build -j $(nproc)
47+
48+
- name: Install
49+
# This is to check that install command does not fail
50+
run: cmake --install $GITHUB_WORKSPACE/build
51+
52+
- name: Get information about platform
53+
if: ${{ always() }}
54+
run: ./unified-runtime/.github/scripts/get_system_info.sh

.github/workflows/ur-precommit.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ jobs:
9999
docker_image: ${{ matrix.docker_image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'}}
100100
image_options: ${{ matrix.image_options || '' }}
101101

102+
# TODO: Enable once the apt package at https://apt.llvm.org/noble/pool/main/l/llvm-toolchain-snapshot/ is updated
103+
# offload_build:
104+
# name: Adapters (Offload)
105+
# needs: [detect_changes, source_checks]
106+
# if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur_offload_adapter') }}
107+
# uses: ./.github/workflows/ur-build-offload.yml
108+
102109
macos:
103110
name: MacOS build only
104111
needs: [detect_changes, source_checks]

clang/include/clang/Basic/Attr.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,14 @@ def SYCLDevice : InheritableAttr {
16251625
let Documentation = [SYCLDeviceDocs];
16261626
}
16271627

1628+
def SYCLDeviceOnly : InheritableAttr {
1629+
let Spellings = [Clang<"sycl_device_only">];
1630+
let Subjects = SubjectList<[Function]>;
1631+
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
1632+
let Documentation = [SYCLDeviceOnlyDocs];
1633+
}
1634+
def : MutualExclusions<[SYCLDevice, SYCLDeviceOnly]>;
1635+
16281636
def SYCLGlobalVar : InheritableAttr {
16291637
let Spellings = [GNU<"sycl_global_var">];
16301638
let Subjects = SubjectList<[GlobalStorageNonLocalVar], ErrorDiag>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4522,6 +4522,20 @@ implicitly inherit this attribute.
45224522
}];
45234523
}
45244524

4525+
def SYCLDeviceOnlyDocs : Documentation {
4526+
let Category = DocCatFunction;
4527+
let Heading = "sycl_device_only";
4528+
let Content = [{
4529+
This attribute can only be applied to functions and indicates that the function
4530+
is only available for the device. It allows functions marked with it to
4531+
overload existing functions without the attribute, in which case the overload
4532+
with the attribute will be used on the device side and the overload without
4533+
will be used on the host side. Note: as opposed to ``sycl_device`` this does
4534+
not mark the function as being exported, both attributes are incompatible and
4535+
can't be used together.
4536+
}];
4537+
}
4538+
45254539
def RISCVInterruptDocs : Documentation {
45264540
let Category = DocCatFunction;
45274541
let Heading = "interrupt (RISC-V)";

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9051,10 +9051,6 @@ def fenable_sycl_dae : Flag<["-"], "fenable-sycl-dae">,
90519051
def fsycl_enable_int_header_diags: Flag<["-"], "fsycl-enable-int-header-diags">,
90529052
HelpText<"Enable diagnostics that require the SYCL integration header.">,
90539053
MarshallingInfoFlag<LangOpts<"SYCLEnableIntHeaderDiags">>;
9054-
def fsycl_is_native_cpu : Flag<["-"], "fsycl-is-native-cpu">,
9055-
HelpText<"Perform device compilation for Native CPU.">,
9056-
Visibility<[CC1Option]>,
9057-
MarshallingInfoFlag<LangOpts<"SYCLIsNativeCPU">>;
90589054
// TODO: This option can be removed once a fix goes in that can
90599055
// work with the community changes for using the alloca address space.
90609056
defm offload_use_alloca_addrspace_for_srets : BoolFOption<"offload-use-alloca-addrspace-for-srets",

clang/lib/AST/Decl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3729,6 +3729,13 @@ unsigned FunctionDecl::getBuiltinID(bool ConsiderWrapperFunctions) const {
37293729
!(BuiltinID == Builtin::BIprintf || BuiltinID == Builtin::BImalloc))
37303730
return 0;
37313731

3732+
// SYCL doesn't have a device-side standard library. SYCLDeviceOnlyAttr may
3733+
// be used to provide device-side definitions of standard functions, so
3734+
// anything with that attribute shouldn't be treated as a builtin.
3735+
if (Context.getLangOpts().isSYCL() && hasAttr<SYCLDeviceOnlyAttr>()) {
3736+
return 0;
3737+
}
3738+
37323739
// As AMDGCN implementation of OpenMP does not have a device-side standard
37333740
// library, none of the predefined library functions except printf and malloc
37343741
// should be treated as a builtin i.e. 0 should be returned for them.

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3226,7 +3226,7 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC,
32263226
// target triple (eg for Windows) as host code.
32273227
// FIXME: 1.) provide mangling if needed
32283228
// 2.) check if other conventions need to be handled.
3229-
if (!getASTContext().getLangOpts().SYCLIsNativeCPU)
3229+
if (!getASTContext().getTargetInfo().getTriple().isNativeCPU())
32303230
// Currently we only allow this convention in
32313231
// SYCLNativeCPU and raise the usual error otherwise.
32323232
llvm_unreachable("Unsupported CC for mangling");

0 commit comments

Comments
 (0)