Skip to content

Commit 4740644

Browse files
committed
Add SYCL compatibility workflow
1 parent 2af3edd commit 4740644

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,6 @@ jobs:
324324
pr_no: '0'
325325
bench_script_params: '--save baseline'
326326
upload_report: true
327+
328+
SYCL:
329+
uses: ./.github/workflows/reusable_sycl.yml
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: SYCL
2+
3+
on:
4+
workflow_call:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
env:
12+
PATH: "${{ github.workspace }}/llvm/bin:$PATH"
13+
LD_LIBRARY_PATH: "${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH"
14+
15+
jobs:
16+
latest-release:
17+
# run only on upstream; forks will not have the HW
18+
if: github.repository == 'oneapi-src/unified-memory-framework' && false
19+
name: Latest release
20+
runs-on: [DSS-LEVEL_ZERO, DSS-UBUNTU]
21+
22+
steps:
23+
- name: Install apt packages
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y cmake libhwloc-dev ninja-build python3 wget
27+
28+
# Install UMF
29+
- name: Checkout UMF
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
path: umf_repo
33+
fetch-depth: 0
34+
35+
- name: Configure UMF
36+
working-directory: umf_repo
37+
run: >
38+
cmake
39+
-B build
40+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/umf_install
41+
-DCMAKE_BUILD_TYPE=Release
42+
-DCMAKE_C_COMPILER=gcc
43+
-DCMAKE_CXX_COMPILER=g++
44+
-DUMF_BUILD_SHARED_LIBRARY=ON
45+
-DUMF_BUILD_TESTS=OFF
46+
-DUMF_BUILD_EXAMPLES=OFF
47+
48+
- name: Build and install UMF
49+
working-directory: umf_repo
50+
run: cmake --build build --target install -j$(nproc)
51+
52+
# Build SYCL
53+
- name: Download latest SYCL release
54+
run: |
55+
latest_release=$(curl -s https://api.github.com/repos/intel/llvm/releases/latest | grep "tag_name" | cut -d '"' -f 4)
56+
download_url="https://github.com/intel/llvm/archive/refs/tags/${latest_release}.tar.gz"
57+
wget --no-verbose $download_url -O sycl_linux.tar.gz
58+
59+
- name: Extract SYCL
60+
run: |
61+
mkdir llvm
62+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
63+
64+
- name: Build SYCL
65+
working-directory: llvm
66+
run: |
67+
python3 buildbot/configure.py
68+
python3 buildbot/compile.py -j $(nproc)
69+
70+
- name: Copy latest UMF to sycl
71+
run: echo "Copy latest UMF to sycl"
72+
73+
- name: Run sycl-ls
74+
run: echo "Run sycl-ls"
75+
76+
latest-daily:
77+
# run only on upstream; forks will not have the HW
78+
if: github.repository == 'oneapi-src/unified-memory-framework'
79+
name: Latest daily build
80+
runs-on: ["DSS-LEVEL_ZERO", "DSS-UBUNTU"]
81+
82+
steps:
83+
# - name: Install apt packages
84+
# run: |
85+
# sudo apt-get update
86+
# sudo apt-get install -y cmake libhwloc-dev ninja-build python3 wget
87+
88+
# Install SYCL
89+
- name: Download latest SYCL daily release
90+
run: |
91+
latest_tag=$(curl -s https://api.github.com/repos/intel/llvm/releases | awk -F'"' '/"tag_name":/ {print $4; exit}')
92+
download_url="https://github.com/intel/llvm/releases/download/${latest_tag}/sycl_linux.tar.gz"
93+
wget --no-verbose $download_url -O sycl_linux.tar.gz
94+
95+
- name: Extract SYCL
96+
run: |
97+
mkdir llvm
98+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
99+
100+
# Install UMF
101+
- name: Checkout UMF
102+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
with:
104+
path: umf_repo
105+
fetch-depth: 0
106+
107+
- name: Configure UMF
108+
working-directory: umf_repo
109+
run: >
110+
cmake
111+
-B build
112+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
113+
-DCMAKE_BUILD_TYPE=Release
114+
-DCMAKE_C_COMPILER=gcc
115+
-DCMAKE_CXX_COMPILER=g++
116+
-DUMF_BUILD_SHARED_LIBRARY=ON
117+
-DUMF_BUILD_TESTS=OFF
118+
-DUMF_BUILD_EXAMPLES=OFF
119+
120+
- name: Remove UMF installed with SYCL
121+
run: rm -f llvm/lib/libumf*
122+
123+
- name: Build and install UMF
124+
working-directory: umf_repo
125+
run: cmake --build build --target install -j$(nproc)
126+
127+
- name: Print installed lib files
128+
run: ls -l llvm/lib
129+
130+
# Test sycl-ls
131+
- name: Run sycl-ls
132+
run: |
133+
./llvm/bin/sycl-ls
134+
135+
# Test several sycl e2e test
136+
- name: Checkout SYCL
137+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
138+
with:
139+
repository: intel/llvm
140+
path: sycl_repo
141+
fetch-depth: 1
142+
ref: sycl
143+
144+
- name: Run SYCL tests
145+
working-directory: sycl_repo
146+
run: |
147+
llvm-lit --param sycl_devices="level_zero:gpu" sycl/test-e2e

0 commit comments

Comments
 (0)