Skip to content

Commit af3d609

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

File tree

2 files changed

+173
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)