Skip to content

Commit e9c0dd5

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

File tree

2 files changed

+198
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)