Skip to content

Commit 0acf6c0

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

File tree

2 files changed

+169
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)