Skip to content

Commit c6b7bfb

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

File tree

2 files changed

+199
-0
lines changed

2 files changed

+199
-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: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
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_repo 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 sycl_repo
32+
tar -xzf sycl_linux.tar.gz -C sycl_repo --strip-components=1
33+
34+
- name: Build llvm
35+
working-directory: sycl_repo
36+
run: |
37+
python3 buildbot/configure.py --cmake-opt DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
38+
python3 buildbot/compile.py -j $(nproc)
39+
40+
- name: Remove UMF installed with llvm
41+
run: rm -f llvm/lib/libumf*
42+
43+
- name: Print sycl files
44+
run: |
45+
tree -L 2 llvm/
46+
47+
- name: Add sycl to PATH
48+
run: |
49+
echo "${{ github.workspace }}/llvm/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
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/lib
77+
78+
# Test sycl
79+
- name: Run sycl-ls
80+
env:
81+
LD_LIBRARY_PATH: ${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH
82+
run: |
83+
./llvm/bin/sycl-ls
84+
85+
- name: Run sycl tests built locally
86+
env:
87+
LD_LIBRARY_PATH: ${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH
88+
working-directory: sycl_repo
89+
run: |
90+
clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o submit-kernel -Iinclude
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/lib:$LD_LIBRARY_PATH
96+
working-directory: sycl_repo
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+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
126+
127+
# Install UMF
128+
- name: Checkout UMF
129+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
130+
with:
131+
path: umf_repo
132+
fetch-depth: 0
133+
134+
- name: Configure UMF
135+
working-directory: umf_repo
136+
run: >
137+
cmake
138+
-B build
139+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
140+
-DCMAKE_BUILD_TYPE=Release
141+
-DCMAKE_C_COMPILER=gcc
142+
-DCMAKE_CXX_COMPILER=g++
143+
-DUMF_BUILD_SHARED_LIBRARY=ON
144+
-DUMF_BUILD_TESTS=OFF
145+
-DUMF_BUILD_EXAMPLES=OFF
146+
147+
- name: Remove UMF installed with llvm
148+
run: rm -f llvm/lib/libumf*
149+
150+
- name: Build and install UMF
151+
working-directory: umf_repo
152+
run: cmake --build build --target install -j$(nproc)
153+
154+
- name: Print installed lib files
155+
run: ls -l llvm/lib
156+
157+
# Test sycl-ls
158+
- name: Run sycl-ls
159+
run: |
160+
./llvm/bin/sycl-ls
161+
162+
# Test several sycl e2e test
163+
- name: Checkout sycl
164+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
165+
with:
166+
repository: intel/llvm
167+
path: sycl_repo
168+
fetch-depth: 1
169+
ref: sycl
170+
171+
- name: Build standalone tests
172+
working-directory: sycl_repo/sycl/test-e2e
173+
run: >
174+
cmake
175+
-B build
176+
-DCMAKE_CXX_COMPILER=clang++
177+
-DSYCL_TEST_E2E_TARGETS="level_zero:gpu"
178+
179+
- name: Run standalone tests
180+
working-directory: sycl_repo/sycl/test-e2e
181+
run: cmake --build build --target check-sycl-e2e
182+
183+
- name: Run sycl tests built locally
184+
env:
185+
LD_LIBRARY_PATH: ${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH
186+
working-directory: sycl_repo
187+
run: |
188+
clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o submit-kernel -Iinclude
189+
ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./submit-kernel
190+
191+
- name: Run llvm-lit sycl tests
192+
env:
193+
LD_LIBRARY_PATH: ${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH
194+
working-directory: sycl_repo
195+
run: |
196+
llvm-lit --param sycl_devices="level_zero:gpu" sycl/test-e2e

0 commit comments

Comments
 (0)