Skip to content

Commit ef9ccfd

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

File tree

2 files changed

+171
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)