Skip to content

Commit faa1ed3

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

File tree

2 files changed

+177
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)