Skip to content

Commit 5efbbb6

Browse files
RossBruntonkbenzie
andauthored
[CI][UR][Offload] Add Offload build-only job (#18700)
Add a new job that verifies that the offload adapter can be built. It does not attempt to run any tests or detect any hardware. --------- Co-authored-by: Kenneth Benzie (Benie) <[email protected]>
1 parent 8640637 commit 5efbbb6

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
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

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

102+
offload_build:
103+
name: Adapters (Offload)
104+
needs: [detect_changes, source_checks]
105+
if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur_offload_adapter') }}
106+
uses: ./.github/workflows/ur-build-offload.yml
107+
102108
macos:
103109
name: MacOS build only
104110
needs: [detect_changes, source_checks]

0 commit comments

Comments
 (0)