Skip to content

Commit 53eba50

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

File tree

2 files changed

+182
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)