Skip to content

Commit 8ca54a1

Browse files
committed
Add sycl compatibility workflow
1 parent 042b66d commit 8ca54a1

File tree

2 files changed

+192
-0
lines changed

2 files changed

+192
-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: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: SYCL
2+
3+
on:
4+
workflow_call:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
latest-release:
13+
# run only on upstream; forks will not have the HW
14+
if: github.repository == 'oneapi-src/unified-memory-framework'
15+
name: Latest release
16+
runs-on: [DSS-LEVEL_ZERO, DSS-UBUNTU]
17+
18+
steps:
19+
# Build SYCL
20+
- name: Clean up
21+
run: rm -rf llvm sycl_linux.tar.gz
22+
23+
- name: Download latest SYCL release
24+
run: |
25+
latest_release=$(curl -s https://api.github.com/repos/intel/llvm/releases/latest | grep "tag_name" | cut -d '"' -f 4)
26+
download_url="https://github.com/intel/llvm/archive/refs/tags/${latest_release}.tar.gz"
27+
wget --no-verbose $download_url -O sycl_linux.tar.gz
28+
29+
- name: Extract sycl
30+
run: |
31+
mkdir llvm
32+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
33+
34+
- name: Build sycl
35+
working-directory: llvm
36+
run: |
37+
python3 buildbot/configure.py
38+
python3 buildbot/compile.py -j $(nproc)
39+
40+
- name: Print sycl files
41+
run: |
42+
ls -l llvm
43+
ls -l llvm/build
44+
ls -l llvm/build/lib
45+
ls -l llvm/build/bin
46+
47+
- name: Add sycl to environment variables
48+
run: |
49+
echo "${{ github.workspace }}/llvm/build/bin:$PATH" >> $GITHUB_PATH
50+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
51+
52+
# Install UMF
53+
- name: Checkout UMF
54+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
55+
with:
56+
path: umf_repo
57+
fetch-depth: 0
58+
59+
- name: Configure UMF
60+
working-directory: umf_repo
61+
run: >
62+
cmake
63+
-B build
64+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm/build
65+
-DCMAKE_BUILD_TYPE=Release
66+
-DCMAKE_C_COMPILER=gcc
67+
-DCMAKE_CXX_COMPILER=g++
68+
-DUMF_BUILD_SHARED_LIBRARY=ON
69+
-DUMF_BUILD_TESTS=OFF
70+
-DUMF_BUILD_EXAMPLES=OFF
71+
72+
- name: Build and install UMF
73+
working-directory: umf_repo
74+
run: cmake --build build --target install -j$(nproc)
75+
76+
# Test sycl
77+
- name: Run sycl-ls
78+
run: |
79+
./llvm/bin/sycl-ls
80+
81+
- name: Run sycl tests built locally
82+
working-directory: sycl_repo
83+
run: |
84+
clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o submit-kernel
85+
ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./submit-kernel
86+
87+
- name: Run llvm-lit sycl tests
88+
working-directory: sycl_repo
89+
run: |
90+
llvm-lit --param sycl_devices="level_zero:gpu" sycl/test-e2e
91+
92+
latest-daily:
93+
# run only on upstream; forks will not have the HW
94+
if: github.repository == 'oneapi-src/unified-memory-framework' && false
95+
name: Latest daily build
96+
runs-on: ["DSS-LEVEL_ZERO", "DSS-UBUNTU"]
97+
98+
steps:
99+
# - name: Install apt packages
100+
# run: |
101+
# sudo apt-get update
102+
# sudo apt-get install -y cmake libhwloc-dev ninja-build python3 wget
103+
104+
# Install SYCL
105+
- name: Clean up
106+
run: rm -rf llvm sycl_linux.tar.gz
107+
108+
- name: Download latest SYCL daily release
109+
run: |
110+
latest_tag=$(curl -s https://api.github.com/repos/intel/llvm/releases | awk -F'"' '/"tag_name":/ {print $4; exit}')
111+
download_url="https://github.com/intel/llvm/releases/download/${latest_tag}/sycl_linux.tar.gz"
112+
wget --no-verbose $download_url -O sycl_linux.tar.gz
113+
114+
- name: Extract SYCL
115+
run: |
116+
mkdir llvm
117+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
118+
119+
- name: Add sycl to environment variables
120+
run: |
121+
echo "${{ github.workspace }}/llvm/bin:$PATH" >> $GITHUB_PATH
122+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
123+
124+
# Install UMF
125+
- name: Checkout UMF
126+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
127+
with:
128+
path: umf_repo
129+
fetch-depth: 0
130+
131+
- name: Configure UMF
132+
working-directory: umf_repo
133+
run: >
134+
cmake
135+
-B build
136+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
137+
-DCMAKE_BUILD_TYPE=Release
138+
-DCMAKE_C_COMPILER=gcc
139+
-DCMAKE_CXX_COMPILER=g++
140+
-DUMF_BUILD_SHARED_LIBRARY=ON
141+
-DUMF_BUILD_TESTS=OFF
142+
-DUMF_BUILD_EXAMPLES=OFF
143+
144+
- name: Remove UMF installed with SYCL
145+
run: rm -f llvm/lib/libumf*
146+
147+
- name: Build and install UMF
148+
working-directory: umf_repo
149+
run: cmake --build build --target install -j$(nproc)
150+
151+
- name: Print installed lib files
152+
run: ls -l llvm/lib
153+
154+
# Test sycl-ls
155+
- name: Run sycl-ls
156+
run: |
157+
./llvm/bin/sycl-ls
158+
159+
# Test several sycl e2e test
160+
- name: Checkout sycl
161+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
162+
with:
163+
repository: intel/llvm
164+
path: sycl_repo
165+
fetch-depth: 1
166+
ref: sycl
167+
168+
- name: Build standalone tests
169+
working-directory: sycl_repo/sycl/test-e2e
170+
run: >
171+
cmake
172+
-B build
173+
-DCMAKE_CXX_COMPILER=clang++
174+
-DSYCL_TEST_E2E_TARGETS="level_zero:gpu"
175+
176+
- name: Run standalone tests
177+
working-directory: sycl_repo/sycl/test-e2e
178+
run: cmake --build build --target check-sycl-e2e
179+
180+
- name: Run sycl tests built locally
181+
working-directory: sycl_repo
182+
run: |
183+
clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o submit-kernel
184+
ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./submit-kernel
185+
186+
- name: Run llvm-lit sycl tests
187+
working-directory: sycl_repo
188+
run: |
189+
llvm-lit --param sycl_devices="level_zero:gpu" sycl/test-e2e

0 commit comments

Comments
 (0)