Skip to content

Commit c28a4e6

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

File tree

2 files changed

+189
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)