Skip to content

Commit fb52f28

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

File tree

2 files changed

+197
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)