Skip to content

Commit 863d9fa

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

File tree

2 files changed

+174
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)